added custom spinner

This commit is contained in:
Jason Ibrahim 2019-06-19 20:39:51 -07:00 committed by Jason Ibrahim
parent 4b870cc4ac
commit 0fa04e7f7e
2 changed files with 9 additions and 14 deletions

View File

@ -20,7 +20,7 @@ export class Loading extends React.PureComponent<LoadingProps> {
render() {
return (
<div style={{ textAlign: 'center' }}>
<LoadingMessage color={this.props.color}>Loading ...</LoadingMessage>
<LoadingMessage color={this.props.color}/>
<Spinner color={this.props.color} />
</div>
);

View File

@ -2,16 +2,11 @@ import * as React from 'react';
import styled, { keyframes } from '../../styled-components';
const _Spinner = (props: { className?: string; color: string }) => (
<svg className={props.className} version="1.1" width="512" height="512" viewBox="0 0 512 512">
<path d="M275.682 147.999c0 10.864-8.837 19.661-19.682 19.661v0c-10.875 0-19.681-8.796-19.681-19.661v-96.635c0-10.885 8.806-19.661 19.681-19.661v0c10.844 0 19.682 8.776 19.682 19.661v96.635z" />
<path d="M275.682 460.615c0 10.865-8.837 19.682-19.682 19.682v0c-10.875 0-19.681-8.817-19.681-19.682v-96.604c0-10.885 8.806-19.681 19.681-19.681v0c10.844 0 19.682 8.796 19.682 19.682v96.604z" />
<path d="M147.978 236.339c10.885 0 19.681 8.755 19.681 19.641v0c0 10.885-8.796 19.702-19.681 19.702h-96.624c-10.864 0-19.661-8.817-19.661-19.702v0c0-10.885 8.796-19.641 19.661-19.641h96.624z" />
<path d="M460.615 236.339c10.865 0 19.682 8.755 19.682 19.641v0c0 10.885-8.817 19.702-19.682 19.702h-96.584c-10.885 0-19.722-8.817-19.722-19.702v0c0-10.885 8.837-19.641 19.722-19.641h96.584z" />
<path d="M193.546 165.703c7.69 7.66 7.68 20.142 0 27.822v0c-7.701 7.701-20.162 7.701-27.853 0.020l-68.311-68.322c-7.68-7.701-7.68-20.142 0-27.863v0c7.68-7.68 20.121-7.68 27.822 0l68.342 68.342z" />
<path d="M414.597 386.775c7.7 7.68 7.7 20.163 0.021 27.863v0c-7.7 7.659-20.142 7.659-27.843-0.062l-68.311-68.26c-7.68-7.7-7.68-20.204 0-27.863v0c7.68-7.7 20.163-7.7 27.842 0l68.291 68.322z" />
<path d="M165.694 318.464c7.69-7.7 20.153-7.7 27.853 0v0c7.68 7.659 7.69 20.163 0 27.863l-68.342 68.322c-7.67 7.659-20.142 7.659-27.822-0.062v0c-7.68-7.68-7.68-20.122 0-27.801l68.311-68.322z" />
<path d="M386.775 97.362c7.7-7.68 20.142-7.68 27.822 0v0c7.7 7.68 7.7 20.183 0.021 27.863l-68.322 68.311c-7.68 7.68-20.163 7.68-27.843-0.020v0c-7.68-7.68-7.68-20.162 0-27.822l68.322-68.332z" />
<svg className={props.className} width="42" height="42" viewBox="0 0 42 42" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M21 0C9.4 0 0 9.4 0 21C0 32.6 9.4 42 21 42C32.6 42 42 32.6 42 21C42 9.4 32.6 0 21 0ZM21 35C13.27 35 7 28.73 7 21C7 13.27 13.27 7 21 7C28.73 7 35 13.27 35 21C35 28.73 28.73 35 21 35Z"/>
<path id="rotator" d="M21 1V6C28.94 6 35.45 12.18 35.96 20H40.97C40.45 9.42 31.71 1 21 1Z" fill="white"/>
</svg>
);
const rotate = keyframes`
@ -23,14 +18,14 @@ const rotate = keyframes`
`;
export const Spinner = styled(_Spinner)`
animation: 2s ${rotate} linear infinite;
width: 50px;
height: 50px;
animation: 1.5s ${rotate} linear infinite;
width: 42px;
height: 42px;
content: '';
display: inline-block;
margin-left: -25px;
path {
path:not(#rotator) {
fill: ${props => props.color};
}
`;