Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(ChangelogDialog): change style, add link, events #105

Merged
merged 8 commits into from
Oct 23, 2023
Merged
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -30,13 +30,15 @@ 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',
isNew: true,
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);
},
};
15 changes: 10 additions & 5 deletions src/components/ChangelogDialog/components/Item/Item.scss
Original file line number Diff line number Diff line change
@@ -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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should use --g-spacing-2

}

&__content {
flex: 1;
margin-left: 16px;
margin-left: 20px;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess we should use --g-spacing-5

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Replace this and other places too.

}

&__title {
margin: 0;
@include mixins.text-subheader-3();
@include mixins.text-subheader-2();
font-weight: 500;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mixin already has font-weight. Besides it uses variable for that, not a fixed value

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fixed, thx!

}

&__image {
@@ -40,7 +41,11 @@ $metaWidth: 124px;
margin-top: 12px;
}

&__story-button {
&__button {
margin-top: 16px;
}

&__button + &__button {
margin-left: 16px;
}
}
12 changes: 11 additions & 1 deletion src/components/ChangelogDialog/components/Item/Item.tsx
Original file line number Diff line number Diff line change
@@ -42,9 +42,19 @@ export function Item({className, data, onStoryClick}: ItemProps) {
{data.description ? (
<div className={b('description')}>{data.description}</div>
) : null}
{data.link ? (
<Button
className={b('button')}
view="outlined"
href={data.link}
target={'_blank'}
>
{i18n('action_read-more')}
</Button>
) : null}
{data.storyId && onStoryClick ? (
<Button
className={b('story-button')}
className={b('button')}
view="outlined-action"
onClick={() => {
if (data.storyId) {
3 changes: 2 additions & 1 deletion src/components/ChangelogDialog/i18n/en.json
Original file line number Diff line number Diff line change
@@ -3,5 +3,6 @@
"link_full_list": "View full changelog",
"label_new": "New",
"button_view_story": "View story",
"label_empty": "No data"
"label_empty": "No data",
"action_read-more": "Read more"
}
3 changes: 2 additions & 1 deletion src/components/ChangelogDialog/i18n/ru.json
Original file line number Diff line number Diff line change
@@ -3,5 +3,6 @@
"link_full_list": "Открыть полный список изменений",
"label_new": "New",
"button_view_story": "Посмотреть сториз",
"label_empty": "Нет данных"
"label_empty": "Нет данных",
"action_read-more": "Читать далее"
}
1 change: 1 addition & 0 deletions src/components/ChangelogDialog/types.ts
Original file line number Diff line number Diff line change
@@ -11,4 +11,5 @@ export interface ChangelogItem {
image?: ImageData;
description: string;
storyId?: string;
link?: string;
}
Loading