Browse Source

🐛 Add `onClose` to `SidebarItems` (#589)

pull/13907/head
Alejandra 2 years ago
committed by GitHub
parent
commit
cbba08d565
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 2
      src/new-frontend/src/components/Sidebar.tsx
  2. 8
      src/new-frontend/src/components/SidebarItems.tsx

2
src/new-frontend/src/components/Sidebar.tsx

@ -23,7 +23,7 @@ const Sidebar: React.FC = () => {
<Flex flexDir="column" justify="space-between" h="100%">
<Box>
<Image src={Logo} alt="Logo" />
<SidebarItems />
<SidebarItems onClose={onClose} />
</Box>
<UserInfo />
</Flex>

8
src/new-frontend/src/components/SidebarItems.tsx

@ -12,12 +12,16 @@ const items = [
{ icon: FiLogOut, title: 'Log out' }
];
const SidebarItems: React.FC = () => {
interface SidebarItemsProps {
onClose?: () => void;
}
const SidebarItems: React.FC<SidebarItemsProps> = ({ onClose }) => {
const listItems = items.map((item) => (
<Flex w="100%" p={2} key={item.title} _hover={{
background: "gray.200",
borderRadius: "12px",
}}>
}} onClick={onClose}>
<Link to={item.path || "/"}>
<Flex color="teal.500" gap={4}>
<Icon as={item.icon} alignSelf="center" />

Loading…
Cancel
Save