feat: implement initial payment amount form
This commit is contained in:
@@ -16,12 +16,22 @@ header img {
|
|||||||
width: 12rem;
|
width: 12rem;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
header .info {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
|
gap: 0.25rem;
|
||||||
|
max-width: 31.25rem;
|
||||||
|
text-align: center;
|
||||||
|
}
|
||||||
|
|
||||||
form {
|
form {
|
||||||
background-color: #181818;
|
background-color: #181818;
|
||||||
border-radius: 0.25rem;
|
border-radius: 0.25rem;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 0.5rem;
|
gap: 0.5rem;
|
||||||
width: 22.5rem;
|
width: 100%;
|
||||||
|
max-width: 31.25rem;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
display: flex;
|
display: flex;
|
||||||
box-shadow: 0 4px 8px #0000001a;
|
box-shadow: 0 4px 8px #0000001a;
|
||||||
|
|||||||
@@ -1,11 +1,6 @@
|
|||||||
import '@/App.css';
|
import '@/App.css';
|
||||||
import { useRef, useState } from 'react';
|
import { useRef, useState } from 'react';
|
||||||
|
|
||||||
// TODO: Maybe be good to require
|
|
||||||
// the user provide some sort of
|
|
||||||
// identifier so we can display
|
|
||||||
// that as part of the feed
|
|
||||||
|
|
||||||
function App() {
|
function App() {
|
||||||
const [amount, setAmount] = useState<number | ''>('');
|
const [amount, setAmount] = useState<number | ''>('');
|
||||||
const [email, setEmail] = useState<string>('');
|
const [email, setEmail] = useState<string>('');
|
||||||
@@ -15,13 +10,13 @@ function App() {
|
|||||||
const emailInputRef = useRef<HTMLInputElement>(null);
|
const emailInputRef = useRef<HTMLInputElement>(null);
|
||||||
|
|
||||||
function handleAmountInput(event: React.ChangeEvent<HTMLInputElement>) {
|
function handleAmountInput(event: React.ChangeEvent<HTMLInputElement>) {
|
||||||
errors.amount = undefined;
|
setErrors((prevErrors) => ({ ...prevErrors, amount: undefined }));
|
||||||
const value = parseInt(event.target.value);
|
const value = parseInt(event.target.value);
|
||||||
setAmount(isNaN(value) ? '' : value);
|
setAmount(isNaN(value) ? '' : value);
|
||||||
}
|
}
|
||||||
|
|
||||||
function handleEmailInput(event: React.ChangeEvent<HTMLInputElement>) {
|
function handleEmailInput(event: React.ChangeEvent<HTMLInputElement>) {
|
||||||
errors.email = undefined;
|
setErrors((prevErrors) => ({ ...prevErrors, email: undefined }));
|
||||||
setEmail(event.target.value);
|
setEmail(event.target.value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,8 +64,17 @@ function App() {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<header>
|
<header>
|
||||||
<img src="https://github.com/StevanFreeborn.png" alt="Logo" />
|
<img
|
||||||
<p>Some information about me</p>
|
src='https://github.com/StevanFreeborn.png'
|
||||||
|
alt='Profile picture of Stevan Freeborn'
|
||||||
|
/>
|
||||||
|
<div className='info'>
|
||||||
|
<h1>Stevan Freeborn</h1>
|
||||||
|
<p>
|
||||||
|
I'm a dad of 2 who enjoys drinking coffee, lifting weights, and solving problems with
|
||||||
|
code. You really don't need to buy me a coffee.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
</header>
|
</header>
|
||||||
<main>
|
<main>
|
||||||
<form
|
<form
|
||||||
|
|||||||
@@ -71,6 +71,9 @@ body {
|
|||||||
}
|
}
|
||||||
|
|
||||||
main {
|
main {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
align-items: center;
|
||||||
padding: 1rem;
|
padding: 1rem;
|
||||||
padding-top: 2rem;
|
padding-top: 2rem;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user