+ {body} +
) + ); +}) +FormMessage.displayName = "FormMessage" + +export { + useFormField, + Form, + FormItem, + FormLabel, + FormControl, + FormDescription, + FormMessage, + FormField, +} diff --git a/client/src/components/ui/input.jsx b/client/src/components/ui/input.jsx new file mode 100644 index 0000000000..688e459a86 --- /dev/null +++ b/client/src/components/ui/input.jsx @@ -0,0 +1,24 @@ +import * as React from "react" + +import { cn } from "@/lib/utils" + +const Input = React.forwardRef(({ className, type, ...props }, ref) => { + return ( + () + ); +}) +Input.displayName = "Input" + +export { Input } + + + + + + diff --git a/client/src/components/ui/inputwithlabel.jsx b/client/src/components/ui/inputwithlabel.jsx new file mode 100644 index 0000000000..78615156de --- /dev/null +++ b/client/src/components/ui/inputwithlabel.jsx @@ -0,0 +1,18 @@ +import { Input } from "@/components/ui/input" +import { Label } from "@/components/ui/label" + +export function InputWithLabel({label, type, dest, id, placeholder}) { + return ( +{date}
+vs
+{opponent}
+Sorry, an unexpected error has occurred.
++ {error.statusText || error.message} +
+Aucune page n'a pu être charger
+ ) +} + +export default NoPage; \ No newline at end of file diff --git a/client/src/pages/Register.jsx b/client/src/pages/Register.jsx new file mode 100644 index 0000000000..28d8cee5b8 --- /dev/null +++ b/client/src/pages/Register.jsx @@ -0,0 +1,134 @@ +import React, { useState, useEffect } from 'react'; +import axios from 'axios'; +import { Label } from "@/components/ui/label" +import { Input } from "@/components/ui/input" +import { Button } from "@/components/ui/button" + +import { Alert, AlertDescription, AlertTitle } from "@/components/ui/alert"; +import { Terminal } from "lucide-react" +import { useNavigate } from 'react-router-dom'; +import { SignUp } from "@clerk/clerk-react"; + +/* +const Register = () => { + const [name, setName] = useState(''); + const [email, setEmail] = useState(''); + const [password, setPassword] = useState(''); + const [message, setMessage] = useState(''); + + const navigate = useNavigate(); + + useEffect(() => { + const token = localStorage.getItem('token'); + if (token) { + navigate('/'); + } + }, []); + + const handleSubmit = async (e) => { + e.preventDefault(); + try { + const response = await axios.post("http://localhost:8000/users", { + name, + email, + password, + }); + setMessage("Inscription réussie"); + setName(''); + setEmail(''); + setPassword(''); + } catch (error) { + console.error(error.message); + setMessage("Erreur lors de l'inscription"); + } + }; + + return ( +