diff --git a/app/layout.tsx b/app/layout.tsx index d0faeaf..0f8ca70 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,5 +1,5 @@ import type { Metadata } from 'next'; -import { Inter } from 'next/font/google'; +import { Poppins } from 'next/font/google'; import './globals.css'; import Navbar from '@/components/navbar/Navbar'; @@ -9,7 +9,7 @@ import { Separator } from '@/components/ui/separator'; import { ClerkProvider } from '@clerk/nextjs'; import Providers from './providers'; -const inter = Inter({ subsets: ['latin'] }); +const poppins = Poppins({ subsets: ['latin'], weight: ['300', '400', '500', '600', '700'] }); export const metadata: Metadata = { title: 'Livo', @@ -24,7 +24,7 @@ export default function RootLayout({ return ( - +
diff --git a/app/stays/create-stay/page.tsx b/app/stays/create-stay/page.tsx index 0fdbd8d..1d6da2a 100644 --- a/app/stays/create-stay/page.tsx +++ b/app/stays/create-stay/page.tsx @@ -1,49 +1,32 @@ +import { AccommodationBlock, DetailsBlock, FormHeader } from '@/components/create-stay-form'; import { - CategoriesInput, FormContainer, - FormInput, - PriceInput, + ImageInput, SubmitButton, TextAreaInput } from '@/components/form'; -import { Button } from '@/components/ui/button'; -import { createPropertyAction } from '@/utils/actions'; - -import Link from 'next/link'; +import { createPropertyAction } from '@/utils/actions';; function CreateProperty() { return (
-
-
-

- Объявление о жилье -

- -
+
+
-
- - - -
+

Загрузите фото

+ + +
-

Превью

+

Предпросмотр

); diff --git a/components/create-stay-form/AccommodationBlock.tsx b/components/create-stay-form/AccommodationBlock.tsx new file mode 100644 index 0000000..a21a0c3 --- /dev/null +++ b/components/create-stay-form/AccommodationBlock.tsx @@ -0,0 +1,21 @@ +import { accommodationList } from '@/utils/accommodation'; +import { CounterInput } from '../form'; + +function AccommodationBlock() { + return ( + <> +

Информация о проживании

+
+ {accommodationList.map(({ name, labelText }) => ( + + ))} +
+ + ); +} + +export default AccommodationBlock; diff --git a/components/create-stay-form/DetailsBlock.tsx b/components/create-stay-form/DetailsBlock.tsx new file mode 100644 index 0000000..3260aa7 --- /dev/null +++ b/components/create-stay-form/DetailsBlock.tsx @@ -0,0 +1,22 @@ +import { CategoriesInput, CountriesInput, FormInput, PriceInput } from '../form'; + +function DetailsBlock() { + return ( + <> +

Детали о жилье

+
+ + + + +
+ + ); +} + +export default DetailsBlock; diff --git a/components/create-stay-form/FormHeader.tsx b/components/create-stay-form/FormHeader.tsx new file mode 100644 index 0000000..99122f8 --- /dev/null +++ b/components/create-stay-form/FormHeader.tsx @@ -0,0 +1,17 @@ +import Link from 'next/link'; +import { Button } from '../ui/button'; + +function FormHeader() { + return ( +
+

+ Объявление о жилье +

+ +
+ ); +} + +export default FormHeader; diff --git a/components/create-stay-form/index.ts b/components/create-stay-form/index.ts new file mode 100644 index 0000000..4f196c7 --- /dev/null +++ b/components/create-stay-form/index.ts @@ -0,0 +1,3 @@ +export { default as FormHeader } from './FormHeader'; +export { default as DetailsBlock } from './DetailsBlock'; +export { default as AccommodationBlock } from './AccommodationBlock'; \ No newline at end of file diff --git a/components/form/CategoriesInput.tsx b/components/form/CategoriesInput.tsx index 9db5dde..422c13f 100644 --- a/components/form/CategoriesInput.tsx +++ b/components/form/CategoriesInput.tsx @@ -11,19 +11,18 @@ import { Prisma } from '@prisma/client'; const name = Prisma.PropertyScalarFieldEnum.category; -function CategoriesInput({ defaultValue }: { defaultValue?: string }) { +function CategoriesInput() { return (
+ + + + + {Array.from({ length }, (_, i) => ( + + {i} + + ))} + + +
+ ); +} + +export default CounterInput; diff --git a/components/form/CountriesInput.tsx b/components/form/CountriesInput.tsx new file mode 100644 index 0000000..2adc38c --- /dev/null +++ b/components/form/CountriesInput.tsx @@ -0,0 +1,46 @@ +'use client'; + +import { Label } from '@/components/ui/label'; +import { formattedCountries, truncateCountryName } from '@/utils/countries'; +import { + Select, + SelectContent, + SelectItem, + SelectTrigger, + SelectValue, +} from '@/components/ui/select'; +import { Prisma } from '@prisma/client'; + +const name = Prisma.PropertyScalarFieldEnum.country; + +function CountriesInput({ placeholder }: { placeholder?: string }) { + return ( +
+ + +
+ ); +} + +export default CountriesInput; \ No newline at end of file diff --git a/components/form/FormInput.tsx b/components/form/FormInput.tsx index d5c12d3..82d0d4a 100644 --- a/components/form/FormInput.tsx +++ b/components/form/FormInput.tsx @@ -14,7 +14,7 @@ function FormInput(props: FormInputProps) { return (
-