From f3666a4bab9582b09c206b2525e478c83415a507 Mon Sep 17 00:00:00 2001 From: Anton Vikulov Date: Fri, 29 Sep 2023 16:05:50 +0500 Subject: [PATCH 1/6] feat(changelogDialog): change style, add link --- .../__stories__/ChangelogDialog.stories.tsx | 5 ++++- .../ChangelogDialog/components/Item/Item.scss | 15 ++++++++++----- .../ChangelogDialog/components/Item/Item.tsx | 12 +++++++++++- src/components/ChangelogDialog/i18n/en.json | 3 ++- src/components/ChangelogDialog/i18n/ru.json | 3 ++- src/components/ChangelogDialog/types.ts | 1 + 6 files changed, 30 insertions(+), 9 deletions(-) diff --git a/src/components/ChangelogDialog/__stories__/ChangelogDialog.stories.tsx b/src/components/ChangelogDialog/__stories__/ChangelogDialog.stories.tsx index 278e6e78..f5099481 100644 --- a/src/components/ChangelogDialog/__stories__/ChangelogDialog.stories.tsx +++ b/src/components/ChangelogDialog/__stories__/ChangelogDialog.stories.tsx @@ -30,6 +30,7 @@ const items: ChangelogItem[] = [ description: 'At the top of the panel is the service navigation for each service. Below are common navigation elements: a component for switching between accounts and organizations, settings, help center, search, notifications, favorites.', storyId: 'someStoryId1', + link: 'https://github.com/gravity-ui/uikit', }, { date: '23 Jun 2022', @@ -37,6 +38,7 @@ const items: ChangelogItem[] = [ title: 'New components', description: 'At the top of the panel is the service navigation for each service. Below are common navigation elements: a component for switching between accounts and organizations, settings, help center, search, notifications, favorites.', + link: 'https://github.com/gravity-ui/uikit', }, { date: '15 Jun 2022', @@ -65,6 +67,7 @@ const items: ChangelogItem[] = [ description: 'At the top of the panel is the service navigation for each service. Below are common navigation elements: a component for switching between accounts and organizations, settings, help center, search, notifications, favorites.', storyId: 'someStoryId3', + link: 'https://github.com/gravity-ui/uikit', }, { date: '10 May 2022', @@ -108,8 +111,8 @@ export const Default = DefaultTemplate.bind({}); Default.args = { open: false, items, - fullListLink: 'https://github.com/gravity-ui/uikit', onStoryClick: (storyId) => { + // eslint-disable-next-line no-console console.log(storyId); }, }; diff --git a/src/components/ChangelogDialog/components/Item/Item.scss b/src/components/ChangelogDialog/components/Item/Item.scss index d14e046f..91f829a1 100644 --- a/src/components/ChangelogDialog/components/Item/Item.scss +++ b/src/components/ChangelogDialog/components/Item/Item.scss @@ -2,7 +2,7 @@ @use '../../../variables'; $block: '.#{variables.$ns}changelog-dialog-item'; -$metaWidth: 124px; +$metaWidth: 80px; #{$block} { display: flex; @@ -17,17 +17,18 @@ $metaWidth: 124px; } &__label-new { - margin-top: 4px; + margin-top: 8px; } &__content { flex: 1; - margin-left: 16px; + margin-left: 20px; } &__title { margin: 0; - @include mixins.text-subheader-3(); + @include mixins.text-subheader-2(); + font-weight: 500; } &__image { @@ -40,7 +41,11 @@ $metaWidth: 124px; margin-top: 12px; } - &__story-button { + &__button { margin-top: 16px; } + + &__button + &__button { + margin-left: 16px; + } } diff --git a/src/components/ChangelogDialog/components/Item/Item.tsx b/src/components/ChangelogDialog/components/Item/Item.tsx index cb224be6..6ac0b2e6 100644 --- a/src/components/ChangelogDialog/components/Item/Item.tsx +++ b/src/components/ChangelogDialog/components/Item/Item.tsx @@ -42,9 +42,19 @@ export function Item({className, data, onStoryClick}: ItemProps) { {data.description ? (
{data.description}
) : null} + {data.link ? ( + + ) : null} {data.storyId && onStoryClick ? ( @@ -56,11 +70,7 @@ export function Item({className, data, onStoryClick}: ItemProps) {