mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-08 04:50:12 +02:00
hide display type toggle if only one available
This commit is contained in:
@@ -132,30 +132,32 @@ export const ListConfigMenu = (props: ListConfigMenuProps) => {
|
||||
title={t('common.configure', { postProcess: 'sentenceCase' })}
|
||||
>
|
||||
<Stack gap="xs">
|
||||
<ListConfigTable
|
||||
options={[
|
||||
{
|
||||
component: (
|
||||
<SegmentedControl
|
||||
data={availableDisplayTypes}
|
||||
fullWidth
|
||||
onChange={(value) => {
|
||||
setList(props.listKey, {
|
||||
display: value as ListDisplayType,
|
||||
});
|
||||
}}
|
||||
size="sm"
|
||||
value={displayType}
|
||||
withItemsBorders={false}
|
||||
/>
|
||||
),
|
||||
id: 'displayType',
|
||||
label: t('table.config.general.displayType', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
{availableDisplayTypes.length > 1 && (
|
||||
<ListConfigTable
|
||||
options={[
|
||||
{
|
||||
component: (
|
||||
<SegmentedControl
|
||||
data={availableDisplayTypes}
|
||||
fullWidth
|
||||
onChange={(value) => {
|
||||
setList(props.listKey, {
|
||||
display: value as ListDisplayType,
|
||||
});
|
||||
}}
|
||||
size="sm"
|
||||
value={displayType}
|
||||
withItemsBorders={false}
|
||||
/>
|
||||
),
|
||||
id: 'displayType',
|
||||
label: t('table.config.general.displayType', {
|
||||
postProcess: 'sentenceCase',
|
||||
}),
|
||||
},
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
<Config displayType={displayType} {...props} />
|
||||
</Stack>
|
||||
</Modal>
|
||||
|
||||
Reference in New Issue
Block a user