feat: add skeleton masthead and generic loading page (#182)

* feat: add skeleton masthead and generic loading page

* add generic loader to picker page

* smooth out spinner, add no-motion state
This commit is contained in:
41666 2021-03-15 19:51:56 -04:00 committed by GitHub
parent fa85b30cf0
commit e0fcfc310e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
28 changed files with 380 additions and 30 deletions

View file

@ -0,0 +1,7 @@
import { GenericLoadingTemplate } from './GenericLoading';
export default {
title: 'Templates/Generic Loading',
component: GenericLoadingTemplate,
};
export const genericLoading = (args) => <GenericLoadingTemplate {...args} />;

View file

@ -0,0 +1,6 @@
import { palette } from '@roleypoly/design-system/atoms/colors';
import styled from 'styled-components';
export const TextStyle = styled.div`
color: ${palette.taupe500};
`;

View file

@ -0,0 +1,28 @@
import { DotOverlay } from '@roleypoly/design-system/atoms/dot-overlay';
import { Hero } from '@roleypoly/design-system/atoms/hero';
import { LoadingFill } from '@roleypoly/design-system/atoms/loading-text';
import { Space } from '@roleypoly/design-system/atoms/space';
import { Spinner } from '@roleypoly/design-system/atoms/spinner';
import { AppShell } from '@roleypoly/design-system/organisms/app-shell';
import styled from 'styled-components';
import { TextStyle } from './GenericLoading.styled';
const Center = styled.div`
display: flex;
flex-direction: column;
align-items: center;
justify-content: center;
`;
export const GenericLoadingTemplate = (props: { children?: React.ReactNode }) => (
<AppShell skeleton>
<DotOverlay skeleton />
<Hero topSpacing={0} bottomSpacing={50}>
<Center>
<Spinner />
<Space />
<TextStyle>{props.children ? props.children : <LoadingFill />}</TextStyle>
</Center>
</Hero>
</AppShell>
);

View file

@ -0,0 +1 @@
export * from './GenericLoading';