Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
173 changes: 87 additions & 86 deletions src/components/sidebar/components/Links.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,105 +26,106 @@ export function SidebarLinks(props) {
// this function creates the links from the secondary accordions (for example auth -> sign-in -> default)
const createLinks = (routes) => {
return routes.map((route, index) => {
if (route.category) {
return (
<>
<Text
fontSize={"md"}
color={activeColor}
fontWeight='bold'
mx='auto'
ps={{
sm: "10px",
xl: "16px",
}}
pt='18px'
pb='12px'
key={index}>
{route.name}
</Text>
{createLinks(route.items)}
</>
);
} else if (
route.layout === "/admin" ||
route.layout === "/auth" ||
route.layout === "/rtl"
) {
return (
<NavLink key={index} to={route.layout + route.path}>
{route.icon ? (
<Box>
<HStack
spacing={
activeRoute(route.path.toLowerCase()) ? "22px" : "26px"
}
py='5px'
ps='10px'>
<Flex w='100%' alignItems='center' justifyContent='center'>
if (route.hidden)
if (route.category) {
return (
<>
<Text
fontSize={"md"}
color={activeColor}
fontWeight='bold'
mx='auto'
ps={{
sm: "10px",
xl: "16px",
}}
pt='18px'
pb='12px'
key={index}>
{route.name}
</Text>
{createLinks(route.items)}
</>
);
} else if (
route.layout === "/admin" ||
route.layout === "/auth" ||
route.layout === "/rtl"
) {
return (
<NavLink key={index} to={route.layout + route.path}>
{route.icon ? (
<Box>
<HStack
spacing={
activeRoute(route.path.toLowerCase()) ? "22px" : "26px"
}
py='5px'
ps='10px'>
<Flex w='100%' alignItems='center' justifyContent='center'>
<Box
color={
activeRoute(route.path.toLowerCase())
? activeIcon
: textColor
}
me='18px'>
{route.icon}
</Box>
<Text
me='auto'
color={
activeRoute(route.path.toLowerCase())
? activeColor
: textColor
}
fontWeight={
activeRoute(route.path.toLowerCase())
? "bold"
: "normal"
}>
{route.name}
</Text>
</Flex>
<Box
color={
h='36px'
w='4px'
bg={
activeRoute(route.path.toLowerCase())
? activeIcon
: textColor
? brandColor
: "transparent"
}
me='18px'>
{route.icon}
</Box>
borderRadius='5px'
/>
</HStack>
</Box>
) : (
<Box>
<HStack
spacing={
activeRoute(route.path.toLowerCase()) ? "22px" : "26px"
}
py='5px'
ps='10px'>
<Text
me='auto'
color={
activeRoute(route.path.toLowerCase())
? activeColor
: textColor
: inactiveColor
}
fontWeight={
activeRoute(route.path.toLowerCase())
? "bold"
: "normal"
activeRoute(route.path.toLowerCase()) ? "bold" : "normal"
}>
{route.name}
</Text>
</Flex>
<Box
h='36px'
w='4px'
bg={
activeRoute(route.path.toLowerCase())
? brandColor
: "transparent"
}
borderRadius='5px'
/>
</HStack>
</Box>
) : (
<Box>
<HStack
spacing={
activeRoute(route.path.toLowerCase()) ? "22px" : "26px"
}
py='5px'
ps='10px'>
<Text
me='auto'
color={
activeRoute(route.path.toLowerCase())
? activeColor
: inactiveColor
}
fontWeight={
activeRoute(route.path.toLowerCase()) ? "bold" : "normal"
}>
{route.name}
</Text>
<Box h='36px' w='4px' bg='brand.400' borderRadius='5px' />
</HStack>
</Box>
)}
</NavLink>
);
}
<Box h='36px' w='4px' bg='brand.400' borderRadius='5px' />
</HStack>
</Box>
)}
</NavLink>
);
}
});
};
// BRAND
Expand Down