1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

Добавили заметки в сайдбар (#126)

* added notes sidebar

* added note dropping and editing

* added sidebar navigation

* handling sidebarchanges over time

* using router back for closing sidebar

* fixed tripping inside single sidebar

* added superpowers toggle to sidebar

* user button opens sidebar now

* added profile cover for profile sidebar

* removed profile sidebar completely

* ran prettier over project

* added note not found error literal
This commit is contained in:
muerwre 2022-08-12 14:07:19 +07:00 committed by GitHub
parent fe3db608d6
commit 5d34090238
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
72 changed files with 1241 additions and 664 deletions

View file

@ -34,14 +34,17 @@ const lazy = {
};
export const FlowSwiperHero: FC<Props> = ({ heroes }) => {
const { isMobile } = useWindowSize();
const { isTablet } = useWindowSize();
const { push } = useNavigation();
const [controlledSwiper, setControlledSwiper] = useState<SwiperClass | undefined>(undefined);
const [controlledSwiper, setControlledSwiper] = useState<
SwiperClass | undefined
>(undefined);
const [currentIndex, setCurrentIndex] = useState(heroes.length);
const preset = useMemo(() => (isMobile ? ImagePresets.cover : ImagePresets.small_hero), [
isMobile,
]);
const preset = useMemo(
() => (isTablet ? ImagePresets.cover : ImagePresets.small_hero),
[isTablet],
);
const onNext = useCallback(() => {
controlledSwiper?.slideNext(1);
@ -79,7 +82,7 @@ export const FlowSwiperHero: FC<Props> = ({ heroes }) => {
(sw: SwiperClass) => {
push(URLS.NODE_URL(heroes[sw.realIndex]?.id));
},
[push, heroes]
[push, heroes],
);
if (!heroes.length) {