fix: clear code

This commit is contained in:
Hristo Nedelkov 2023-09-21 10:31:43 +03:00
parent 33607b0fd9
commit d4874168e0
3 changed files with 9 additions and 21 deletions

View File

@ -11,10 +11,10 @@ import StandardGauge from '../../../components/Charts/StandardGauge'
type ConsensusCardProps = { type ConsensusCardProps = {
value: number value: number
total: number total: number
isTop?: boolean
} }
const ConsensusCard = ({ value, total, isTop }: ConsensusCardProps) => { const ConsensusCard = ({ value, total }: ConsensusCardProps) => {
const style: CSSProperties = {} const style: CSSProperties = {}
const data = [ const data = [
{ {
@ -30,13 +30,7 @@ const ConsensusCard = ({ value, total, isTop }: ConsensusCardProps) => {
color: '#E7EAEE', color: '#E7EAEE',
}, },
] ]
if (isTop === true) {
style.borderTopLeftRadius = '16px'
style.borderTopRightRadius = '16px'
} else if (isTop === false) {
style.borderBottomLeftRadius = '16px'
style.borderBottomRightRadius = '16px'
}
return ( return (
<Shadow variant="$1" style={style}> <Shadow variant="$1" style={style}>

View File

@ -11,10 +11,10 @@ import StandardGauge from '../../../components/Charts/StandardGauge'
type ExecutionClientCardProps = { type ExecutionClientCardProps = {
value: number value: number
total: number total: number
isTop?: boolean
} }
const ExecutionClientCard = ({ value, total, isTop }: ExecutionClientCardProps) => { const ExecutionClientCard = ({ value, total }: ExecutionClientCardProps) => {
const data = [ const data = [
{ {
id: 'storage', id: 'storage',
@ -31,13 +31,7 @@ const ExecutionClientCard = ({ value, total, isTop }: ExecutionClientCardProps)
] ]
const style: CSSProperties = {} const style: CSSProperties = {}
if (isTop === true) {
style.borderTopLeftRadius = '16px'
style.borderTopRightRadius = '16px'
} else if (isTop === false) {
style.borderBottomLeftRadius = '16px'
style.borderBottomRightRadius = '16px'
}
return ( return (
<Shadow variant="$1" style={style}> <Shadow variant="$1" style={style}>

View File

@ -15,9 +15,9 @@ const SyncStatusCard = () => {
</Text> </Text>
</Stack> </Stack>
<YStack> <YStack>
<ExecutionClientCard value={153.424} total={170} isTop={false} /> <ExecutionClientCard value={153.424} total={170} />
<Separator borderColor={'#e3e3e3'} /> <Separator borderColor={'#e3e3e3'} />
<ConsensusCard value={103.424} total={170} isTop={true} /> <ConsensusCard value={103.424} total={170} />
</YStack> </YStack>
</YStack> </YStack>
</DashboardCardWrapper> </DashboardCardWrapper>