From c9015d3f9637d954c3b493a41c509c00049e40fa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?nicole=20miko=C5=82ajczyk?= Date: Mon, 20 Oct 2025 20:29:21 +0200 Subject: [PATCH] pl-fe: styles migrations 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/components/ui/widget.tsx | 36 +++------------ .../features/ui/components/link-footer.tsx | 14 +++--- .../ui/components/panels}/birthday-panel.tsx | 0 .../src/features/ui/util/async-components.ts | 2 +- packages/pl-fe/src/modals/birthdays-modal.tsx | 2 +- packages/pl-fe/src/styles/new/layout.scss | 45 ++++++++++++++++++- packages/pl-fe/src/styles/new/mixins.scss | 3 ++ 7 files changed, 61 insertions(+), 41 deletions(-) rename packages/pl-fe/src/{components => features/ui/components/panels}/birthday-panel.tsx (100%) diff --git a/packages/pl-fe/src/components/ui/widget.tsx b/packages/pl-fe/src/components/ui/widget.tsx index a558dd5e5..e544e2e71 100644 --- a/packages/pl-fe/src/components/ui/widget.tsx +++ b/packages/pl-fe/src/components/ui/widget.tsx @@ -1,28 +1,6 @@ import React from 'react'; -import HStack from 'pl-fe/components/ui/hstack'; import IconButton from 'pl-fe/components/ui/icon-button'; -import Stack from 'pl-fe/components/ui/stack'; -import Text from 'pl-fe/components/ui/text'; - -interface IWidgetTitle { - /** Title text for the widget. */ - title: React.ReactNode; -} - -/** Title of a widget. */ -const WidgetTitle = ({ title }: IWidgetTitle): JSX.Element => ( - {title} -); - -interface IWidgetBody { - children: React.ReactNode; -} - -/** Body of a widget. */ -const WidgetBody: React.FC = ({ children }): JSX.Element => ( - {children} -); interface IWidget { /** Widget title text. */ @@ -46,22 +24,22 @@ const Widget: React.FC = ({ actionTitle, action, }): JSX.Element => ( - +
{(title || action || onActionClick) && ( - - {title && } +
+ {title &&

{title}

} {action || (onActionClick && ( ))} - +
)} - {children} - +
{children}
+
); export { Widget as default }; diff --git a/packages/pl-fe/src/features/ui/components/link-footer.tsx b/packages/pl-fe/src/features/ui/components/link-footer.tsx index dd2c6c9e2..0bc858303 100644 --- a/packages/pl-fe/src/features/ui/components/link-footer.tsx +++ b/packages/pl-fe/src/features/ui/components/link-footer.tsx @@ -17,27 +17,25 @@ const LinkFooter: React.FC = (): JSX.Element => { return ( <> - +

{plFeConfig.linkFooterMessage ? ( - - - + ) : ( {sourceCode.repository}, + code_link: {sourceCode.repository}, code_version: sourceCode.version, }} /> )} - +

{WITH_LANDING_PAGE && ( - +

- +

)} ); diff --git a/packages/pl-fe/src/components/birthday-panel.tsx b/packages/pl-fe/src/features/ui/components/panels/birthday-panel.tsx similarity index 100% rename from packages/pl-fe/src/components/birthday-panel.tsx rename to packages/pl-fe/src/features/ui/components/panels/birthday-panel.tsx diff --git a/packages/pl-fe/src/features/ui/util/async-components.ts b/packages/pl-fe/src/features/ui/util/async-components.ts index 7152fd161..c4e4695b0 100644 --- a/packages/pl-fe/src/features/ui/util/async-components.ts +++ b/packages/pl-fe/src/features/ui/util/async-components.ts @@ -102,7 +102,7 @@ export const WrenchedTimeline = lazy(() => import('pl-fe/pages/timelines/wrenche // Panels export const AccountNotePanel = lazy(() => import('pl-fe/features/ui/components/panels/account-note-panel')); export const AnnouncementsPanel = lazy(() => import('pl-fe/components/announcements/announcements-panel')); -export const BirthdayPanel = lazy(() => import('pl-fe/components/birthday-panel')); +export const BirthdayPanel = lazy(() => import('pl-fe/features/ui/components/panels/birthday-panel')); export const CryptoDonatePanel = lazy(() => import('pl-fe/features/crypto-donate/components/crypto-donate-panel')); export const GroupMediaPanel = lazy(() => import('pl-fe/features/ui/components/panels/group-media-panel')); export const InstanceInfoPanel = lazy(() => import('pl-fe/features/ui/components/panels/instance-info-panel')); diff --git a/packages/pl-fe/src/modals/birthdays-modal.tsx b/packages/pl-fe/src/modals/birthdays-modal.tsx index 3d6d8b658..949d043ea 100644 --- a/packages/pl-fe/src/modals/birthdays-modal.tsx +++ b/packages/pl-fe/src/modals/birthdays-modal.tsx @@ -1,11 +1,11 @@ import React, { useState } from 'react'; import { FormattedMessage } from 'react-intl'; -import { getCurrentDate } from 'pl-fe/components/birthday-panel'; import ScrollableList from 'pl-fe/components/scrollable-list'; import Modal from 'pl-fe/components/ui/modal'; import Spinner from 'pl-fe/components/ui/spinner'; import Account from 'pl-fe/features/birthdays/account'; +import { getCurrentDate } from 'pl-fe/features/ui/components/panels/birthday-panel'; import { useBirthdayReminders } from 'pl-fe/queries/accounts/use-birthday-reminders'; import type { BaseModalProps } from 'pl-fe/features/ui/components/modal-root'; diff --git a/packages/pl-fe/src/styles/new/layout.scss b/packages/pl-fe/src/styles/new/layout.scss index 79953defa..9602dd888 100644 --- a/packages/pl-fe/src/styles/new/layout.scss +++ b/packages/pl-fe/src/styles/new/layout.scss @@ -337,10 +337,51 @@ body { @apply fixed pointer-events-none inset-x-0 top-0 flex justify-center overflow-hidden black:hidden; &--preview { - @apply absolute; + position: absolute; } > div { - @apply bg-gradient-sm lg:bg-gradient-light lg:dark:bg-gradient-dark h-screen w-screen; + height: 100vh; + width: 100vw; + @apply bg-gradient-sm lg:bg-gradient-light lg:dark:bg-gradient-dark; + } +} + +.⁂-widget { + display: flex; + flex-direction: column; + gap: 1rem; + + &__header { + display: flex; + align-items: center; + justify-content: space-between; + gap: 0.5rem; + + h1 { + @include mixins.text($size: xl, $weight: bold); + } + } + + &__icon { + margin-left: 0.5rem; + width: 1.5rem; + height: 1.5rem; + @apply text-black dark:text-white rtl:rotate-180; + } + + &__body { + display: flex; + flex-direction: column; + gap: 0.75rem; + } +} + +.⁂-footer-text { + @include mixins.text($size: sm, $theme: muted); + + a { + @include mixins.text($size: inherit, $theme: subtle); + text-decoration-line: underline; } } \ No newline at end of file diff --git a/packages/pl-fe/src/styles/new/mixins.scss b/packages/pl-fe/src/styles/new/mixins.scss index ea74199b7..44d866fee 100644 --- a/packages/pl-fe/src/styles/new/mixins.scss +++ b/packages/pl-fe/src/styles/new/mixins.scss @@ -25,6 +25,9 @@ } @else if $size == 3xl { font-size: 1.875rem; line-height: 2.25rem; + } @else if $size == inherit { + font-size: inherit; + line-height: inherit; } @else { @warn "Unknown font size `#{$size}`."; }