From 44a0fac59750282750521bb1434042e83188f6e6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Mon, 9 Feb 2026 18:00:22 +0100 Subject: [PATCH] pl-fe: migrate directory page to scss file MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- .../src/pages/account-lists/directory.tsx | 84 ++++++------ packages/pl-fe/src/styles/new/directory.scss | 123 ++++++++++++++++++ packages/pl-fe/src/styles/new/index.scss | 1 + 3 files changed, 161 insertions(+), 47 deletions(-) create mode 100644 packages/pl-fe/src/styles/new/directory.scss diff --git a/packages/pl-fe/src/pages/account-lists/directory.tsx b/packages/pl-fe/src/pages/account-lists/directory.tsx index b5526b9b1..ac47f07e0 100644 --- a/packages/pl-fe/src/pages/account-lists/directory.tsx +++ b/packages/pl-fe/src/pages/account-lists/directory.tsx @@ -15,8 +15,6 @@ import StillImage from '@/components/still-image'; import Avatar from '@/components/ui/avatar'; import { CardTitle } from '@/components/ui/card'; import Column from '@/components/ui/column'; -import Stack from '@/components/ui/stack'; -import Text from '@/components/ui/text'; import ActionButton from '@/features/ui/components/action-button'; import { directoryRoute } from '@/features/ui/router'; import { useAppSelector } from '@/hooks/use-app-selector'; @@ -46,10 +44,10 @@ const AccountCard: React.FC = ({ id }) => { const followedBy = me !== account.id && account.relationship?.followed_by; return ( -
-
+
+
{followedBy && ( -
+
} @@ -57,7 +55,7 @@ const AccountCard: React.FC = ({ id }) => {
)} -
+
@@ -66,10 +64,10 @@ const AccountCard: React.FC = ({ id }) => { src={account.header} staticSrc={account.header_static} alt={account.header_description} - className='block h-32 w-full rounded-t-lg object-cover' + className='⁂-directory-card__header__image' /> ) : ( -
+
)} @@ -77,7 +75,7 @@ const AccountCard: React.FC = ({ id }) => { = ({ id }) => {
- +
= ({ id }) => { /> {!!account.note && ( - +

- +

)} - +
-
- - - {shortNumberFormat(account.statuses_count)} - +
+
+

{shortNumberFormat(account.statuses_count)}

- +

- - +

+
- - - {shortNumberFormat(account.followers_count)} - +
+

{shortNumberFormat(account.followers_count)}

- +

- - +

+
- - +
+

{account.last_status_at ? ( ) : ( )} - +

- +

- - +

+
); @@ -166,9 +156,9 @@ const DirectoryPage = () => { return ( - -
- +
+
+
} /> @@ -183,10 +173,10 @@ const DirectoryPage = () => { value='new' /> - +
{features.federating && ( - +
} /> @@ -201,15 +191,15 @@ const DirectoryPage = () => { value='0' /> - +
)}
@@ -219,7 +209,7 @@ const DirectoryPage = () => {
{hasNextPage && } - +
); }; diff --git a/packages/pl-fe/src/styles/new/directory.scss b/packages/pl-fe/src/styles/new/directory.scss new file mode 100644 index 000000000..d99ccdeed --- /dev/null +++ b/packages/pl-fe/src/styles/new/directory.scss @@ -0,0 +1,123 @@ +@use 'mixins'; +@use 'variables'; + +.⁂-directory { + display: flex; + flex-direction: column; + gap: 1rem; + + &__filters { + display: grid; + grid-template-columns: repeat(1, minmax(0, 1fr)); + gap: 0.5rem; + + @media (min-width: variables.$breakpoint-md) { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + > div { + display: flex; + flex-direction: column; + gap: 0.5rem; + } + } + + &__cards { + display: grid; + grid-template-columns: repeat(1, minmax(0, 1fr)); + gap: 0.625rem; + + @media (min-width: variables.$breakpoint-sm) { + grid-template-columns: repeat(2, minmax(0, 1fr)); + } + + &--loading { + @apply animate-pulse; + } + } +} + +.⁂-directory-card { + overflow: clip; + @apply flex flex-col divide-y divide-gray-200 rounded-lg bg-white text-center shadow dark:divide-primary-700 dark:bg-primary-800; + + &__header { + position: relative; + + &__image { + @apply block h-32 w-full rounded-t-lg object-cover; + + &--empty { + @apply bg-gray-200 dark:bg-primary-700; + } + } + } + + &__badge { + position: absolute; + left: 0.625rem; + top: 0.625rem; + } + + &__action { + position: absolute; + bottom: 0; + right: 0.75rem; + z-index: 1; + transform: translateY(50%); + } + + &__avatar { + position: absolute !important; + bottom: 0; + left: 0.75rem; + @apply translate-y-1/2 bg-white ring-2 ring-white dark:bg-primary-900 dark:ring-primary-900; + } + + &__account { + display: flex; + flex-direction: column; + gap: 1rem; + padding: 2.5rem 0.75rem 0.75rem; + } + + &__bio { + @apply line-clamp-2 inline text-ellipsis; + @include mixins.text($truncate: true); + + br { + display: none; + } + + p { + display: none; + } + + p:first-child { + display: inline; + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + } + + &__details { + display: grid; + grid-template-columns: repeat(3, minmax(0, 1fr)); + gap: 0.25rem; + padding: 1rem 0; + + > div { + display: flex; + flex-direction: column; + + p:first-child { + @include mixins.text($theme: primary, $size: sm, $weight: medium); + } + + p:last-child { + @include mixins.text($theme: muted, $size: sm); + } + } + } +} \ 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 f99242e32..daa0427fb 100644 --- a/packages/pl-fe/src/styles/new/index.scss +++ b/packages/pl-fe/src/styles/new/index.scss @@ -8,3 +8,4 @@ @use 'drive'; @use 'chats'; @use 'events'; +@use 'directory';