Skip to content

Commit

Permalink
adding number of items on each row
Browse files Browse the repository at this point in the history
  • Loading branch information
erasta committed Nov 19, 2024
1 parent f1e7c61 commit ec59382
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 11 deletions.
5 changes: 4 additions & 1 deletion client/src/App/TreeSublist.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ export const TreeSublist = ({
components,
children,
noAddButton,
textOnRow
}) => {
const {
addExpandedNode,
Expand All @@ -24,6 +25,7 @@ export const TreeSublist = ({
const items = data[fieldName] || [];
const key = parentKey + '_' + fieldName;

const niceName = camelCaseToWords(fieldName);
return (
<TreeItem
key={key}
Expand All @@ -42,7 +44,7 @@ export const TreeSublist = ({
fontWeight: 'inherit',
// flexGrow: 1
}}>
{camelCaseToWords(fieldName)}
{niceName}
</Typography>
{noAddButton ? null :
<Tooltip title="Add New" placement="right">
Expand All @@ -67,6 +69,7 @@ export const TreeSublist = ({
</IconButton>
</Tooltip>
}
<Typography>{items.length} {niceName} {textOnRow}</Typography>
{components}
</Box>
}
Expand Down
6 changes: 1 addition & 5 deletions client/src/Experiment/DeviceTypesList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ export const DeviceTypesList = ({ data, setData }) => {
]
}
}}
components={<>
<Typography>
{deviceTypes.length} Types {devicesNum} Devices
</Typography>
</>}
textOnRow={devicesNum + ' Devices'}
>
{deviceTypes.map(itemData => (
<DeviceType
Expand Down
6 changes: 1 addition & 5 deletions client/src/Experiment/TrialTypesList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,11 +28,7 @@ export const TrialTypesList = ({ data, setData }) => {
]
}
}}
components={<>
<Typography>
{trialTypes.length} Types {trialsNum} Trials
</Typography>
</>}
textOnRow={trialsNum + ' Trials'}
>
{trialTypes.map(itemData => (
<TrialType
Expand Down

0 comments on commit ec59382

Please sign in to comment.