diff options
author | flu0r1ne <flu0r1ne@flu0r1ne.net> | 2023-08-28 21:33:44 -0500 |
---|---|---|
committer | flu0r1ne <flu0r1ne@flu0r1ne.net> | 2023-08-28 21:33:44 -0500 |
commit | f0c03a9b8e15387c4defd0a0e3e0298324406fae (patch) | |
tree | 564011d0265666953b17258954ff68614ff6566a /templates | |
parent | 2f0439621cff059e414d67f6ce43a7a6c4de13bc (diff) | |
download | homepage-f0c03a9b8e15387c4defd0a0e3e0298324406fae.tar.xz homepage-f0c03a9b8e15387c4defd0a0e3e0298324406fae.zip |
Add wg2nd
Diffstat (limited to 'templates')
-rw-r--r-- | templates/Default/index.tsx | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/templates/Default/index.tsx b/templates/Default/index.tsx index f693da2..6a307ab 100644 --- a/templates/Default/index.tsx +++ b/templates/Default/index.tsx @@ -4,10 +4,11 @@ import { Breadcrumbs, LinkCrumb } from "../../components/Breadcrumbs"; import Viewport from "../../components/ViewPort"; import styles from './default.module.scss'; -export type DefaultPage = { +export type DefaultPageProps = { className?: string; path?: string; lastUpdated?: string; + children?: React.ReactChild; }; export type RelPathProps = { @@ -16,17 +17,17 @@ export type RelPathProps = { const RelPath : FC<RelPathProps> = ({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 ( <Breadcrumbs> {rels.map((relHref, i) => ( @@ -38,11 +39,11 @@ const RelPath : FC<RelPathProps> = ({path, ...props}) => { ); } -const LastUpdatedDate : FC = ({children}) => ( +const LastUpdatedDate : FC<{ children: React.ReactNode }> = ({children}) => ( <span className={styles.date}><b>Last Updated: </b>{children}</span> ) -const DefaultPage : FC<DefaultPage> = ({className, lastUpdated, children, path, ...props}) => ( +const DefaultPage : FC<DefaultPageProps> = ({className, lastUpdated, children, path, ...props}) => ( <Viewport className={clsx(styles.viewportOverrides, className)} > @@ -52,4 +53,4 @@ const DefaultPage : FC<DefaultPage> = ({className, lastUpdated, children, path, </Viewport> ); -export default DefaultPage;
\ No newline at end of file +export default DefaultPage; |