This commit is contained in:
Hristo Nedelkov 2023-11-01 19:36:18 +02:00
parent 287ede45f6
commit 5672514787
8 changed files with 44 additions and 45 deletions

View File

@ -40,7 +40,7 @@ const CPUCard = ({ load }: CPUCardProps) => {
const message = currentLoad < 80 ? 'Good' : 'Poor' const message = currentLoad < 80 ? 'Good' : 'Poor'
return ( return (
<DashboardCardWrapper padding="0" height="156px" minWidth="200px" > <DashboardCardWrapper padding="0" height="156px" minWidth="200px">
<YStack <YStack
style={{ style={{
borderRadius: '16px', borderRadius: '16px',

View File

@ -9,7 +9,7 @@ const ConsensusUptimeCard = () => {
const monthlyActivity = [3, 0, 5, 4, 6, 7, 8, 9, 10, 1, 2, 3] const monthlyActivity = [3, 0, 5, 4, 6, 7, 8, 9, 10, 1, 2, 3]
return ( return (
<DashboardCardWrapper > <DashboardCardWrapper>
<YStack space={'$3'}> <YStack space={'$3'}>
<YStack> <YStack>
<Text size={15} weight={'semibold'}> <Text size={15} weight={'semibold'}>

View File

@ -66,7 +66,13 @@ const DashboardContent = () => {
</Stack> </Stack>
<BasicInfoCards /> <BasicInfoCards />
{/* SECOND ROW ENDS HERE! */} {/* SECOND ROW ENDS HERE! */}
{windowWidth < 1375 ? windowWidth < 850 ? DashboardContentLayoutPhone(windowWidth) : DashboardContentLayout(windowWidth) : ( {windowWidth < 1375 ? (
windowWidth < 850 ? (
DashboardContentLayoutPhone(windowWidth)
) : (
DashboardContentLayout(windowWidth)
)
) : (
<Stack <Stack
style={{ style={{
display: 'grid', display: 'grid',
@ -75,24 +81,20 @@ const DashboardContent = () => {
width: '100%', width: '100%',
}} }}
> >
<YStack > <YStack>
<XStack>
<XStack >
<ConsensusUptimeCard /> <ConsensusUptimeCard />
<ExecutionUptime /> <ExecutionUptime />
</XStack> </XStack>
<DeviceUptime /> <DeviceUptime />
</YStack> </YStack>
<YStack space={'$4'} > <YStack space={'$4'}>
<XStack space={'$4'} > <XStack space={'$4'}>
<StorageCard maxStorage={100} storage={82} /> <StorageCard maxStorage={100} storage={82} />
<CPUCard load={[12, 31, 3, 2, 24, 98]} /> <CPUCard load={[12, 31, 3, 2, 24, 98]} />
</XStack> </XStack>
<XStack space='$4'> <XStack space="$4">
<MemoryCard currentMemory={[21, 33, 3, 42, 35]} maxMemory={50} /> <MemoryCard currentMemory={[21, 33, 3, 42, 35]} maxMemory={50} />
<NetworkCard <NetworkCard
@ -107,36 +109,36 @@ const DashboardContent = () => {
) )
} }
const DashboardContentLayout = (windowWidth: number) => { const DashboardContentLayout = (windowWidth: number) => {
return (<Stack return (
style={{ <Stack
display: 'grid', style={{
gridTemplateColumns: '1fr 1fr', display: 'grid',
gap: '8px', gridTemplateColumns: '1fr 1fr',
gap: '8px',
width: '101%', width: '101%',
}} }}
> >
<YStack> <YStack>
<XStack>
<ConsensusUptimeCard />
<ExecutionUptime />
</XStack>
<XStack> <DeviceUptime />
</YStack>
<ConsensusUptimeCard /> <StorageCard maxStorage={100} storage={82} />
<ExecutionUptime /> <CPUCard load={[12, 31, 3, 2, 24, 98]} />
</XStack>
<DeviceUptime /> <MemoryCard currentMemory={[21, 33, 3, 42, 35]} maxMemory={50} />
</YStack>
<StorageCard maxStorage={100} storage={82} /> <NetworkCard
<CPUCard load={[12, 31, 3, 2, 24, 98]} /> downloadRate={[12, 31, 22, 12, 23, 23, 90]}
uploadRate={[31, 22, 32, 132, 32, 45, 65]}
<MemoryCard currentMemory={[21, 33, 3, 42, 35]} maxMemory={50} /> />
</Stack>
<NetworkCard )
downloadRate={[12, 31, 22, 12, 23, 23, 90]}
uploadRate={[31, 22, 32, 132, 32, 45, 65]}
/>
</Stack>)
} }
const DashboardContentLayoutPhone = (windowWidth: number) => { const DashboardContentLayoutPhone = (windowWidth: number) => {
@ -150,14 +152,11 @@ const DashboardContentLayoutPhone = (windowWidth: number) => {
width: '101%', width: '101%',
}} }}
> >
<ConsensusUptimeCard /> <ConsensusUptimeCard />
<ExecutionUptime /> <ExecutionUptime />
<DeviceUptime /> <DeviceUptime />
<StorageCard maxStorage={100} storage={82} /> <StorageCard maxStorage={100} storage={82} />
<CPUCard load={[12, 31, 3, 2, 24, 98]} /> <CPUCard load={[12, 31, 3, 2, 24, 98]} />

View File

@ -28,7 +28,7 @@ const DeviceUptime = () => {
} }
return ( return (
<DashboardCardWrapper > <DashboardCardWrapper>
<YStack space={'$3'}> <YStack space={'$3'}>
<XStack justifyContent={'space-between'}> <XStack justifyContent={'space-between'}>
<YStack> <YStack>

View File

@ -8,7 +8,7 @@ import DashboardCardWrapper from '../DashboardCardWrapper'
const ExecutionUptime = () => { const ExecutionUptime = () => {
const monthlyActivity = [3, 0, 5, 4, 6, 7, 0, 9, 10, 1, 2, 3] const monthlyActivity = [3, 0, 5, 4, 6, 7, 0, 9, 10, 1, 2, 3]
return ( return (
<DashboardCardWrapper > <DashboardCardWrapper>
<YStack space={'$3'} minHeight={'156px'} padding={'$3'}> <YStack space={'$3'} minHeight={'156px'} padding={'$3'}>
<YStack> <YStack>
<Text size={15} weight={'semibold'}> <Text size={15} weight={'semibold'}>

View File

@ -42,7 +42,7 @@ const MemoryCard = ({ currentMemory, maxMemory }: MemoryCardProps) => {
const message = currentLoad < maxMemory ? 'Good' : 'Poor' const message = currentLoad < maxMemory ? 'Good' : 'Poor'
return ( return (
<DashboardCardWrapper padding="0" height="156px" minWidth="200px" > <DashboardCardWrapper padding="0" height="156px" minWidth="200px">
<YStack <YStack
style={{ style={{
borderRadius: '16px', borderRadius: '16px',

View File

@ -48,7 +48,7 @@ const NetworkCard = ({ uploadRate, downloadRate }: NetworkCardProps) => {
const message = currentLoad > 60 ? 'Good' : 'Poor' const message = currentLoad > 60 ? 'Good' : 'Poor'
return ( return (
<DashboardCardWrapper padding="0" height="156px" minWidth="200px" > <DashboardCardWrapper padding="0" height="156px" minWidth="200px">
<YStack <YStack
style={{ style={{
borderRadius: '16px', borderRadius: '16px',

View File

@ -35,7 +35,7 @@ const StorageCard = ({ storage, maxStorage }: StorageCardProps) => {
} }
return ( return (
<DashboardCardWrapper padding="0" height="156px" minWidth="200px" > <DashboardCardWrapper padding="0" height="156px" minWidth="200px">
<YStack <YStack
style={{ style={{
borderRadius: '16px', borderRadius: '16px',