-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Добавить новый пользовательский функционал #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<> ?
@@ -23,11 +25,15 @@ const localFetcher = async ( | |||
} | |||
} 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.
а это вроде не надо нам
"date-fns": "^3.6.0", | ||
"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=
Реализовать: