Skip to content

feat: add contact details form to home page #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
113 changes: 113 additions & 0 deletions src/app/components/AddressForm/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,113 @@
import React from "react";
import { css } from "@emotion/react";

export default function AddressForm() {
return (
<form noValidate autoComplete="off">
<div
css={css`
display: flex;
flex-direction: column;
align-items: flex-start;
padding: 1.5rem;
> div {
width: 100%;
display: flex;
flex-direction: column;
text-align: left;
}
label,
.helper-text {
display: block;
}
.helper-text {
font-size: 0.8rem;
color: var(--text-color-secondary);
margin-top: 0.5rem;
}
input {
padding: 0.5rem 1rem;
border: 1px solid var(--border-color);
border-radius: 5px;
margin-bottom: 1rem;
margin-top: 0.5rem;
}
`}
>
<div>
<label
css={css`
color: black;
`}
>
Name
</label>
<span className="helper-text">Please enter a name</span>
<input
required
name="name"
defaultValue=""
placeholder="Enter a name"
type="text"
/>
</div>
<div>
<label
css={css`
color: #555;
`}
>
Line 1
</label>
<input
required
name="line1"
defaultValue=""
placeholder="Enter line 1"
type="text"
css={css`
margin-right: 1.5rem;
`}
/>
</div>
<div>
<label
css={css`
color: #000;
`}
>
Line 2
</label>
<input
name="line2"
defaultValue=""
placeholder="Enter line 2"
type="text"
css={css`
margin-left: 0.5rem;
`}
/>
</div>
<div>
<label
css={css`
color: "rgba(0, 0, 0, 0.9)";
`}
>
Postcode
</label>
<input
required
name="line1"
defaultValue=""
placeholder="Enter postcode"
type="text"
css={css`
margin-left: 0.5rem;
`}
/>
</div>
</div>
</form>
);
}
3 changes: 2 additions & 1 deletion src/app/components/ThemeRegistry/theme-variables.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
--background-color-dark: #e9ecef;
--background-color-card: rgba(250, 224, 66, 0.2);
--background-color-card-title: rgba(250, 224, 66, 0.3);
--border-color-card: rgba(250, 224, 66, 0.45);
--border-color: rgb(180, 180, 200);

--shadow-light: 0px 4px 6px rgba(0, 0, 0, 0.1);
--shadow-medium: 0px 6px 12px rgba(0, 0, 0, 0.15);
Expand All @@ -23,6 +23,7 @@
--color-white: #ffffff;
--color-black: #000000;
--color-gray: #6c757d;
--text-color-secondary: #6c757d;

--color-success: #28a745;
--color-danger: #dc3545;
Expand Down
3 changes: 2 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
import React from "react";
import { css } from "@emotion/react";
import Button from "./components/Button";
import AddressForm from "./components/AddressForm";

export default function Home() {
return (
Expand Down Expand Up @@ -34,7 +35,7 @@ export default function Home() {
padding: 2;
`}
>
<pre>TODO: Address Form</pre>
<AddressForm />
</div>
<div
css={css`
Expand Down
Loading