Skip to content

Commit

Permalink
add close sidenav button to v04
Browse files Browse the repository at this point in the history
  • Loading branch information
andreymikhadyuk committed Nov 14, 2023
1 parent 13537f9 commit 48c3040
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,11 @@
}
}

.closeIconWrapper {
margin-left: auto;
padding: 1.25rem 1.5rem;
}

.separator {
flex-shrink: 0;
height: 0.0625rem;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,9 @@ import { useSelector } from "react-redux";
import classNames from "classnames";
import { authentificated, selectUser } from "@/pages/Auth/store/selectors";
import commonLogoSrc from "@/shared/assets/images/logo-sidenav-2.svg";
import { ButtonIcon } from "@/shared/components";
import { useIsTabletView } from "@/shared/hooks/viewport";
import { Close2Icon } from "@/shared/icons";
import { CommonLogo } from "@/shared/ui-kit";
import { getUserName } from "@/shared/utils";
import {
Expand All @@ -17,10 +19,11 @@ import styles from "./SidenavContent.module.scss";

interface SidenavContentProps {
className?: string;
onClose?: () => void;
}

const SidenavContent: FC<SidenavContentProps> = (props) => {
const { className } = props;
const { className, onClose } = props;
const isAuthenticated = useSelector(authentificated());
const user = useSelector(selectUser());
const isTabletView = useIsTabletView();
Expand All @@ -39,6 +42,11 @@ const SidenavContent: FC<SidenavContentProps> = (props) => {
logoClassName={styles.commonLogo}
logoSrc={commonLogoSrc}
/>
{isTabletView && (
<ButtonIcon className={styles.closeIconWrapper} onClick={onClose}>
<Close2Icon />
</ButtonIcon>
)}
{!isTabletView && (
<>
{separatorEl}
Expand Down

0 comments on commit 48c3040

Please sign in to comment.