From 5dbdf84dd76763c1e8095f6c8f647e3248cc2135 Mon Sep 17 00:00:00 2001 From: widgeter Date: Fri, 11 Aug 2023 17:50:09 +0200 Subject: [PATCH] Create a contact component --- src/components/ui/Form.astro | 86 ++++++++++++++++++++++++++++ src/components/widgets/Contact.astro | 40 +++++++++++++ src/pages/contact.astro | 28 ++++++++- src/types.d.ts | 28 +++++++++ 4 files changed, 180 insertions(+), 2 deletions(-) create mode 100644 src/components/ui/Form.astro create mode 100644 src/components/widgets/Contact.astro diff --git a/src/components/ui/Form.astro b/src/components/ui/Form.astro new file mode 100644 index 0000000..da4bec8 --- /dev/null +++ b/src/components/ui/Form.astro @@ -0,0 +1,86 @@ +--- +import { Form } from '~/types'; + +const { inputs, textarea, disclaimer, button = 'Contact us', description = '' } = Astro.props as Form; +--- + +
+ { + inputs && + inputs.map( + ({ type = 'text', name, label = '', autocomplete = 'on', placeholder = '' }) => + name && ( +
+ {label && ( + + )} + +
+ ) + ) + } + + { + textarea && ( +
+ +