Fix names
This commit is contained in:
parent
e48b9d1fae
commit
77e4089503
18
src/App.tsx
18
src/App.tsx
|
@ -1,7 +1,7 @@
|
||||||
import './App.css'
|
import './App.css'
|
||||||
import { TamaguiProvider } from 'tamagui'
|
import { TamaguiProvider } from 'tamagui'
|
||||||
import { Provider as StatusProvider } from '@status-im/components'
|
import { Provider as StatusProvider } from '@status-im/components'
|
||||||
import { Pie } from '@nivo/pie'
|
import { ResponsivePie } from '@nivo/pie'
|
||||||
|
|
||||||
import config from '../tamagui.config'
|
import config from '../tamagui.config'
|
||||||
|
|
||||||
|
@ -11,19 +11,17 @@ interface Data {
|
||||||
value: number
|
value: number
|
||||||
color: string
|
color: string
|
||||||
}
|
}
|
||||||
interface MyPieProps {
|
interface StandartGaugeProps {
|
||||||
data: Data[]
|
data: Data[]
|
||||||
}
|
}
|
||||||
|
|
||||||
const MyPie = (props: MyPieProps) => {
|
const StandartGauge = (props: StandartGaugeProps) => {
|
||||||
const { data } = props
|
const { data } = props
|
||||||
console.log(data.color)
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Pie
|
<ResponsivePie
|
||||||
data={data}
|
data={data}
|
||||||
width={74.57}
|
|
||||||
height={74.57}
|
|
||||||
margin={{ top: 40, right: 80, bottom: 80, left: 80 }}
|
margin={{ top: 40, right: 80, bottom: 80, left: 80 }}
|
||||||
innerRadius={0.65}
|
innerRadius={0.65}
|
||||||
colors={datum => datum.data.color}
|
colors={datum => datum.data.color}
|
||||||
|
@ -49,7 +47,7 @@ function App() {
|
||||||
{
|
{
|
||||||
id: 'javascript',
|
id: 'javascript',
|
||||||
label: 'javascript',
|
label: 'javascript',
|
||||||
value: 30,
|
value: 40,
|
||||||
color: '#ecedf0',
|
color: '#ecedf0',
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -57,7 +55,9 @@ function App() {
|
||||||
return (
|
return (
|
||||||
<TamaguiProvider config={config}>
|
<TamaguiProvider config={config}>
|
||||||
<StatusProvider>
|
<StatusProvider>
|
||||||
<MyPie data={data} />
|
<div style={{ height: '500px', width: '300px' }}>
|
||||||
|
<StandartGauge data={data} />
|
||||||
|
</div>
|
||||||
</StatusProvider>
|
</StatusProvider>
|
||||||
</TamaguiProvider>
|
</TamaguiProvider>
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in New Issue