feat: getting-start form

Took 7 hours 1 minute
This commit is contained in:
Lucàs
2023-05-05 20:48:30 +02:00
parent db8e513ceb
commit 6eba0d5785
15 changed files with 501 additions and 177 deletions
@@ -0,0 +1,30 @@
import {Button, Flex, FormControl, Input} from '@chakra-ui/react';
import {useDispatch} from 'react-redux';
import {useState} from 'react';
import moment from 'moment';
const BirthInput = () => {
const dispatch = useDispatch();
const [birth, setBirth] = useState('');
return (
<Flex>
<FormControl>
<Input type={'date'} onChange={(evt) => setBirth(evt.target.value)}
value={birth}/>
</FormControl>
<FormControl>
<Button onClick={() => dispatch({
type: 'gettingStartForm/setInput',
payload: {
inputs: {'birth': moment(birth).toISOString()},
message: `Le ${moment(birth).format("ll")}.`, // TODO formate date
},
})}>Envoyer</Button>
</FormControl>
</Flex>
);
};
export default BirthInput;