From f1f25f4764dd8d297a59765b0df85f55da2b39ee Mon Sep 17 00:00:00 2001 From: flu0r1ne Date: Mon, 19 Jul 2021 21:08:50 -0500 Subject: Init --- components/Breadcrumbs/breadcrumbs.module.scss | 15 ++++++++ components/Breadcrumbs/index.tsx | 50 ++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) create mode 100644 components/Breadcrumbs/breadcrumbs.module.scss create mode 100644 components/Breadcrumbs/index.tsx (limited to 'components/Breadcrumbs') diff --git a/components/Breadcrumbs/breadcrumbs.module.scss b/components/Breadcrumbs/breadcrumbs.module.scss new file mode 100644 index 0000000..104eec2 --- /dev/null +++ b/components/Breadcrumbs/breadcrumbs.module.scss @@ -0,0 +1,15 @@ +.crumb { + font-size: 1.10rem; +} + +.divider { + font-size: 1.0rem; +} + +.crumb { + align-content: center; +} + +.divider { + margin: 0 0.3rem; +} \ No newline at end of file diff --git a/components/Breadcrumbs/index.tsx b/components/Breadcrumbs/index.tsx new file mode 100644 index 0000000..ed650e3 --- /dev/null +++ b/components/Breadcrumbs/index.tsx @@ -0,0 +1,50 @@ +import React, { Children, FC } from "react"; +import Link from "next/link"; +import styles from './breadcrumbs.module.scss'; +import clsx from 'clsx'; + +export type BreadcrumbsProps = { + className?: string; + style?: object; +}; + +const Breadcrumbs : FC = ({children, className, ...props}) => ( +
+ {Children.map(children, (child, index) => { + return ( + <> + { + index !== 0 ? ( + / + ) : undefined + } + {child} + + ); + })} +
+); + +const Crumb : FC = ({children, ...props}) => ( + + {children} + +); + +export type LinkCrumbProps = { + href: string; +} + +const LinkCrumb : FC = ({children, href, ...props}) => ( + + + {children} + + +); + +export { + Crumb, + Breadcrumbs, + LinkCrumb +}; \ No newline at end of file -- cgit v1.2.3