-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add product related paths, layouts and contents
- Add productPaths to handle product page layout rendering logic - Implement ProductLayout for product specific layouts - Introduce new ProductContent component with product specific details and functionality - Create new pages and templates for product display and interaction - Ensure components support product routing and display across the application
- Loading branch information
1 parent
dadc558
commit e044476
Showing
6 changed files
with
580 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
import { Box } from '@chakra-ui/react'; | ||
import React, { FC, useMemo, useState } from 'react'; | ||
import LeftNav from '../shared/containers/navigation/LeftNav'; | ||
import MainBreadcrumb from '../shared/containers/navigation/components/MainBreadcrumb'; | ||
import PageDirectory from '../shared/containers/navigation/components/page-directory/PageDirectory'; | ||
import MainGrid from '../shared/containers/components/MainGrid'; | ||
import { useMenuContext } from '../shared/contexts/menu'; | ||
import { MainBreadcrumbPart } from '../shared/types/navigation'; | ||
import { createBreadCrumbParts } from '../shared/utils/navigation'; | ||
|
||
interface ProductLayoutProps { | ||
children?: React.ReactNode; | ||
path?: string; | ||
isCommunity?: boolean; | ||
} | ||
|
||
const ProductLayout: FC<ProductLayoutProps> = ({ children, path, isCommunity }) => { | ||
const { menuStructure } = useMenuContext(); | ||
|
||
// const [isExpanded, setIsExpanded] = useState(true); | ||
|
||
const breadcrumbParts: MainBreadcrumbPart[] = useMemo(() => { | ||
return [ | ||
{ | ||
name: 'Produkte', | ||
isDisabled: path === '/product/', | ||
href: '/product' | ||
}, | ||
...createBreadCrumbParts(menuStructure) | ||
]; | ||
}, [menuStructure]); | ||
|
||
const memoedChildren = useMemo(() => children, [children]); | ||
|
||
return ( | ||
<MainGrid isLeftNavExpanded={false}> | ||
{/* <Box display={{ base: 'none', md: 'block' }} position="sticky"> | ||
<LeftNav isExpanded={isExpanded} setIsExpanded={setIsExpanded}> | ||
<Box w={isExpanded ? 'auto' : 0}> | ||
<PageDirectory data={menuStructure} isExpanded={isExpanded} path={path} /> | ||
</Box> | ||
</LeftNav> | ||
</Box> */} | ||
|
||
<Box minW="full"> | ||
{!isCommunity && ( | ||
<Box overflow="hidden"> | ||
<MainBreadcrumb parts={breadcrumbParts} /> | ||
</Box> | ||
)} | ||
<Box>{memoedChildren}</Box> | ||
</Box> | ||
</MainGrid> | ||
); | ||
}; | ||
|
||
export default ProductLayout; |
Oops, something went wrong.