-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Header #5
Header #5
Conversation
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.
Предлагаю вместо classes.ts обозвать их styles.ts, все-таки classes - слишком многозначное слово )
setTimeout(() => setSubMenuOpenId('none'), 0); | ||
}; | ||
|
||
const { anchor, isOpen, items, onMenuClose } = 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.
Если я не ошибаюсь, пропсы лучше в самое начало поднять
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.
done
src/components/Header/navMenuData.ts
Outdated
}, | ||
]; | ||
|
||
export const teamsItems = [ |
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.
убраны
src/components/Header/navMenuData.ts
Outdated
const teamsId = 'teams'; | ||
export const mobileMenuId = 'mobileMenu'; | ||
|
||
export const gamesItems: ISubMenuItem[] = [ |
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.
Здесь и далее, выражение типа ISubMenuItem[] можно заменить, например, Array и прописать интерфейс IMenuItem
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.
done
{items && renderItems()} | ||
</Menu> | ||
); | ||
}; | ||
|
||
export const NavigationMenu: React.FC = () => { | ||
const [subMenuOpenId, setSubMenuOpenId] = useState<string>(''); |
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.
useState(''), зачем дополнительно типизовать useState? Ты же ему и так string скормила?
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.
done
export type ISubMenuItem = { | ||
label: string; | ||
withLink: boolean; | ||
linkAddress?: string; |
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.
linkAdress (лишняя 'd')
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.
No description provided.