From f872bec62984db3fc1fd998fa9ad75b7c93cb8a3 Mon Sep 17 00:00:00 2001 From: Djeeberjr Date: Wed, 29 Sep 2021 21:00:58 +0200 Subject: [PATCH] improved breadcrum --- src/components/Breadcrum.tsx | 40 ++++++++++++++++++++++-------------- src/index.scss | 4 ++++ 2 files changed, 29 insertions(+), 15 deletions(-) diff --git a/src/components/Breadcrum.tsx b/src/components/Breadcrum.tsx index e744d64..0c96957 100644 --- a/src/components/Breadcrum.tsx +++ b/src/components/Breadcrum.tsx @@ -1,45 +1,55 @@ import React from "react" import ObjID from "../types/ObjID" import { ReactComponent as BreadcrumImage } from "./../assets/breadcrum.svg" +import { Link } from "react-router-dom" interface Props{ - path: ObjID + path?: ObjID onDirClick?: (path: ObjID) => void } -const Breadcrum: React.FC = (props) => { - const keyParts = props.path.key.split("/").filter(e=>e.length > 0) +const Breadcrum: React.FC = ({path,onDirClick}) => { + + if (!path){ + return
    +
    + + Home + +
    +
+ } + + const keyParts = path.key.split("/").filter(e=>e.length > 0) return (