apps/web: revert Header to Form
This commit is contained in:
parent
bbbf707227
commit
a3a31000de
@ -1,5 +1,5 @@
|
||||
import * as apiIUS from '@/api/ius/query';
|
||||
import { Form, Header } from '@/components/Form';
|
||||
import { Form } from '@/components/Form';
|
||||
import type { PageProps } from '@/types/page';
|
||||
import { withError } from '@/utils/error';
|
||||
import { getPageUrlParams, makeCreateUrl } from '@/utils/url';
|
||||
@ -33,11 +33,10 @@ export default async function Page(pageProps: PageProps) {
|
||||
apiIUS.getMetaData({ createUrl }),
|
||||
apiIUS.getConfig({ createUrl }),
|
||||
]).then(([data, metaData, { title }]) => {
|
||||
const props = { data, metaData, pageUrlParams };
|
||||
const props = { data, metaData, pageUrlParams, title };
|
||||
|
||||
return (
|
||||
<Background>
|
||||
<Header title={title} link={'/ius' + createUrl('/conditions')} />
|
||||
<Form {...props} />
|
||||
</Background>
|
||||
);
|
||||
|
||||
@ -2,15 +2,18 @@
|
||||
import { Buttons } from './Buttons';
|
||||
import { FormContextProvider } from './context/form-context';
|
||||
import { Elements } from './Elements';
|
||||
import { Header } from './Header';
|
||||
import type { Props } from './types';
|
||||
import { makeCreateUrl } from '@/utils/url';
|
||||
import { Divider } from 'ui';
|
||||
|
||||
export function Form(props: Props) {
|
||||
const { pageUrlParams } = props;
|
||||
const { pageUrlParams, title } = props;
|
||||
const createUrl = makeCreateUrl(pageUrlParams);
|
||||
|
||||
return (
|
||||
<FormContextProvider pageUrlParams={pageUrlParams} createUrl={makeCreateUrl(pageUrlParams)}>
|
||||
<FormContextProvider pageUrlParams={pageUrlParams} createUrl={createUrl}>
|
||||
<Header title={title} link={'/ius' + createUrl('/conditions')} />
|
||||
<Elements {...props} />
|
||||
<Divider />
|
||||
<Buttons />
|
||||
|
||||
@ -5,4 +5,5 @@ export type Props = {
|
||||
readonly data: ResponseGetData;
|
||||
readonly metaData: ResponseMetaData;
|
||||
readonly pageUrlParams: PageUrlParams;
|
||||
readonly title: string;
|
||||
};
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user