-
Notifications
You must be signed in to change notification settings - Fork 342
/
ProgressBar.tsx
40 lines (34 loc) · 1015 Bytes
/
ProgressBar.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
import React, { PureComponent } from 'react'
import styled from 'styled-components'
export interface Props {
progress: number
}
class ProgressBar extends PureComponent<Props> {
render() {
const { progress } = this.props
return (
<Container>
<Bar>
<ProgressBarInside width={progress}>
{/* <span className={localStyles.percent}>
{Math.floor(progress)}%
</span> */}
</ProgressBarInside>
</Bar>
</Container>
)
}
}
const Container = styled.div``
const Bar = styled.div`
background-color: ${(props) => props.theme.colors.black};
height: 10px;
border-radius: 3px;
`
const ProgressBarInside = styled.div<{ width: number }>`
height: 10px;
background-color: ${(props) => props.theme.colors.prime1};
border-radius: 3px;
width: ${(props) => props.width}%;
`
export default ProgressBar