Skip to content
This repository has been archived by the owner on Apr 14, 2024. It is now read-only.

Commit

Permalink
disabled для настроек и уведомлений (#54)
Browse files Browse the repository at this point in the history
  • Loading branch information
VictoriaBorovskaya authored Nov 6, 2023
1 parent cb3852e commit 3955030
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
8 changes: 5 additions & 3 deletions src/features/user/notification/Notification.tsx
Original file line number Diff line number Diff line change
@@ -1,22 +1,24 @@
import { IconButton, Icon, Box } from '@chakra-ui/react';
import { IoNotifications } from 'react-icons/io5';
import { Link } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';

import { useIsAuth } from '~/shared/hooks';
import { PATHS } from '~/shared/lib/router';
import { Counter } from '~/shared/ui/Counter';

export function Notification() {
const isAuth = useIsAuth();
const navigate = useNavigate();

return (
<IconButton
isDisabled={!isAuth}
size="sm"
variant="flat"
aria-label="notification"
as={Link}
to={PATHS.notifications}
onClick={() => {
navigate(PATHS.notifications);
}}
icon={
<Box position="relative">
<Icon as={IoNotifications} fontSize="2xl" />
Expand Down
9 changes: 6 additions & 3 deletions src/features/user/settings/Settings.tsx
Original file line number Diff line number Diff line change
@@ -1,21 +1,24 @@
import { Icon, IconButton } from '@chakra-ui/react';
import { IoSettings } from 'react-icons/io5';
import { Link } from 'react-router-dom';
import { useNavigate } from 'react-router-dom';

import { useIsAuth } from '~/shared/hooks';
import { PATHS } from '~/shared/lib/router';

export function Settings() {
const isAuth = useIsAuth();
const navigate = useNavigate();

return (
<IconButton
isDisabled={!isAuth}
size="sm"
variant="flat"
aria-label="settings"
to={PATHS.settings}
as={Link}
icon={<Icon as={IoSettings} fontSize="2xl" />}
onClick={() => {
navigate(PATHS.settings);
}}
/>
);
}

0 comments on commit 3955030

Please sign in to comment.