From 78caea4e925d1e3d47a0e8f0d636e306e1e7cf92 Mon Sep 17 00:00:00 2001 From: Montassar Ghanmy Date: Fri, 2 Jun 2023 10:08:39 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=8D=9E=20Improved=20path=20breadcrumb=20(?= =?UTF-8?q?#62)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/publish-frontend.yml | 2 +- .../views/client/body/drive/header-path.tsx | 119 ++++++++++++------ 2 files changed, 80 insertions(+), 41 deletions(-) diff --git a/.github/workflows/publish-frontend.yml b/.github/workflows/publish-frontend.yml index 8629f171..384290ea 100644 --- a/.github/workflows/publish-frontend.yml +++ b/.github/workflows/publish-frontend.yml @@ -22,7 +22,7 @@ jobs: strategy: matrix: - node-version: [14.x] + node-version: [16.x] steps: - uses: actions/checkout@v2 diff --git a/tdrive/frontend/src/app/views/client/body/drive/header-path.tsx b/tdrive/frontend/src/app/views/client/body/drive/header-path.tsx index 590fb6f2..0b5507dd 100644 --- a/tdrive/frontend/src/app/views/client/body/drive/header-path.tsx +++ b/tdrive/frontend/src/app/views/client/body/drive/header-path.tsx @@ -1,4 +1,3 @@ -import { Button } from '@atoms/button/button'; import { Title } from '@atoms/text'; import { DriveItem } from '@features/drive/types'; import { ChevronDownIcon } from '@heroicons/react/solid'; @@ -33,18 +32,48 @@ export const PathRender = ({ inTrash: boolean; onClick: (id: string) => void; }) => { + const pathLength = (path || []).reduce((acc, curr) => acc + curr.name.length, 0); return ( - - {(path || [])?.map((a, i) => ( - <PathItem - key={a.id} - item={a} - first={i === 0} - last={i + 1 === path?.length} - onClick={onClick} - /> - ))} - + ); }; @@ -61,40 +90,50 @@ const PathItem = ({ }) => { const { user } = useCurrentUser(); return ( - + {!last && ( + + )} + ); };