diff --git a/src/components/ChangelogDialog/ChangelogDialog.tsx b/src/components/ChangelogDialog/ChangelogDialog.tsx index 2218acc1..e599f4de 100644 --- a/src/components/ChangelogDialog/ChangelogDialog.tsx +++ b/src/components/ChangelogDialog/ChangelogDialog.tsx @@ -6,7 +6,7 @@ import {Dialog, Icon, Link, Loader} from '@gravity-ui/uikit'; import {block} from '../utils/cn'; -import ErrorContainer from './components/ErrorContainer/ErrorContainer'; +import {ErrorContainer} from './components/ErrorContainer/ErrorContainer'; import {Item} from './components/Item/Item'; import i18n from './i18n'; import type {ChangelogItem} from './types'; diff --git a/src/components/ChangelogDialog/__stories__/ChangelogDialog.stories.tsx b/src/components/ChangelogDialog/__stories__/ChangelogDialog.stories.tsx index d8e9bca7..96909be0 100644 --- a/src/components/ChangelogDialog/__stories__/ChangelogDialog.stories.tsx +++ b/src/components/ChangelogDialog/__stories__/ChangelogDialog.stories.tsx @@ -108,7 +108,6 @@ const DefaultTemplate: StoryFn = (props: ChangelogDialogPr }; export const Default = DefaultTemplate.bind({}); - Default.args = { open: false, items, @@ -129,3 +128,17 @@ Default.args = { console.log('retry'); }, }; + +export const Loading = DefaultTemplate.bind({}); +Loading.args = { + ...Default.args, + open: true, + loading: true, +}; + +export const Error = DefaultTemplate.bind({}); +Error.args = { + ...Default.args, + open: true, + error: true, +}; diff --git a/src/components/ChangelogDialog/components/ErrorContainer/ErrorContainer.scss b/src/components/ChangelogDialog/components/ErrorContainer/ErrorContainer.scss index 6bdd36d7..cd71282c 100644 --- a/src/components/ChangelogDialog/components/ErrorContainer/ErrorContainer.scss +++ b/src/components/ChangelogDialog/components/ErrorContainer/ErrorContainer.scss @@ -9,8 +9,6 @@ $block: '.#{variables.$ns}changelog-dialog-error-container'; } &__error-image { - color: var(--g-color-base-warning-heavy); - width: 32px; - height: 32px; + color: var(--g-color-text-warning); } } diff --git a/src/components/ChangelogDialog/components/ErrorContainer/ErrorContainer.tsx b/src/components/ChangelogDialog/components/ErrorContainer/ErrorContainer.tsx index 6253d8f7..9a3f79df 100644 --- a/src/components/ChangelogDialog/components/ErrorContainer/ErrorContainer.tsx +++ b/src/components/ChangelogDialog/components/ErrorContainer/ErrorContainer.tsx @@ -1,6 +1,7 @@ import React, {FC, useMemo} from 'react'; import {TriangleExclamation} from '@gravity-ui/icons'; +import {Icon} from '@gravity-ui/uikit'; import {PlaceholderContainer} from '../../../PlaceholderContainer'; import {block} from '../../../utils/cn'; @@ -15,7 +16,7 @@ interface ErrorContainerProps { error?: boolean | {title?: string; description?: string}; } -const ErrorContainer: FC = ({onRetryClick, error}) => { +export const ErrorContainer: FC = ({onRetryClick, error}) => { const {title, description} = useMemo(() => { return error && typeof error === 'object' ? error : {}; }, [error]); @@ -23,21 +24,19 @@ const ErrorContainer: FC = ({onRetryClick, error}) => { return ( - + } action={ onRetryClick && { - text: i18n('action_retry'), + text: i18n('button_retry'), handler: onRetryClick, } } /> ); }; - -export default ErrorContainer; diff --git a/src/components/ChangelogDialog/i18n/en.json b/src/components/ChangelogDialog/i18n/en.json index d6ff87f8..1310d91d 100644 --- a/src/components/ChangelogDialog/i18n/en.json +++ b/src/components/ChangelogDialog/i18n/en.json @@ -5,6 +5,6 @@ "button_view_story": "View story", "label_empty": "No data", "action_read-more": "Read more", - "context_error-title": "Unable load changelog", - "action_retry": "Retry" + "label_error-title": "Unable load changelog", + "button_retry": "Retry" } diff --git a/src/components/ChangelogDialog/i18n/ru.json b/src/components/ChangelogDialog/i18n/ru.json index c80c7cd2..7a9391c2 100644 --- a/src/components/ChangelogDialog/i18n/ru.json +++ b/src/components/ChangelogDialog/i18n/ru.json @@ -5,6 +5,6 @@ "button_view_story": "Посмотреть сториз", "label_empty": "Нет данных", "action_read-more": "Читать далее", - "context_error-title": "Не удалось загрузить список изменений", - "action_retry": "Повторить" + "label_error-title": "Не удалось загрузить список изменений", + "button_retry": "Повторить" }