This repository has been archived on 2022-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
Files
outline/app/scenes/Document/components/LoadingPlaceholder/LoadingPlaceholder.js
Tom Moor f34b32b2a3 Move Fade to its own component
Fixed todolist strikethrough styling with nested lists
2017-11-10 17:56:09 -08:00

37 lines
999 B
JavaScript

// @flow
import React from 'react';
import styled from 'styled-components';
import { pulsate } from 'shared/styles/animations';
import { color } from 'shared/styles/constants';
import Flex from 'shared/components/Flex';
import Fade from 'components/Fade';
import { randomInteger } from 'shared/random';
const randomValues = Array.from(
new Array(5),
() => `${randomInteger(85, 100)}%`
);
const LoadingPlaceholder = (props: Object) => {
return (
<Fade>
<Flex column auto {...props}>
<Mask style={{ width: randomValues[0] }} header />
<Mask style={{ width: randomValues[1] }} />
<Mask style={{ width: randomValues[2] }} />
<Mask style={{ width: randomValues[3] }} />
</Flex>
</Fade>
);
};
const Mask = styled(Flex)`
height: ${props => (props.header ? 28 : 18)}px;
margin-bottom: ${props => (props.header ? 32 : 14)}px;
background-color: ${color.smoke};
animation: ${pulsate} 1.3s infinite;
`;
export default LoadingPlaceholder;