CHANGE loader so Container its is re-usable

This commit is contained in:
Norbert de Langen 2020-03-06 02:02:55 +01:00
parent 710c6a3998
commit aa3591ce13
No known key found for this signature in database
GPG Key ID: 976651DA156C2825

View File

@ -5,6 +5,7 @@ const Loadingitem = styled.div<{
depth?: number; depth?: number;
}>( }>(
{ {
cursor: 'progress',
fontSize: 13, fontSize: 13,
height: '16px', height: '16px',
marginTop: 4, marginTop: 4,
@ -22,10 +23,9 @@ const Loadingitem = styled.div<{
}) })
); );
const Contained = styled.div({ export const Contained = styled.div({
display: 'flex', display: 'flex',
flexDirection: 'column', flexDirection: 'column',
cursor: 'progress',
paddingLeft: 20, paddingLeft: 20,
paddingRight: 20, paddingRight: 20,
}); });
@ -33,31 +33,27 @@ const Contained = styled.div({
export const Loader: FunctionComponent<{ export const Loader: FunctionComponent<{
size: 'single' | 'multiple'; size: 'single' | 'multiple';
}> = ({ size }) => { }> = ({ size }) => {
return ( return size === 'multiple' ? (
<Contained> <Fragment>
{size === 'multiple' ? ( <Loadingitem />
<Fragment> <Loadingitem />
<Loadingitem /> <Loadingitem depth={1} />
<Loadingitem /> <Loadingitem depth={1} />
<Loadingitem depth={1} /> <Loadingitem depth={2} />
<Loadingitem depth={1} /> <Loadingitem depth={3} />
<Loadingitem depth={2} /> <Loadingitem depth={3} />
<Loadingitem depth={3} /> <Loadingitem depth={3} />
<Loadingitem depth={3} /> <Loadingitem depth={1} />
<Loadingitem depth={3} /> <Loadingitem depth={1} />
<Loadingitem depth={1} /> <Loadingitem depth={1} />
<Loadingitem depth={1} /> <Loadingitem depth={2} />
<Loadingitem depth={1} /> <Loadingitem depth={2} />
<Loadingitem depth={2} /> <Loadingitem depth={2} />
<Loadingitem depth={2} /> <Loadingitem depth={3} />
<Loadingitem depth={2} /> <Loadingitem />
<Loadingitem depth={3} /> <Loadingitem />
<Loadingitem /> </Fragment>
<Loadingitem /> ) : (
</Fragment> <Loadingitem />
) : (
<Loadingitem />
)}
</Contained>
); );
}; };