1
1
import React from 'react'
2
2
import PropTypes from 'prop-types'
3
+ import styled from '@emotion/styled'
3
4
4
- import './circle.css'
5
+ const CircleContainer = styled . div `
6
+ display: inline-block;
7
+ border-radius: 100%;
8
+ position: relative;`
5
9
6
- const CircleContainer = ( { children, style } ) => < div className = "react-super-progressbar__base" style = { style } > { children } </ div >
10
+ const PercentageContainer = styled . div `
11
+ position: absolute;
12
+ height: 100%;
13
+ width: 100%;
14
+ top: 0;
15
+ left: 0;
16
+ display: flex;
17
+ justify-content: center;
18
+ align-items: center;
19
+ flex-direction: column;
20
+ text-align: center,`
7
21
8
- const PercentageContainer = ( { children } ) => < div className = "react-super-progressbar__percentage-container" > { children } </ div >
9
-
10
- const StyledCircle = ( { children, ...props } ) => < circle className = "react-super-progressbar__styled-circle" { ...props } > { children } </ circle >
22
+ const StyledCircle = styled . circle `
23
+ transform: rotate(-90deg);
24
+ transform-origin: 50% 50%;`
25
+ // const CircleContainer = ({ children, style }) => <div className="react-super-progressbar__base" style={style}>{children}</div>
26
+ // const PercentageContainer = ({ children }) => <div className="react-super-progressbar__percentage-container">{children}</div>
27
+ // const StyledCircle = ({ children, ...props }) => <circle className="react-super-progressbar__styled-circle" {...props}>{children}</circle>
11
28
12
29
const GradientCircleProgressbar = ( {
13
30
percentage,
@@ -31,13 +48,14 @@ const GradientCircleProgressbar = ({
31
48
32
49
return (
33
50
< CircleContainer
51
+ className = "react-super-progressbar__base"
34
52
style = { {
35
53
height : `${ width } px` ,
36
54
width : `${ width } px` ,
37
55
} }
38
56
>
39
57
{ ! hidePercentageText ?
40
- < PercentageContainer >
58
+ < PercentageContainer className = "react-super-progressbar__percentage-container" >
41
59
< span
42
60
className = "react-super-progressbars__percentage"
43
61
style = { {
0 commit comments