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

aum/WALL-1983/fix-description-font-size-in-empty-state #10334

Merged
Show file tree
Hide file tree
Changes from all 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
12 changes: 12 additions & 0 deletions packages/components/src/components/empty-state/empty-state.scss
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,16 @@
flex-direction: column;
align-items: center;
gap: 2.4rem;

&__content {
display: flex;
flex-direction: column;
gap: 0.8rem;
}

&__action .dc-btn__text {
@include mobile {
font-size: var(--text-size-xxs);
}
}
}
24 changes: 14 additions & 10 deletions packages/components/src/components/empty-state/empty-state.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import React from 'react';
import { isMobile } from '@deriv/shared';
import Button from '../button';
import Icon from '../icon';
import Text from '../text';
Expand All @@ -20,16 +21,18 @@ export type TProps = {
const EmptyState: React.FC<TProps> = ({ icon, title, description, action }) => (
<div className='empty-state'>
{icon && <Icon icon={icon} size={128} />}
{title && (
<Text weight='bold' align='center' data-testid='dt_empty_state_title'>
{title}
</Text>
)}
{description && (
<Text align='center' data-testid='dt_empty_state_description'>
{description}
</Text>
)}
<div className='empty-state__content'>
{title && (
<Text weight='bold' align='center' data-testid='dt_empty_state_title' size={isMobile() ? 'xs' : 's'}>
{title}
</Text>
)}
{description && (
<Text align='center' data-testid='dt_empty_state_description' size={isMobile() ? 'xs' : 's'}>
{description}
</Text>
)}
</div>
{action && (
<Button
large
Expand All @@ -39,6 +42,7 @@ const EmptyState: React.FC<TProps> = ({ icon, title, description, action }) => (
primary={action.primary || true}
tertiary={action.tertiary}
is_disabled={action.disabled}
className='empty-state__action'
data-testid='dt_empty_state_action'
/>
)}
Expand Down