From ade92ed29750215f1f3cbdf4913717f98f7050ff Mon Sep 17 00:00:00 2001 From: catloversg <152669316+catloversg@users.noreply.github.com> Date: Sat, 21 Sep 2024 11:02:57 +0700 Subject: [PATCH] BUGFIX: Wrong size of table cell in Import Save Comparison UI (#1659) --- src/ui/React/ImportSave/ImportSave.tsx | 183 +++++++++++++++---------- 1 file changed, 108 insertions(+), 75 deletions(-) diff --git a/src/ui/React/ImportSave/ImportSave.tsx b/src/ui/React/ImportSave/ImportSave.tsx index c87a3b11a..ab6900eaa 100644 --- a/src/ui/React/ImportSave/ImportSave.tsx +++ b/src/ui/React/ImportSave/ImportSave.tsx @@ -48,6 +48,10 @@ const useStyles = makeStyles()((theme: Theme) => ({ "& .MuiTable-root": { "& .MuiTableCell-root": { borderBottom: `1px solid ${Settings.theme.welllight}`, + width: "30%", + }, + "& .MuiTableCell-root:last-child": { + width: "10%", }, "& .MuiTableHead-root .MuiTableRow-root": { @@ -94,6 +98,7 @@ export const ImportSave = (props: { saveData: SaveData; automatic: boolean }): J const [currentData, setCurrentData] = useState(); const [isImportModalOpen, { on: openImportModal, off: closeImportModal }] = useBoolean(false); const [isSkillsExpanded, { toggle: toggleSkillsExpand }] = useBoolean(true); + const [isOthersExpanded, { toggle: toggleOthersExpand }] = useBoolean(true); const [headback, setHeadback] = useState(false); const handleGoBack = (): void => { @@ -165,7 +170,7 @@ export const ImportSave = (props: { saveData: SaveData; automatic: boolean }): J Current Game Being Imported - + @@ -230,6 +235,7 @@ export const ImportSave = (props: { saveData: SaveData; automatic: boolean }): J )} + @@ -252,7 +258,7 @@ export const ImportSave = (props: { saveData: SaveData; automatic: boolean }): J {skill} {formatNumberNoSuffix(currentSkill, 0)} {formatNumberNoSuffix(importSkill, 0)} - + {currentSkill !== importSkill && currentSkill} />} @@ -269,86 +275,113 @@ export const ImportSave = (props: { saveData: SaveData; automatic: boolean }): J {/* empty row to keep even/odd coloring */} - Augmentations - {currentData.playerData?.augmentations} - {importData.playerData?.augmentations} - - {importData.playerData?.augmentations !== currentData.playerData?.augmentations && ( - (currentData.playerData?.augmentations ?? 0) - } - /> - )} + + + {isOthersExpanded ? : } + + Others + + + + + + + Augmentations + {currentData.playerData?.augmentations} + {importData.playerData?.augmentations} + + {importData.playerData?.augmentations !== currentData.playerData?.augmentations && ( + + (currentData.playerData?.augmentations ?? 0) + } + /> + )} + + - - Factions - {currentData.playerData?.factions} - {importData.playerData?.factions} - - {importData.playerData?.factions !== currentData.playerData?.factions && ( - (currentData.playerData?.factions ?? 0)} - /> - )} - - - - Achievements - {currentData.playerData?.achievements} - {importData.playerData?.achievements} - - {importData.playerData?.achievements !== currentData.playerData?.achievements && ( - (currentData.playerData?.achievements ?? 0)} - /> - )} - - + + Factions + {currentData.playerData?.factions} + {importData.playerData?.factions} + + {importData.playerData?.factions !== currentData.playerData?.factions && ( + (currentData.playerData?.factions ?? 0) + } + /> + )} + + + + Achievements + {currentData.playerData?.achievements} + {importData.playerData?.achievements} + + {importData.playerData?.achievements !== currentData.playerData?.achievements && ( + (currentData.playerData?.achievements ?? 0) + } + /> + )} + + - - - Source File Levels - - {currentData.playerData?.sourceFiles} - {importData.playerData?.sourceFiles} - - {importData.playerData?.sourceFiles !== currentData.playerData?.sourceFiles && ( - (currentData.playerData?.sourceFiles ?? 0)} - /> - )} - - + + + Source File Levels + + {currentData.playerData?.sourceFiles} + {importData.playerData?.sourceFiles} + + {importData.playerData?.sourceFiles !== currentData.playerData?.sourceFiles && ( + (currentData.playerData?.sourceFiles ?? 0) + } + /> + )} + + - - - Exploits - - {currentData.playerData?.exploits} - {importData.playerData?.exploits} - - {importData.playerData?.exploits !== currentData.playerData?.exploits && ( - (currentData.playerData?.exploits ?? 0)} - /> - )} - - + + + Exploits + + {currentData.playerData?.exploits} + {importData.playerData?.exploits} + + {importData.playerData?.exploits !== currentData.playerData?.exploits && ( + (currentData.playerData?.exploits ?? 0) + } + /> + )} + + - - - BitNode - - - {currentData.playerData?.bitNode}-{currentData.playerData?.bitNodeLevel} + + + BitNode + + + {currentData.playerData?.bitNode}-{currentData.playerData?.bitNodeLevel} + + + {importData.playerData?.bitNode}-{importData.playerData?.bitNodeLevel} + + + + +
+
- - {importData.playerData?.bitNode}-{importData.playerData?.bitNodeLevel} - -