fix(dashboard-card-wrapper): pass style instead of style props
This commit is contained in:
parent
57d98fc83c
commit
e08fab7a80
|
@ -10,7 +10,7 @@ type AddCardsContainerProps = {
|
||||||
|
|
||||||
const AddCardsContainer = ({ cardsAmount }: AddCardsContainerProps) => {
|
const AddCardsContainer = ({ cardsAmount }: AddCardsContainerProps) => {
|
||||||
return (
|
return (
|
||||||
<DashboardCardWrapper padding="0" minWidth="50px">
|
<DashboardCardWrapper style={{ padding: 0, minWidth: '50px' }}>
|
||||||
<YStack height={'100%'}>
|
<YStack height={'100%'}>
|
||||||
{Array.from({ length: cardsAmount }).map((_, index) => (
|
{Array.from({ length: cardsAmount }).map((_, index) => (
|
||||||
<AddCard
|
<AddCard
|
||||||
|
|
|
@ -3,12 +3,16 @@ import { Separator, Stack, XStack, YStack } from 'tamagui'
|
||||||
|
|
||||||
import DashboardCardWrapper from '../DashboardCardWrapper'
|
import DashboardCardWrapper from '../DashboardCardWrapper'
|
||||||
import Icon from '../../../components/General/Icon'
|
import Icon from '../../../components/General/Icon'
|
||||||
|
|
||||||
type ActiveValidatorsProps = {
|
type ActiveValidatorsProps = {
|
||||||
count: number
|
count: number
|
||||||
}
|
}
|
||||||
|
|
||||||
const ActiveValidators = ({ count }: ActiveValidatorsProps) => {
|
const ActiveValidators = ({ count }: ActiveValidatorsProps) => {
|
||||||
return (
|
return (
|
||||||
<DashboardCardWrapper padding="0" height="156px" minWidth="250px">
|
<DashboardCardWrapper
|
||||||
|
style={{ padding: 0, height: '156px', minWidth: '250px' }}
|
||||||
|
>
|
||||||
<img
|
<img
|
||||||
src="/images/validators-count.png"
|
src="/images/validators-count.png"
|
||||||
alt=""
|
alt=""
|
||||||
|
|
|
@ -41,7 +41,9 @@ const BalanceChartCard = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardCardWrapper minWidth={'436px'} width="100%" height="100%">
|
<DashboardCardWrapper
|
||||||
|
style={{ width: '100%', height: '100%', minWidth: '436px' }}
|
||||||
|
>
|
||||||
<YStack space={'$4'}>
|
<YStack space={'$4'}>
|
||||||
<XStack justifyContent={'space-between'}>
|
<XStack justifyContent={'space-between'}>
|
||||||
<YStack>
|
<YStack>
|
||||||
|
|
|
@ -43,9 +43,7 @@ const CPUCard = ({ load }: CPUCardProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardCardWrapper
|
<DashboardCardWrapper
|
||||||
padding="0"
|
style={{ padding: 0, height: '156px', minWidth: '250px' }}
|
||||||
height="156px"
|
|
||||||
minWidth="200px"
|
|
||||||
isErrorBorder={message === 'Poor'}
|
isErrorBorder={message === 'Poor'}
|
||||||
>
|
>
|
||||||
<YStack
|
<YStack
|
||||||
|
|
|
@ -6,7 +6,9 @@ import DoughnutChartHalf from '../../../components/Charts/HalfDoughnutWithGradie
|
||||||
|
|
||||||
const ConnectedPeers = () => {
|
const ConnectedPeers = () => {
|
||||||
return (
|
return (
|
||||||
<DashboardCardWrapper padding="0" height="156ppx" minWidth="250px">
|
<DashboardCardWrapper
|
||||||
|
style={{ padding: 0, height: '156px', minWidth: '250px' }}
|
||||||
|
>
|
||||||
<YStack height={'100%'}>
|
<YStack height={'100%'}>
|
||||||
<Stack
|
<Stack
|
||||||
style={{ minHeight: '90px', padding: '12px 16px', flex: 1 }}
|
style={{ minHeight: '90px', padding: '12px 16px', flex: 1 }}
|
||||||
|
|
|
@ -59,7 +59,7 @@ const Dashboard = () => {
|
||||||
<div
|
<div
|
||||||
style={{
|
style={{
|
||||||
display: 'grid',
|
display: 'grid',
|
||||||
gridTemplateColumns: 'repeat(4, 1fr)', // Four columns, each taking up an equal portion of the available space
|
gridTemplateColumns: 'repeat(4, 1fr)',
|
||||||
gap: '14px',
|
gap: '14px',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
}}
|
}}
|
||||||
|
|
|
@ -2,39 +2,27 @@ import { Shadow } from '@status-im/components'
|
||||||
|
|
||||||
type DashboardCardWrapperProps = {
|
type DashboardCardWrapperProps = {
|
||||||
children: React.ReactNode
|
children: React.ReactNode
|
||||||
padding?: string
|
|
||||||
width?: string
|
|
||||||
height?: string
|
|
||||||
minWidth?: string
|
|
||||||
maxWidth?: string
|
|
||||||
maxHeight?: string
|
|
||||||
isErrorBorder?: boolean
|
isErrorBorder?: boolean
|
||||||
|
style?: React.CSSProperties
|
||||||
}
|
}
|
||||||
|
|
||||||
const DashboardCardWrapper = ({
|
const DashboardCardWrapper = ({
|
||||||
children,
|
children,
|
||||||
padding = '12px 16px',
|
|
||||||
width,
|
|
||||||
height = 'auto',
|
|
||||||
minWidth = '0',
|
|
||||||
maxWidth,
|
|
||||||
maxHeight,
|
|
||||||
isErrorBorder,
|
isErrorBorder,
|
||||||
|
style,
|
||||||
}: DashboardCardWrapperProps) => {
|
}: DashboardCardWrapperProps) => {
|
||||||
return (
|
return (
|
||||||
<Shadow
|
<Shadow
|
||||||
variant="$1"
|
variant="$1"
|
||||||
style={{
|
style={{
|
||||||
flexGrow: '1',
|
flexGrow: '1',
|
||||||
width: width,
|
|
||||||
height: height,
|
|
||||||
borderRadius: '16px',
|
borderRadius: '16px',
|
||||||
padding,
|
|
||||||
backgroundColor: '$background',
|
backgroundColor: '$background',
|
||||||
minWidth: minWidth,
|
|
||||||
maxWidth: maxWidth,
|
|
||||||
maxHeight: maxHeight,
|
|
||||||
border: isErrorBorder ? '1px solid #D92344' : '1px solid #E7EAEE',
|
border: isErrorBorder ? '1px solid #D92344' : '1px solid #E7EAEE',
|
||||||
|
padding: '12px 16px',
|
||||||
|
height: 'auto',
|
||||||
|
minWidth: '0',
|
||||||
|
...style,
|
||||||
}}
|
}}
|
||||||
>
|
>
|
||||||
{children}
|
{children}
|
||||||
|
|
|
@ -31,7 +31,7 @@ const DeviceUptime = () => {
|
||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardCardWrapper minWidth="100px">
|
<DashboardCardWrapper style={{ minWidth: '100px' }}>
|
||||||
<YStack space={'$3'}>
|
<YStack space={'$3'}>
|
||||||
<XStack justifyContent={'space-between'}>
|
<XStack justifyContent={'space-between'}>
|
||||||
<YStack>
|
<YStack>
|
||||||
|
|
|
@ -45,9 +45,7 @@ const MemoryCard = ({ currentMemory, maxMemory }: MemoryCardProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardCardWrapper
|
<DashboardCardWrapper
|
||||||
padding="0"
|
style={{ padding: 0, height: '156px', minWidth: '250px' }}
|
||||||
height="156px"
|
|
||||||
minWidth="200px"
|
|
||||||
isErrorBorder={message === 'Poor'}
|
isErrorBorder={message === 'Poor'}
|
||||||
>
|
>
|
||||||
<YStack
|
<YStack
|
||||||
|
|
|
@ -51,9 +51,11 @@ const NetworkCard = ({ uploadRate, downloadRate }: NetworkCardProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardCardWrapper
|
<DashboardCardWrapper
|
||||||
padding="0"
|
style={{
|
||||||
height="156px"
|
padding: 0,
|
||||||
minWidth="200px"
|
height: '156px',
|
||||||
|
minWidth: '200px',
|
||||||
|
}}
|
||||||
isErrorBorder={message === 'Poor'}
|
isErrorBorder={message === 'Poor'}
|
||||||
>
|
>
|
||||||
<YStack
|
<YStack
|
||||||
|
|
|
@ -36,9 +36,7 @@ const StorageCard = ({ storage, maxStorage }: StorageCardProps) => {
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<DashboardCardWrapper
|
<DashboardCardWrapper
|
||||||
padding="0"
|
style={{ padding: 0, height: '156px', minWidth: '200px' }}
|
||||||
height="156px"
|
|
||||||
minWidth="200px"
|
|
||||||
isErrorBorder={message === 'Poor'}
|
isErrorBorder={message === 'Poor'}
|
||||||
>
|
>
|
||||||
<YStack
|
<YStack
|
||||||
|
|
|
@ -7,7 +7,9 @@ import ConsensusCard from './ConsensusClientCard'
|
||||||
|
|
||||||
const SyncStatusCards = () => {
|
const SyncStatusCards = () => {
|
||||||
return (
|
return (
|
||||||
<DashboardCardWrapper padding="0" minWidth="200px" height="100%">
|
<DashboardCardWrapper
|
||||||
|
style={{ padding: 0, height: '100%', minWidth: '200px' }}
|
||||||
|
>
|
||||||
<YStack space={'$3'}>
|
<YStack space={'$3'}>
|
||||||
<div style={{ padding: '8px 16px' }}>
|
<div style={{ padding: '8px 16px' }}>
|
||||||
<Text size={19} weight={'semibold'}>
|
<Text size={19} weight={'semibold'}>
|
||||||
|
|
Loading…
Reference in New Issue