From 8203ab68a33d82bed1dfa54c2ed9496781a33ee4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Wed, 10 Sep 2025 16:49:34 +0200 Subject: [PATCH] pl-fe: more tailwind -> scss migrations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: nicole mikołajczyk --- .../src/components/dropdown-navigation.tsx | 44 +++++++-------- .../src/components/sidebar-navigation.tsx | 10 +--- packages/pl-fe/src/components/site-logo.tsx | 2 +- packages/pl-fe/src/styles/new/components.scss | 2 +- packages/pl-fe/src/styles/new/layout.scss | 56 ++++++++++++++++++- 5 files changed, 79 insertions(+), 35 deletions(-) diff --git a/packages/pl-fe/src/components/dropdown-navigation.tsx b/packages/pl-fe/src/components/dropdown-navigation.tsx index ce7f39581..a1e7aeb41 100644 --- a/packages/pl-fe/src/components/dropdown-navigation.tsx +++ b/packages/pl-fe/src/components/dropdown-navigation.tsx @@ -64,7 +64,7 @@ interface IDropdownNavigationLink { const DropdownNavigationLink: React.FC = React.memo(({ href, to, icon, text, onClick }) => { const body = ( <> -
+
@@ -149,8 +149,8 @@ const DropdownNavigation: React.FC = React.memo((): JSX.Element | null => { }; const renderAccount = (account: AccountEntity) => ( - -
+ +
@@ -196,10 +196,7 @@ const DropdownNavigation: React.FC = React.memo((): JSX.Element | null => { onTouchEnd={handleTouchEnd} >
@@ -406,33 +403,32 @@ const DropdownNavigation: React.FC = React.memo((): JSX.Element | null => { - - {switcher && ( -
+
{otherAccounts.map(account => renderAccount(account))} - - + + {intl.formatMessage(messages.addAccount)}
)} - +
) : ( diff --git a/packages/pl-fe/src/components/sidebar-navigation.tsx b/packages/pl-fe/src/components/sidebar-navigation.tsx index 12a617448..c5f341eb5 100644 --- a/packages/pl-fe/src/components/sidebar-navigation.tsx +++ b/packages/pl-fe/src/components/sidebar-navigation.tsx @@ -172,12 +172,8 @@ const SidebarNavigation: React.FC = React.memo(({ shrink }) }, [!!account, features, followRequestsCount, interactionRequestsCount, scheduledStatusCount, draftCount]); return ( - - +
+ {account && ( @@ -361,7 +357,7 @@ const SidebarNavigation: React.FC = React.memo(({ shrink }) {account && ( )} - +
); }); diff --git a/packages/pl-fe/src/components/site-logo.tsx b/packages/pl-fe/src/components/site-logo.tsx index 461e740ad..38eb5630a 100644 --- a/packages/pl-fe/src/components/site-logo.tsx +++ b/packages/pl-fe/src/components/site-logo.tsx @@ -26,7 +26,7 @@ const SiteLogo: React.FC = ({ className, theme, ...rest }) => { // eslint-disable-next-line jsx-a11y/alt-text {intl.formatMessage(messages.logo)} diff --git a/packages/pl-fe/src/styles/new/components.scss b/packages/pl-fe/src/styles/new/components.scss index 76eb0db47..ca6010f95 100644 --- a/packages/pl-fe/src/styles/new/components.scss +++ b/packages/pl-fe/src/styles/new/components.scss @@ -44,7 +44,7 @@ .⁂-divider { @apply relative; - > div::first-child { + > div:first-child { @apply absolute inset-0 flex items-center; > div { diff --git a/packages/pl-fe/src/styles/new/layout.scss b/packages/pl-fe/src/styles/new/layout.scss index 13c8cbf9b..634e8d433 100644 --- a/packages/pl-fe/src/styles/new/layout.scss +++ b/packages/pl-fe/src/styles/new/layout.scss @@ -27,7 +27,7 @@ body { } &__container { - @apply z-1000; + @apply z-[1000]; &:not(&--partially-visible) { @apply hidden; @@ -47,7 +47,7 @@ body { } &__link { - @apply group rounded-lg text-gray-900 hover:bg-gray-50 dark:text-gray-100 dark:hover:bg-gray-800 flex flex-col gap-2 items-center; + @apply rounded-lg text-gray-900 hover:bg-gray-50 dark:text-gray-100 dark:hover:bg-gray-800 flex gap-2 items-center; &__icon { @apply relative inline-flex rounded-lg bg-primary-100 p-2 dark:bg-gray-800; @@ -58,6 +58,42 @@ body { } } + &__account-switcher { + @apply flex flex-col gap-4; + + button { + @apply flex items-center justify-between py-1; + + .⁂-icon { + @apply size-4 text-gray-900 transition-transform dark:text-gray-100; + } + } + + &__accounts { + @apply border-t-2 border-solid border-gray-100 black:border-t dark:border-gray-800; + + > a { + @apply block py-2; + + > div { + @apply pointer-events-none; + } + } + } + + &__add { + @apply flex items-center space-x-1 py-2; + + .⁂-icon { + @apply size-4 text-primary-500; + } + } + + &--expanded button .⁂-icon { + @apply rotate-180; + } + } + > div { @apply flex flex-col gap-y-4 relative size-full overflow-auto p-4; } @@ -86,4 +122,20 @@ body { } } } +} + +.⁂-sidebar-navigation { + @apply flex flex-col gap-4; + + .⁂-site-logo { + @apply h-12 w-auto cursor-pointer; + } + + &--narrow { + @apply items-center; + + .⁂-site-logo { + @apply max-w-10 h-auto; + } + } } \ No newline at end of file