mirror of
https://github.com/storybookjs/storybook.git
synced 2025-04-08 11:11:53 +08:00
CHANGE loader so Container its is re-usable
This commit is contained in:
parent
710c6a3998
commit
aa3591ce13
@ -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>
|
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user