From 0b9d6be08cd900addb773bf5ef47c06d6189a6b2 Mon Sep 17 00:00:00 2001 From: Tsu-ba-me Date: Tue, 3 Oct 2023 19:12:23 -0400 Subject: [PATCH] fix(striker-ui): prevent text overlap in anvil summary --- striker-ui/components/Anvils/AnvilSummary.tsx | 29 +++++++++---------- .../components/Anvils/AnvilSummaryList.tsx | 13 +++++++-- striker-ui/types/AnvilSummary.d.ts | 6 +--- 3 files changed, 25 insertions(+), 23 deletions(-) diff --git a/striker-ui/components/Anvils/AnvilSummary.tsx b/striker-ui/components/Anvils/AnvilSummary.tsx index a8c9cd19..002ba2f6 100644 --- a/striker-ui/components/Anvils/AnvilSummary.tsx +++ b/striker-ui/components/Anvils/AnvilSummary.tsx @@ -90,7 +90,8 @@ const AnvilSummary: FC = (props) => { anvil && ( .${gridClasses.item}:nth-child(-n + 4)`]: { @@ -107,38 +108,34 @@ const AnvilSummary: FC = (props) => { let servers: ReactNode; if (['offline', 'online'].includes(state)) { - servers = ( - - Servers{' '} - - {serverCount} - - - ); + servers = {serverCount}; } else { stateValue = `${stateProgress}%`; } return [ - + {name} , - + {stateValue} , - - + + + , + + {servers && Servers} , {servers} , @@ -167,13 +164,13 @@ const AnvilSummary: FC = (props) => { alignItems="center" columns={2} container - minWidth="calc(0% + 3.2em)" sx={{ + width: '3.7em', + [`& > .${gridClasses.item}:nth-child(-n + 2)`]: { marginBottom: '-.6em', }, }} - width="calc(0% + 3.2em)" > Cores diff --git a/striker-ui/components/Anvils/AnvilSummaryList.tsx b/striker-ui/components/Anvils/AnvilSummaryList.tsx index 3a47e8d8..e22a4be3 100644 --- a/striker-ui/components/Anvils/AnvilSummaryList.tsx +++ b/striker-ui/components/Anvils/AnvilSummaryList.tsx @@ -1,3 +1,4 @@ +import { gridClasses } from '@mui/material'; import { FC, ReactNode, useMemo } from 'react'; import AnvilSummary from './AnvilSummary'; @@ -27,7 +28,7 @@ const AnvilSummaryList: FC = () => { () => anvils && ( ( (previous, current) => { const { description, name, uuid } = current; @@ -36,7 +37,7 @@ const AnvilSummaryList: FC = () => { previous[key] = { children: ( - + { }, {}, )} + spacing="1em" + sx={{ + alignContent: 'stretch', + + [`& > .${gridClasses.item}`]: { + minWidth: '20em', + }, + }} /> ), [anvils], diff --git a/striker-ui/types/AnvilSummary.d.ts b/striker-ui/types/AnvilSummary.d.ts index 8cfd05ff..2a00698d 100644 --- a/striker-ui/types/AnvilSummary.d.ts +++ b/striker-ui/types/AnvilSummary.d.ts @@ -1,7 +1,3 @@ -type AnvilSummaryOptionalProps = { - loading?: boolean; -}; - -type AnvilSummaryProps = AnvilSummaryOptionalProps & { +type AnvilSummaryProps = { anvilUuid: string; };