Skip to content

Commit

Permalink
fix: fix number in red dot of trusts
Browse files Browse the repository at this point in the history
  • Loading branch information
samwel141 committed May 12, 2024
1 parent 21ffd8b commit 5541f6c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
5 changes: 5 additions & 0 deletions src/components/layout/Layout.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,14 @@ import { useEffect, useState } from "react";
import { useLocation } from "react-router-dom";
import { StyledContent } from "./LayoutStyled";
import Menu from "./Menu/Menu";
import { useTrustRelationshipsContext } from "../../store/TrustRelationshipsContext";


const Layout = ({ children }) => {
const [open, setOpen] = useState(false);

const { count } = useTrustRelationshipsContext();

const handleDrawerOpen = () => {
setOpen(true);
};
Expand Down Expand Up @@ -40,6 +44,7 @@ const Layout = ({ children }) => {
<Box sx={{ display: "flex" }}>
<Menu
open={open}
count={count}
handleDrawerClose={handleDrawerClose}
handleDrawerOpen={handleDrawerOpen}
/>
Expand Down
7 changes: 2 additions & 5 deletions src/components/layout/Menu/Menu.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,8 @@ import * as React from 'react';
import MenuItem from './MenuItem/MenuItem';
import { DrawerHeaderStyled, DrawerStyled } from './MenuStyled';
import TopMenu from './TopMenu/TopMenu';
import { TrustRelationshipsProvider } from '../../../store/TrustRelationshipsContext';

const Menu = ({ open, handleDrawerClose, handleDrawerOpen }) => {
const Menu = ({ open, handleDrawerClose, handleDrawerOpen, count }) => {
const theme = useTheme();

return (
Expand All @@ -24,9 +23,7 @@ const Menu = ({ open, handleDrawerClose, handleDrawerOpen }) => {
)}
</IconButton>
</DrawerHeaderStyled>
<TrustRelationshipsProvider>
<MenuItem open={open} />
</TrustRelationshipsProvider>
<MenuItem count={count} open={open} />
</DrawerStyled>
</>
);
Expand Down
4 changes: 1 addition & 3 deletions src/components/layout/Menu/MenuItem/MenuItem.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,10 @@ import HandshakeIcon from '@mui/icons-material/Handshake';
import DriveFileMoveIcon from '@mui/icons-material/DriveFileMove';
import * as React from 'react';
import LinkItem from './LinkItem';
import { useTrustRelationshipsContext } from '../../../../store/TrustRelationshipsContext';
import { useState } from 'react';

const MenuItem = ({ open }) => {
const MenuItem = ({ open, count }) => {
const [isHovered, setIsHovered] = useState(false);
const { count } = useTrustRelationshipsContext();

return (
<>
Expand Down

0 comments on commit 5541f6c

Please sign in to comment.