From ef4fb0a5277ee99bd0f1747b77e733ef7f02460d Mon Sep 17 00:00:00 2001 From: flu0r1ne Date: Wed, 6 Sep 2023 19:53:23 -0500 Subject: Make BreadCrumbs domain agnostic --- templates/Default/index.tsx | 36 ++++-------------------------------- 1 file changed, 4 insertions(+), 32 deletions(-) (limited to 'templates') diff --git a/templates/Default/index.tsx b/templates/Default/index.tsx index 6a307ab..ccfde4a 100644 --- a/templates/Default/index.tsx +++ b/templates/Default/index.tsx @@ -1,8 +1,8 @@ -import clsx from "clsx"; -import React, { FC } from "react"; -import { Breadcrumbs, LinkCrumb } from "../../components/Breadcrumbs"; +import React, { FC } from 'react'; +import PathCrumbs from "../../components/PathCrumbs"; import Viewport from "../../components/ViewPort"; import styles from './default.module.scss'; +import clsx from 'clsx'; export type DefaultPageProps = { className?: string; @@ -11,34 +11,6 @@ export type DefaultPageProps = { children?: React.ReactChild; }; -export type RelPathProps = { - path: string; -}; - -const RelPath : FC = ({path, ...props}) => { - const _path = path[path.length - 1] === '/' ? path.substr(0, path.length - 1) : path; - - const parts = _path.split('/'); - const rels = ['']; - - for(let i = 1; i < parts.length; i++) { - rels.push([rels[i - 1], parts[i]].join('/')); - } - - rels[0] = '/'; - parts[0] = 'flu0r1ne.net'; - - return ( - - {rels.map((relHref, i) => ( - - {parts[i]} - - ))} - - ); -} - const LastUpdatedDate : FC<{ children: React.ReactNode }> = ({children}) => ( Last Updated: {children} ) @@ -47,7 +19,7 @@ const DefaultPage : FC = ({className, lastUpdated, children, p - {path !== undefined ? : undefined} + {path !== undefined ? : undefined} {lastUpdated ? {lastUpdated} : undefined} {children} -- cgit v1.2.3