Skip to content

Commit

Permalink
fade empty list content screen
Browse files Browse the repository at this point in the history
  • Loading branch information
mmadariaga committed Jun 21, 2023
1 parent 757c936 commit 3dfe770
Showing 1 changed file with 25 additions and 16 deletions.
41 changes: 25 additions & 16 deletions library/src/components/List/Content/Empty.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ import EntityService from '../../../services/entity/EntityService';
import _ from '../../../services/translations/translate';
import { SolidButton } from '../../shared/Button/Button.styles';
import { useTranslation } from 'react-i18next';
import { Fade } from '@mui/material';

export interface EmptyProps {
entityService: EntityService;
Expand All @@ -28,22 +29,30 @@ export const Empty = (props: EmptyProps): JSX.Element => {
}

return (
<section className={className}>
<img src='assets/img/empty.svg' alt='' />
<h3>{_('No {{entity}} yet', { entity: pluralTitle })}</h3>
<p>
{_('You haven’t created any {{entity}} yet.', {
entity: singularTitle,
})}
</p>
{create && (
<Link to={location.pathname + '/create'}>
<SolidButton>
{_('New {{entity}}', { entity: singularTitle })}
</SolidButton>
</Link>
)}
</section>
<Fade
in={true}
style={{
transitionDelay: '750ms',
}}
unmountOnExit
>
<section className={className}>
<img src='assets/img/empty.svg' alt='' />
<h3>{_('No {{entity}} yet', { entity: pluralTitle })}</h3>
<p>
{_('You haven’t created any {{entity}} yet.', {
entity: singularTitle,
})}
</p>
{create && (
<Link to={location.pathname + '/create'}>
<SolidButton>
{_('New {{entity}}', { entity: singularTitle })}
</SolidButton>
</Link>
)}
</section>
</Fade>
);
};

Expand Down

0 comments on commit 3dfe770

Please sign in to comment.