Skip to content
Snippets Groups Projects
Unverified Commit 856c2355 authored by Douglas Fabris's avatar Douglas Fabris Committed by GitHub
Browse files

regression: Change header buttons location on `GroupPage` (#30042)

parent 5409b37f
No related branches found
No related tags found
No related merge requests found
......@@ -160,7 +160,9 @@ const GroupPage: FC<GroupPageProps> = ({
return (
<Page is='form' action='#' method='post' onSubmit={handleSubmit}>
<Page.Header onClickBack={handleBack} title={i18nLabel && isTranslationKey(i18nLabel) && t(i18nLabel)} />
<Page.Header onClickBack={handleBack} title={i18nLabel && isTranslationKey(i18nLabel) && t(i18nLabel)}>
<ButtonGroup>{headerButtons}</ButtonGroup>
</Page.Header>
{tabs}
{isCustom ? (
children
......@@ -192,7 +194,6 @@ const GroupPage: FC<GroupPageProps> = ({
type='submit'
onClick={handleSaveClick}
/>
{headerButtons}
</ButtonGroup>
</Page.Footer>
</Page>
......
......@@ -8,12 +8,12 @@ import Section from '../Section';
type GenericGroupPageProps = ISetting;
function GenericGroupPage({ _id, ...group }: GenericGroupPageProps): ReactElement {
function GenericGroupPage({ _id, ...props }: GenericGroupPageProps): ReactElement {
const sections = useEditableSettingsGroupSections(_id);
const solo = sections.length === 1;
return (
<GroupPage _id={_id} {...group}>
<GroupPage _id={_id} {...props}>
{sections.map((sectionName) => (
<Section key={sectionName || ''} groupId={_id} sectionName={sectionName} solo={solo} />
))}
......
......@@ -14,7 +14,7 @@ type TabbedGroupPageProps = ISetting & {
headerButtons?: ReactElement;
};
function TabbedGroupPage({ _id, ...group }: TabbedGroupPageProps): JSX.Element {
function TabbedGroupPage({ _id, ...props }: TabbedGroupPageProps): JSX.Element {
const t = useTranslation();
const tabs = useEditableSettingsGroupTabs(_id);
......@@ -25,7 +25,7 @@ function TabbedGroupPage({ _id, ...group }: TabbedGroupPageProps): JSX.Element {
const solo = sections.length === 1;
if (!tabs.length || (tabs.length === 1 && !tabs[0])) {
return <GenericGroupPage _id={_id} {...group} />;
return <GenericGroupPage _id={_id} {...props} />;
}
if (!tab && tabs[0]) {
......@@ -43,7 +43,7 @@ function TabbedGroupPage({ _id, ...group }: TabbedGroupPageProps): JSX.Element {
);
return (
<GroupPage _id={_id} {...group} tabs={tabsComponent}>
<GroupPage _id={_id} {...props} tabs={tabsComponent}>
{sections.map((sectionName) => (
<Section key={sectionName || ''} groupId={_id} sectionName={sectionName} tabName={tab} solo={solo} />
))}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment