-
Notifications
You must be signed in to change notification settings - Fork 0
Добавить новый пользовательский функционал #443
base: notifications-tg
Are you sure you want to change the base?
Conversation
| import { Icon16DoneCircle, Icon56MarketOutline } from '@vkontakte/icons' | ||
| import { useState } from 'react' | ||
|
|
||
| const urls = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
создай мб файлик/папку config и давай туда вынесем
| ] | ||
|
|
||
| const UserEditModal = ({ id }: { id: string }) => { | ||
| const [selectAva, setSelectAva] = useState(urls[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ну, это надо хранить в бд, мы оба понимаем
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
или хотя бы в кеше*)
| <Flex margin='auto' gap='2xl' justify='center'> | ||
| {urls.map((url, index) => ( | ||
| <Avatar | ||
| key={index} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
key={url} ?
| size={110} | ||
| src={url} | ||
| onClick={() => selectCurrAva(url)} | ||
| className={selectAva === url ? 'select-avatar' : ''} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| className={selectAva === url ? 'select-avatar' : ''} | |
| className={selectAva === url ? 'select-avatar' : undefined} |
|
|
||
| <Group header={<Header mode='secondary'>Мои аватарки</Header>}> | ||
| <Flex margin='auto' gap='2xl' justify='center'> | ||
| {urls.map((url, index) => ( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| {urls.map((url, index) => ( | |
| {urls.map((url) => ( |
| closeModal: () => void | ||
| } | ||
|
|
||
| const avaTypes = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
давай вынесем в файлик какой-нибудь config или около того
| pictured: ['Не важно', 'Парень', 'Девушка'] | ||
| } | ||
|
|
||
| const filtersModal: FC<Props> = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| const filtersModal: FC<Props> = ({ | |
| const FiltersModal: FC<Props> = ({ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- файл переименовать
| setSelectedPictured(value) | ||
| } | ||
|
|
||
| const platform = usePlatform() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а если запущено в браузере?
| } from '@vkontakte/vkui' | ||
| import { useState } from 'react' | ||
|
|
||
| const urls = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
config
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
если эти ссылки дублируются, то можно их куда-то в apps/web/shared унести
apps/web/src/pages/Market/index.tsx
Outdated
| import FiltersModal from './components/filtersModal.tsx' | ||
| import MarketHeader from './components/marketHeader.tsx' | ||
|
|
||
| const urls = [ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
если эти ссылки дублируются, то можно их куда-то в apps/web/shared унести
|
|
||
| // REMOVE IT | ||
| // ? | ||
| export type AvatarModelType = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
уже есть такой тип в shared
|
|
||
| // REMOVE IT | ||
| // ? | ||
| export type AvatarTagModelType = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
вынести в shared, если ещё не там (если есть необходимость использовать на фронте)
| type IAvatarsFromDB = IAvatarModelType & { | ||
| avatarTags: (IAvatarTagModelType & { | ||
| tag: ITagModelType | ||
| })[] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Array<> ?
| } | ||
| } catch {} | ||
|
|
||
| if (!result) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
а это вроде не надо нам
| "react": "^18.3.1", | ||
| "react-dom": "^18.3.1", | ||
| "bun": "^1.1.34" | ||
| "react-virtualized": "^9.22.5" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
это кто
| offset: number | ||
| } | ||
|
|
||
| const url = `${API_URL}/uploads/avatars/` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
вынести в config
| } from '@vkontakte/vkui' | ||
| import { type FC, useState } from 'react' | ||
|
|
||
| const urls = ['https://mangabuff.ru/img/avatars/x150/806.gif'] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
вынести
| } | ||
|
|
||
| export const HeaderPanel: FC<Props> = ({ isLoading, isError }) => { | ||
| const [selectAva] = useState(urls[0]) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
точно ли тебе нужен state без второй функции?
| before={<Icon28Notifications />} | ||
| onClick={async () => | ||
| window.open( | ||
| `${TG_BOT_URL}?text=/subscribe ${await getSecureToken()}`, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ссылку в конфиг вынести, + обсуждали, что лучше через ?start=
Реализовать: