apps/web: revert Header to Form

This commit is contained in:
vchikalkin 2023-11-21 17:38:04 +03:00
parent bbbf707227
commit a3a31000de
3 changed files with 8 additions and 5 deletions

View File

@ -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>
);

View File

@ -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 />

View File

@ -5,4 +5,5 @@ export type Props = {
readonly data: ResponseGetData;
readonly metaData: ResponseMetaData;
readonly pageUrlParams: PageUrlParams;
readonly title: string;
};