From ff10555b5ab51a3f780abae9855cda237d2930c7 Mon Sep 17 00:00:00 2001 From: Josue Date: Tue, 20 Apr 2021 18:29:48 -0400 Subject: [PATCH] feat: add decorator to Shared Storage --- striker-ui/components/SharedStorageNode.tsx | 93 ++++++++++++++------- 1 file changed, 64 insertions(+), 29 deletions(-) diff --git a/striker-ui/components/SharedStorageNode.tsx b/striker-ui/components/SharedStorageNode.tsx index b7c1faf9..e0d1ffa9 100644 --- a/striker-ui/components/SharedStorageNode.tsx +++ b/striker-ui/components/SharedStorageNode.tsx @@ -1,21 +1,43 @@ import { Box } from '@material-ui/core'; import { makeStyles } from '@material-ui/core/styles'; +import { ClassNameMap } from '@material-ui/styles'; import * as prettyBytes from 'pretty-bytes'; import { AllocationBar } from './Bars'; import { BodyText } from './Text'; +import { BLUE, RED_ON } from '../lib/consts/DEFAULT_THEME'; + +const selectDecorator = ( + state: boolean, +): keyof ClassNameMap<'mounted' | 'notMounted'> => { + return state ? 'mounted' : 'notMounted'; +}; const useStyles = makeStyles(() => ({ fs: { paddingLeft: '10px', paddingRight: '10px', - paddingTop: '10px', + paddingTop: '15px', }, bar: { paddingLeft: '10px', paddingRight: '10px', }, + decorator: { + width: '20px', + height: '100%', + borderRadius: 2, + }, + decoratorBox: { + paddingRight: '5px', + }, + mounted: { + backgroundColor: BLUE, + }, + notMounted: { + backgroundColor: RED_ON, + }, })); const SharedStorageNode = ({ @@ -24,44 +46,57 @@ const SharedStorageNode = ({ node: AnvilSharedStorageNode; }): JSX.Element => { const classes = useStyles(); - return ( <> - + - - - - +
- + - - - - - - - - + {node.is_mounted && ( + <> + + + + + + + + + + + + + + + + + + )} ); };