From 23017b6205b913dcc8343578e1994e740e7c5f3c Mon Sep 17 00:00:00 2001 From: vchikalkin Date: Tue, 21 Nov 2023 17:49:40 +0300 Subject: [PATCH] packages/ui: remove layout params from Background apps/web: remove Background component usage from pages --- apps/web/app/ius/[slug]/conditions/page.tsx | 7 +------ apps/web/app/ius/[slug]/page.tsx | 7 +------ apps/web/components/Conditions.tsx | 9 +++++++-- apps/web/components/Form/index.tsx | 17 ++++++++++------- packages/ui/background.tsx | 4 +--- 5 files changed, 20 insertions(+), 24 deletions(-) diff --git a/apps/web/app/ius/[slug]/conditions/page.tsx b/apps/web/app/ius/[slug]/conditions/page.tsx index 78bbc6e..9abc22d 100644 --- a/apps/web/app/ius/[slug]/conditions/page.tsx +++ b/apps/web/app/ius/[slug]/conditions/page.tsx @@ -5,7 +5,6 @@ import type { PageProps } from '@/types/page'; import { withError } from '@/utils/error'; import { getPageUrlParams, makeCreateUrl } from '@/utils/url'; import type { Metadata } from 'next'; -import { Background } from 'ui'; export async function generateMetadata(pageProps: PageProps): Promise { const pageUrlParams = getPageUrlParams(pageProps); @@ -30,11 +29,7 @@ export default async function Page(pageProps: PageProps) { const createUrl = makeCreateUrl(pageUrlParams); const conditions = await apiIUS.getConditions({ createUrl }); - return ( - - - - ); + return ; }, }); } diff --git a/apps/web/app/ius/[slug]/page.tsx b/apps/web/app/ius/[slug]/page.tsx index 5720511..80acfae 100644 --- a/apps/web/app/ius/[slug]/page.tsx +++ b/apps/web/app/ius/[slug]/page.tsx @@ -4,7 +4,6 @@ import type { PageProps } from '@/types/page'; import { withError } from '@/utils/error'; import { getPageUrlParams, makeCreateUrl } from '@/utils/url'; import type { Metadata } from 'next'; -import { Background } from 'ui'; export async function generateMetadata(pageProps: PageProps): Promise { const pageUrlParams = getPageUrlParams(pageProps); @@ -35,11 +34,7 @@ export default async function Page(pageProps: PageProps) { ]).then(([data, metaData, { title }]) => { const props = { data, metaData, pageUrlParams, title }; - return ( - -
- - ); + return ; }); }, }); diff --git a/apps/web/components/Conditions.tsx b/apps/web/components/Conditions.tsx index 68f1448..95b5ed7 100644 --- a/apps/web/components/Conditions.tsx +++ b/apps/web/components/Conditions.tsx @@ -1,10 +1,15 @@ -/* eslint-disable react/no-danger */ +/* eslint-disable react/forbid-component-props */ +import { Background } from 'ui'; + type Props = { readonly html: string; }; export function Conditions({ html }: Props) { return ( -
+ ); } diff --git a/apps/web/components/Form/index.tsx b/apps/web/components/Form/index.tsx index 6b8c070..95c520f 100644 --- a/apps/web/components/Form/index.tsx +++ b/apps/web/components/Form/index.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react/forbid-component-props */ 'use client'; import { Buttons } from './Buttons'; import { FormContextProvider } from './context/form-context'; @@ -5,19 +6,21 @@ import { Elements } from './Elements'; import { Header } from './Header'; import type { Props } from './types'; import { makeCreateUrl } from '@/utils/url'; -import { Divider } from 'ui'; +import { Background, Divider } from 'ui'; export function Form(props: Props) { const { pageUrlParams, title } = props; const createUrl = makeCreateUrl(pageUrlParams); return ( - -
- - - - + + +
+ + + + + ); } diff --git a/packages/ui/background.tsx b/packages/ui/background.tsx index 4b18ba6..ccdcc7e 100644 --- a/packages/ui/background.tsx +++ b/packages/ui/background.tsx @@ -3,9 +3,7 @@ import type { VariantProps } from 'class-variance-authority'; import { cva } from 'class-variance-authority'; import { forwardRef, type HTMLAttributes } from 'react'; -const variants = cva( - 'grid w-full gap-2 rounded-sm border border-slate-100 bg-white p-5 lg:w-standard' -); +const variants = cva('rounded-sm border border-slate-100 bg-white'); export type BackgroundProps = HTMLAttributes & VariantProps;