Skip to content
This repository was archived by the owner on Jul 3, 2023. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import { storiesOf } from '@storybook/react'
import * as React from 'react'

import { LoadingIcon } from '../view'

storiesOf('components.loading_icon', module)
.add('renders animated', () => {
return <LoadingIcon />
})
.add('renders with custom size', () => {
return <LoadingIcon size={64} />
})
16 changes: 16 additions & 0 deletions src/client/components/loading_icon/styles.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
.loading {
animation: rotationAnimation 0.7s linear infinite;
}

.circle {
stroke-dasharray: 89, 200;
stroke-dashoffset: -35px;
stroke-linecap: round;
stroke: #1197d3;
}

@keyframes rotationAnimation {
100% {
transform: rotate(360deg);
}
}
20 changes: 20 additions & 0 deletions src/client/components/loading_icon/view.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import * as React from 'react'

import * as styles from './styles.css'

export class LoadingIcon extends React.PureComponent<{ size?: number }> {
render() {
const { size = 32 } = this.props
return <svg width={size} height={size} className={styles.loading} role='progressbar' viewBox='25 25 50 50'>
<circle
className={styles.circle}
cx='50'
cy='50'
fill='none'
r='20'
strokeMiterlimit='10'
strokeWidth='4'
/>
</svg>
}
}