Properly pass color into IconLink

This commit is contained in:
David Corbitt
2023-07-11 16:46:47 -06:00
parent ebe4d5bef6
commit 357e28c463

View File

@@ -23,7 +23,7 @@ import { useState, useEffect } from "react";
type IconLinkProps = BoxProps & LinkProps & { label: string; icon: IconType; href: string }; type IconLinkProps = BoxProps & LinkProps & { label: string; icon: IconType; href: string };
const IconLink = ({ icon, label, href, target, ...props }: IconLinkProps) => { const IconLink = ({ icon, label, href, target, color, ...props }: IconLinkProps) => {
const isActive = useRouter().pathname.startsWith(href); const isActive = useRouter().pathname.startsWith(href);
return ( return (
<Box <Box
@@ -38,7 +38,7 @@ const IconLink = ({ icon, label, href, target, ...props }: IconLinkProps) => {
cursor="pointer" cursor="pointer"
{...props} {...props}
> >
<HStack w="full" px={4} color="gray.700"> <HStack w="full" px={4} color={color}>
<Icon as={icon} boxSize={6} mr={2} /> <Icon as={icon} boxSize={6} mr={2} />
<Text fontWeight="bold">{label}</Text> <Text fontWeight="bold">{label}</Text>
</HStack> </HStack>