From 1352b18b5fc55e2fafc66c7ee9c2eca891cb3dbd Mon Sep 17 00:00:00 2001 From: Sean Hatfield Date: Thu, 14 Mar 2024 10:52:35 -0700 Subject: [PATCH] [FEAT] Implement correct highlight colors on document picker (#897) * implement alternating color rows for file picker * implement alternating colors for workspace directory * remove unneeded props/variables * remove unused border classes * remove unneeded expanded prop from filerow component --- .../Documents/Directory/FileRow/index.jsx | 12 ++++++------ .../Documents/Directory/FolderRow/index.jsx | 9 ++++----- .../WorkspaceFileRow/index.jsx | 4 ++-- .../Documents/WorkspaceDirectory/index.jsx | 4 ++-- frontend/src/index.css | 16 ++++++++++++++++ 5 files changed, 30 insertions(+), 15 deletions(-) diff --git a/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/FileRow/index.jsx b/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/FileRow/index.jsx index 7e2259b2..976c6598 100644 --- a/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/FileRow/index.jsx +++ b/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/FileRow/index.jsx @@ -13,7 +13,6 @@ export default function FileRow({ folderName, selected, toggleSelection, - expanded, fetchKeys, setLoading, setLoadingMessage, @@ -53,12 +52,13 @@ export default function FileRow({ const handleMouseEnter = debounce(handleShowTooltip, 500); const handleMouseLeave = debounce(handleHideTooltip, 500); + return ( -
toggleSelection(item)} - className={`transition-all duration-200 text-white/80 text-xs grid grid-cols-12 py-2 pl-3.5 pr-8 border-b border-white/20 hover:bg-sky-500/20 cursor-pointer ${`${ - selected ? "bg-sky-500/20" : "" - } ${expanded ? "bg-sky-500/10" : ""}`}`} + className={`transition-all duration-200 text-white/80 text-xs grid grid-cols-12 py-2 pl-3.5 pr-8 hover:bg-sky-500/20 cursor-pointer file-row ${ + selected ? "selected" : "" + }`} >
-
+ ); } diff --git a/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/FolderRow/index.jsx b/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/FolderRow/index.jsx index 5b7f1be3..48953ab1 100644 --- a/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/FolderRow/index.jsx +++ b/frontend/src/components/Modals/MangeWorkspace/Documents/Directory/FolderRow/index.jsx @@ -47,10 +47,10 @@ export default function FolderRow({ return ( <> -
@@ -88,7 +88,7 @@ export default function FolderRow({ /> )}
-
+ {expanded && (
{item.items.map((fileItem) => ( @@ -97,7 +97,6 @@ export default function FolderRow({ item={fileItem} folderName={item.name} selected={isSelected(fileItem.id)} - expanded={expanded} toggleSelection={toggleSelection} fetchKeys={fetchKeys} setLoading={setLoading} diff --git a/frontend/src/components/Modals/MangeWorkspace/Documents/WorkspaceDirectory/WorkspaceFileRow/index.jsx b/frontend/src/components/Modals/MangeWorkspace/Documents/WorkspaceDirectory/WorkspaceFileRow/index.jsx index 3367c728..f7391629 100644 --- a/frontend/src/components/Modals/MangeWorkspace/Documents/WorkspaceDirectory/WorkspaceFileRow/index.jsx +++ b/frontend/src/components/Modals/MangeWorkspace/Documents/WorkspaceDirectory/WorkspaceFileRow/index.jsx @@ -53,8 +53,8 @@ export default function WorkspaceFileRow({ const handleMouseLeave = debounce(handleHideTooltip, 500); return (
-
+

Name

Date

Kind

@@ -148,7 +148,7 @@ const PinAlert = memo(() => {
-
+

diff --git a/frontend/src/index.css b/frontend/src/index.css index e2141d8d..b355eb20 100644 --- a/frontend/src/index.css +++ b/frontend/src/index.css @@ -597,3 +597,19 @@ dialog::backdrop { font-weight: 600; color: #fff; } + +.file-row:nth-child(odd) { + @apply bg-[#1C1E21]; +} + +.file-row:nth-child(even) { + @apply bg-[#2C2C2C]; +} + +.file-row.selected:nth-child(odd) { + @apply bg-sky-500/20; +} + +.file-row.selected:nth-child(even) { + @apply bg-sky-500/10; +}