Use tRPC and react-hook-form

This commit is contained in:
Timothy Armes
2023-09-11 10:28:02 +02:00
parent 7111f000e5
commit ac633670ab
42 changed files with 5490 additions and 587 deletions
-44
View File
@@ -1,44 +0,0 @@
import { useRef, useState } from "react";
import { useAtomValue } from "jotai";
import { LatLngLiteral } from "leaflet";
import { franceCenterAtom } from "@/app/atoms";
import { TournamentFormProps } from "@/types";
export const useTournamentForm = (): TournamentFormProps => {
const center = useAtomValue(franceCenterAtom);
const tournamentNameRef = useRef(null);
const dateRef = useRef(null);
const urlRef = useRef(null);
const timeControlRef = useRef(null);
const normRef = useRef(null);
const addressRef = useRef(null);
const townRef = useRef(null);
const departmentRef = useRef(null);
const countryRef = useRef(null);
const yourNameRef = useRef(null);
const yourEmailRef = useRef(null);
const messageRef = useRef(null);
const [position, setPosition] = useState<LatLngLiteral>(center);
return {
tournamentNameRef,
dateRef,
urlRef,
timeControlRef,
normRef,
addressRef,
townRef,
departmentRef,
countryRef,
yourNameRef,
yourEmailRef,
messageRef,
position,
setPosition,
};
};
export default useTournamentForm;