Skip to content

Commit

Permalink
fix: Add Group labels back in
Browse files Browse the repository at this point in the history
  • Loading branch information
hatton committed Aug 13, 2024
1 parent 07eb47d commit 67cc070
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 10 deletions.
13 changes: 11 additions & 2 deletions lib/ContentPane.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ export const ContentPane: React.FunctionComponent<
// this is the whole settings object that we are editing
initialValues: object;
currentTopLevelPageIndex?: number;
children: PageChild | PageChild[];
children:
| React.ReactElement<typeof ConfigrPage>
| React.ReactElement<typeof ConfigrPage>[];
setValueGetter?: (vg: valueGetter) => void;
onChange?: (currentValues: any) => void;
}>
Expand Down Expand Up @@ -847,7 +849,14 @@ export const ConfigrGroup: React.FunctionComponent<
// TODO: after the reorg to allow sub page hierarchy to be independent of data hierarchy, we have yet to
// TODO: re-install the search filter that shows a set of items (not sure what level) that match the search term.

return <BoxOfRows {...props}>{props.children}</BoxOfRows>;
return (
<>
{props.inFocussedPage && props.label && (
<Typography variant="h3">{props.label}</Typography>
)}
<BoxOfRows {...props}>{props.children}</BoxOfRows>
</>
);

// <FilterForSearchText {...props} kids={props.children}>
// <div
Expand Down
14 changes: 6 additions & 8 deletions src/stories/bloom.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,10 @@ const BloomCollectionInner: React.FunctionComponent<{
</ConfigrGroup>
</ConfigrPage> */}

<ConfigrPage label="Languages" pageKey="languages">
{!props.onChange && (
<ConfigrGroup label="Languages">
<h1>test</h1>
</ConfigrGroup>
)}
<ConfigrPage label="Area" pageKey="testinggrouplabel">
<ConfigrGroup label="Show this Group Label">
<ConfigrBoolean label="foo" path="blah" />
</ConfigrGroup>
</ConfigrPage>
<ConfigrPage label="Languages" pageKey="languages">
<ConfigrForEach
Expand Down Expand Up @@ -249,7 +247,7 @@ const BloomCollectionInner: React.FunctionComponent<{
></ConfigrForEach>
</ConfigrPage>
<ConfigrPage label="Book Defaults" pageKey="book defaults">
<ConfigrGroup label="Book Defaults">
<ConfigrGroup>
<ConfigrSelect
path={'pageNumberStyle'}
label="Page Numbering Style"
Expand Down Expand Up @@ -328,7 +326,7 @@ const BloomCollectionInner: React.FunctionComponent<{
</ConfigrPage>

<ConfigrPage label="Advanced" pageKey="advanced">
<ConfigrGroup label="AdvancedGroup">
<ConfigrGroup>
<ConfigrInput path="collectionName" label="Bloom Collection Name" />
<ConfigrBoolean label="Automatically Update Bloom" path="autoUpdate" />
</ConfigrGroup>
Expand Down

0 comments on commit 67cc070

Please sign in to comment.