add button css

This commit is contained in:
Romulus21
2023-09-14 23:48:06 +02:00
parent 4a733929ed
commit 076c87b016
9 changed files with 35 additions and 28 deletions

View File

@@ -5,7 +5,7 @@ import Card from "../Card";
const AddRainfall: FC<AddRainfallProps> = ({reload}) => {
const {axiosPost} = useAxiosTools()
const {errorCatch, errorLabel, axiosPost} = useAxiosTools()
const [date, setDate] = useState((new Date()).toSQLDate())
const [value, setValue] = useState(0)
@@ -16,15 +16,16 @@ const AddRainfall: FC<AddRainfallProps> = ({reload}) => {
setDate((new Date()).toSQLDate())
setValue(0)
reload(new Date())
} catch (e) {
console.error(e)
} catch (error) {
errorCatch(error)
}
}
return <Card className="min-w-[200px] overflow-hidden self-start w-full lg:w-auto">
return <Card className="min-w-[300px] overflow-hidden self-start w-full md:w-auto">
<h2 className="text-center bg-blue-500 text-white -mx-2 -mt-1 text-lg font-bold px-2 py-1">
Ajout d'une mesure
</h2>
{errorLabel()}
<form onSubmit={handleSubmit} className="p-2 flex flex-col gap-2">
<Field type="date"
name="date"
@@ -38,7 +39,7 @@ const AddRainfall: FC<AddRainfallProps> = ({reload}) => {
value={value}
onChange={event => setValue(Number(event.target.value))}>Mesure</Field>
<button type="submit" className="mt-2 px-2 py-1 w-full text-lg font-bold bg-blue-700 rounded">Valider</button>
<button type="submit" className="btn-primary mt-2 w-full text-lg font-bold">Valider</button>
</form>
</Card>
}