Add project to breadcrumb

This commit is contained in:
David Corbitt
2023-08-07 11:50:59 -07:00
parent 57166e96b4
commit c9f59bfb79
8 changed files with 67 additions and 31 deletions

View File

@@ -0,0 +1,34 @@
import { HStack, Flex, Text } from "@chakra-ui/react";
import Link from "next/link";
import { useSelectedOrg } from "~/utils/hooks";
// Have to export only contents here instead of full BreadcrumbItem because Chakra doesn't
// recognize a BreadcrumbItem exported with this component as a valid child of Breadcrumb.
export default function ProjectBreadcrumbContents() {
const { data: selectedOrg } = useSelectedOrg();
return (
<Link href="/home">
<HStack w="full">
<Flex
p={1}
borderRadius={4}
backgroundColor="orange.100"
minW={6}
maxW={6}
minH={6}
maxH={6}
alignItems="center"
justifyContent="center"
>
<Text>{selectedOrg?.name[0]?.toUpperCase()}</Text>
</Flex>
<Text display={{ base: "none", md: "block" }} py={1}>
{selectedOrg?.name}
</Text>
</HStack>
</Link>
);
}