From ecfe7564c94ab76b898f49ecc469f8f2127a1220 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Wed, 26 Nov 2025 00:02:10 +0100 Subject: [PATCH] pl-fe: do not use inline tailwind for new code at least MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- packages/pl-fe/src/pages/drive/drive.tsx | 27 +++++++--------- packages/pl-fe/src/styles/new/drive.scss | 41 ++++++++++++++++++++++++ packages/pl-fe/src/styles/new/index.scss | 1 + packages/pl-fe/src/styles/ptr.scss | 2 +- 4 files changed, 54 insertions(+), 17 deletions(-) create mode 100644 packages/pl-fe/src/styles/new/drive.scss diff --git a/packages/pl-fe/src/pages/drive/drive.tsx b/packages/pl-fe/src/pages/drive/drive.tsx index 6c55ee0d5..c2ff9e7f2 100644 --- a/packages/pl-fe/src/pages/drive/drive.tsx +++ b/packages/pl-fe/src/pages/drive/drive.tsx @@ -6,7 +6,6 @@ import { useHistory } from 'react-router-dom'; import DropdownMenu, { Menu } from 'pl-fe/components/dropdown-menu'; import { EmptyMessage } from 'pl-fe/components/empty-message'; import Column from 'pl-fe/components/ui/column'; -import HStack from 'pl-fe/components/ui/hstack'; import Icon from 'pl-fe/components/ui/icon'; import IconButton from 'pl-fe/components/ui/icon-button'; import { MIMETYPE_ICONS } from 'pl-fe/components/upload'; @@ -217,14 +216,12 @@ const File: React.FC = ({ file }) => { }, [file]); return ( -
-
+
+
@@ -232,18 +229,17 @@ const File: React.FC = ({ file }) => { {file.thumbnail_url && isMedia ? ( {file.description ) : ( )} - + {file.filename}
@@ -318,25 +314,23 @@ const Folder: React.FC = ({ folder }) => { }, [folder]); return ( -
-
+
+
- + {folder.name}
@@ -397,6 +391,7 @@ const DrivePage: React.FC = ({ params }) => { return ( } @@ -407,10 +402,10 @@ const DrivePage: React.FC = ({ params }) => { icon={require('@phosphor-icons/core/regular/folder-open.svg')} /> ) : ( - +
{data?.folders.map((folder) => )} {data?.files.map((file) => )} - +
)}
); diff --git a/packages/pl-fe/src/styles/new/drive.scss b/packages/pl-fe/src/styles/new/drive.scss new file mode 100644 index 000000000..6f0487253 --- /dev/null +++ b/packages/pl-fe/src/styles/new/drive.scss @@ -0,0 +1,41 @@ +.⁂-drive-page { + &__files { + display: flex; + flex-wrap: wrap; + gap: 1rem; + } + + .⁂-drive-file { + @apply relative flex w-32 flex-col items-center gap-2; + + .⁂-icon-button { + @apply text-gray-600 hover:text-gray-700 dark:text-gray-600 dark:hover:text-gray-500; + + svg { + @apply h-4 w-4; + } + } + + &__button { + @apply opacity-0 absolute self-end transition-opacity duration-200; + } + + &:hover, &:focus { + .⁂-drive-file__button { + @apply opacity-100; + } + } + + img { + @apply pointer-events-none size-24 overflow-hidden object-cover; + } + + &__icon { + @apply m-2 size-20 text-gray-800 dark:text-gray-200; + } + + &__label { + @apply mt-auto line-clamp-3 inline max-w-full text-ellipsis rounded bg-gray-900 px-2 py-1 text-xs font-medium text-white; + } + } +} \ No newline at end of file diff --git a/packages/pl-fe/src/styles/new/index.scss b/packages/pl-fe/src/styles/new/index.scss index 80461ed4a..606ce6187 100644 --- a/packages/pl-fe/src/styles/new/index.scss +++ b/packages/pl-fe/src/styles/new/index.scss @@ -5,4 +5,5 @@ @use 'statuses'; @use 'timelines'; @use 'compose'; +@use 'drive'; @use 'events'; diff --git a/packages/pl-fe/src/styles/ptr.scss b/packages/pl-fe/src/styles/ptr.scss index 62c655cf2..b22d866f5 100644 --- a/packages/pl-fe/src/styles/ptr.scss +++ b/packages/pl-fe/src/styles/ptr.scss @@ -11,7 +11,7 @@ } /** - * Pull down transition + * Pull down transition */ .ptr__children, .ptr__pull-down {