Improve a lot the signup/login page
This commit is contained in:
parent
cf5d395de0
commit
46ccdf6666
8 changed files with 1833 additions and 308 deletions
BIN
ui/public/icon.png
Normal file
BIN
ui/public/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
BIN
ui/public/logo_white.png
Normal file
BIN
ui/public/logo_white.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.5 KiB |
BIN
ui/src/assets/icon.png
Normal file
BIN
ui/src/assets/icon.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 84 KiB |
282
ui/src/components/AnimatedBackground.tsx
Normal file
282
ui/src/components/AnimatedBackground.tsx
Normal file
|
|
@ -0,0 +1,282 @@
|
|||
export const AnimatedBackground = () => {
|
||||
return (
|
||||
<div className="absolute inset-0 pointer-events-none overflow-hidden">
|
||||
{/* Horizontal moving logos */}
|
||||
<div className="absolute top-1/4 left-0 animate-move-right-slow opacity-4 dark:opacity-8">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-16 h-16 object-contain animate-spin-slow block dark:hidden"
|
||||
/>
|
||||
<img
|
||||
src="/logo_white.png"
|
||||
alt="Xtablo"
|
||||
className="w-16 h-16 object-contain animate-spin-slow hidden dark:block"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-1/3 left-0 animate-move-right-medium opacity-3 dark:opacity-6">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-12 h-12 object-contain animate-bounce-gentle block dark:hidden"
|
||||
/>
|
||||
<img
|
||||
src="/logo_white.png"
|
||||
alt="Xtablo"
|
||||
className="w-12 h-12 object-contain animate-bounce-gentle hidden dark:block"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-1/2 left-0 animate-move-right-fast opacity-5 dark:opacity-10">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-20 h-20 object-contain animate-pulse-gentle block dark:hidden"
|
||||
/>
|
||||
<img
|
||||
src="/logo_white.png"
|
||||
alt="Xtablo"
|
||||
className="w-20 h-20 object-contain animate-pulse-gentle hidden dark:block"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-2/3 left-0 animate-move-right-slow opacity-2 dark:opacity-4">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-14 h-14 object-contain animate-wiggle block dark:hidden"
|
||||
/>
|
||||
<img
|
||||
src="/logo_white.png"
|
||||
alt="Xtablo"
|
||||
className="w-14 h-14 object-contain animate-wiggle hidden dark:block"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-3/4 left-0 animate-move-right-medium opacity-3 dark:opacity-7">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-18 h-18 object-contain animate-float-gentle"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Diagonal moving logos */}
|
||||
<div className="absolute top-0 left-1/4 animate-move-diagonal-1 opacity-3 dark:opacity-6">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-10 h-10 object-contain animate-spin-reverse"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-0 left-1/2 animate-move-diagonal-2 opacity-4 dark:opacity-8">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-16 h-16 object-contain animate-scale-gentle"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-0 left-3/4 animate-move-diagonal-3 opacity-2 dark:opacity-5">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-12 h-12 object-contain animate-rotate-gentle"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Vertical moving logos */}
|
||||
<div className="absolute left-1/6 top-0 animate-move-down-slow opacity-3 dark:opacity-6">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-14 h-14 object-contain animate-bounce-soft"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute left-5/6 top-0 animate-move-down-medium opacity-4 dark:opacity-7">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-16 h-16 object-contain animate-sway"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Circular moving logos */}
|
||||
<div className="absolute top-1/2 left-1/2 animate-orbit-1 opacity-2 dark:opacity-4">
|
||||
<img src="/icon.png" alt="Xtablo" className="w-8 h-8 object-contain" />
|
||||
</div>
|
||||
<div className="absolute top-1/2 left-1/2 animate-orbit-2 opacity-3 dark:opacity-5">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-10 h-10 object-contain"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-1/2 left-1/2 animate-orbit-3 opacity-2 dark:opacity-4">
|
||||
<img src="/icon.png" alt="Xtablo" className="w-6 h-6 object-contain" />
|
||||
</div>
|
||||
<div className="absolute top-1/2 left-1/2 animate-orbit-4 opacity-3 dark:opacity-6">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-12 h-12 object-contain animate-spin-fast"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-1/2 left-1/2 animate-orbit-5 opacity-2 dark:opacity-5">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-7 h-7 object-contain animate-pulse-fast"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Zigzag moving logos */}
|
||||
<div className="absolute top-1/4 left-0 animate-zigzag-1 opacity-4 dark:opacity-8">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-14 h-14 object-contain animate-wobble"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-1/2 left-0 animate-zigzag-2 opacity-3 dark:opacity-6">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-11 h-11 object-contain animate-shake"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-3/4 left-0 animate-zigzag-3 opacity-5 dark:opacity-9">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-16 h-16 object-contain animate-bounce-crazy"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Spiral moving logos */}
|
||||
<div className="absolute top-0 left-1/4 animate-spiral-1 opacity-3 dark:opacity-7">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-9 h-9 object-contain animate-spin-wobble"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-0 left-3/4 animate-spiral-2 opacity-4 dark:opacity-8">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-13 h-13 object-contain animate-flip"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Random floating logos */}
|
||||
<div className="absolute top-1/6 left-1/3 animate-float-random-1 opacity-2 dark:opacity-5">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-8 h-8 object-contain animate-twirl"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-1/3 left-2/3 animate-float-random-2 opacity-3 dark:opacity-6">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-10 h-10 object-contain animate-dance"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-2/3 left-1/4 animate-float-random-3 opacity-4 dark:opacity-7">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-12 h-12 object-contain animate-jiggle"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-5/6 left-3/4 animate-float-random-4 opacity-2 dark:opacity-4">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-9 h-9 object-contain animate-vibrate"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Wave pattern logos */}
|
||||
<div className="absolute top-1/8 left-0 animate-wave-1 opacity-3 dark:opacity-6">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-11 h-11 object-contain animate-swing"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-3/8 left-0 animate-wave-2 opacity-4 dark:opacity-8">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-13 h-13 object-contain animate-pendulum"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-5/8 left-0 animate-wave-3 opacity-2 dark:opacity-5">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-10 h-10 object-contain animate-elastic"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-7/8 left-0 animate-wave-4 opacity-5 dark:opacity-9">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-15 h-15 object-contain animate-rubber"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Corner shooters */}
|
||||
<div className="absolute top-0 left-0 animate-corner-shoot-1 opacity-3 dark:opacity-7">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-12 h-12 object-contain animate-rocket"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-0 right-0 animate-corner-shoot-2 opacity-4 dark:opacity-8">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-14 h-14 object-contain animate-comet"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute bottom-0 left-0 animate-corner-shoot-3 opacity-2 dark:opacity-5">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-10 h-10 object-contain animate-meteor"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute bottom-0 right-0 animate-corner-shoot-4 opacity-5 dark:opacity-10">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-16 h-16 object-contain animate-blast"
|
||||
/>
|
||||
</div>
|
||||
|
||||
{/* Bouncing balls */}
|
||||
<div className="absolute top-1/5 left-1/5 animate-bounce-ball-1 opacity-4 dark:opacity-8">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-8 h-8 object-contain animate-spin-bounce"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-2/5 left-4/5 animate-bounce-ball-2 opacity-3 dark:opacity-6">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-11 h-11 object-contain animate-flip-bounce"
|
||||
/>
|
||||
</div>
|
||||
<div className="absolute top-4/5 left-2/5 animate-bounce-ball-3 opacity-5 dark:opacity-9">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-13 h-13 object-contain animate-scale-bounce"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
1121
ui/src/main.css
1121
ui/src/main.css
File diff suppressed because it is too large
Load diff
|
|
@ -6,6 +6,9 @@ import { useLoginEmail } from "@ui/hooks/auth";
|
|||
import { Form } from "@ui/ui-library/form";
|
||||
import { LoginWithGoogle } from "@ui/components/BrandButtons/LoginWithGoogle";
|
||||
import { Link } from "react-router-dom";
|
||||
import { useTheme } from "@ui/contexts/ThemeContext";
|
||||
import { SunIcon, MoonIcon, MonitorIcon } from "lucide-react";
|
||||
import { AnimatedBackground } from "@ui/components/AnimatedBackground";
|
||||
|
||||
export function LoginPage() {
|
||||
const redirectUrl = localStorage.getItem("redirectUrl");
|
||||
|
|
@ -21,6 +24,32 @@ export function LoginPage() {
|
|||
password: "",
|
||||
});
|
||||
|
||||
// Theme
|
||||
const { theme, setTheme } = useTheme();
|
||||
|
||||
const toggleTheme = () => {
|
||||
if (theme === "light") {
|
||||
setTheme("dark");
|
||||
} else if (theme === "dark") {
|
||||
setTheme("system");
|
||||
} else {
|
||||
setTheme("light");
|
||||
}
|
||||
};
|
||||
|
||||
const getThemeIcon = () => {
|
||||
switch (theme) {
|
||||
case "light":
|
||||
return <SunIcon className="w-5 h-5" />;
|
||||
case "dark":
|
||||
return <MoonIcon className="w-5 h-5" />;
|
||||
case "system":
|
||||
return <MonitorIcon className="w-5 h-5" />;
|
||||
default:
|
||||
return <SunIcon className="w-5 h-5" />;
|
||||
}
|
||||
};
|
||||
|
||||
const onSubmit = (e: React.FormEvent) => {
|
||||
e.preventDefault();
|
||||
login({
|
||||
|
|
@ -30,128 +59,155 @@ export function LoginPage() {
|
|||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-100 via-blue-50 to-white dark:bg-gradient-to-br dark:from-slate-900 dark:via-blue-950 dark:via-blue-900 dark:to-blue-800">
|
||||
<div className="min-h-screen flex items-center justify-center bg-gradient-to-br from-purple-100 via-purple-50 to-white dark:bg-gradient-to-br dark:from-gray-900 dark:via-slate-900 dark:via-gray-800 dark:to-slate-800 animate-gradient-x bg-[length:400%_400%] relative overflow-hidden">
|
||||
<AnimatedBackground />
|
||||
<div
|
||||
className={twMerge(
|
||||
"w-full max-w-lg p-8 bg-white dark:bg-slate-800/50 backdrop-blur-lg rounded-2xl",
|
||||
"border border-blue-200 dark:border-blue-900/30",
|
||||
"shadow-xl"
|
||||
"w-full max-w-lg rounded-2xl animate-border-light",
|
||||
"shadow-2xl shadow-purple-500/10 dark:shadow-black/30"
|
||||
)}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<div className="mb-6">
|
||||
<Link
|
||||
to="/landing"
|
||||
className="inline-flex items-center text-sm text-slate-600 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200 transition-colors"
|
||||
>
|
||||
<svg
|
||||
className="w-4 h-4 mr-2"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
<div className="relative w-full h-full p-8 bg-white/80 dark:bg-slate-900/80 backdrop-blur-md rounded-2xl border border-purple-200 dark:border-purple-400/30 z-10">
|
||||
<div className="mb-6 flex items-center justify-between">
|
||||
<a
|
||||
href="https://www.xtablo.com"
|
||||
className="inline-flex items-center text-sm text-slate-600 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200 transition-colors"
|
||||
>
|
||||
<path
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth={2}
|
||||
d="M15 19l-7-7 7-7"
|
||||
/>
|
||||
</svg>
|
||||
Retour à l'accueil
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<h1 className="text-3xl font-bold text-slate-900 dark:text-white mb-8 text-center">
|
||||
Se connecter
|
||||
</h1>
|
||||
|
||||
<div className="space-y-4 flex flex-col items-center">
|
||||
<Form
|
||||
className="space-y-4 w-95 max-w-md mx-auto"
|
||||
onSubmit={onSubmit}
|
||||
validationErrors={errors}
|
||||
>
|
||||
<TextField isRequired name="email">
|
||||
<Label>
|
||||
Email <span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="email"
|
||||
value={formData.email}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, email: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField>
|
||||
|
||||
<TextField isRequired name="password">
|
||||
<Label>
|
||||
Mot de passe <span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="password"
|
||||
value={formData.password}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, password: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField>
|
||||
|
||||
<div className="flex items-center justify-between">
|
||||
<Link to="/reset-password">
|
||||
<a className="text-sm text-blue-600 hover:text-blue-500">
|
||||
Mot de passe oublié ?
|
||||
</a>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<Button
|
||||
className={twMerge(
|
||||
"w-full bg-blue-700 text-white",
|
||||
"hover:bg-blue-600"
|
||||
)}
|
||||
type="submit"
|
||||
pendingLabel="Connexion..."
|
||||
>
|
||||
{isPending ? "Connexion..." : "Se connecter"}
|
||||
</Button>
|
||||
</Form>
|
||||
|
||||
<div className="relative my-6">
|
||||
<div className="absolute inset-0 flex items-center">
|
||||
<div className="w-full border-t border-slate-200 dark:border-slate-700"></div>
|
||||
</div>
|
||||
<div className="relative flex justify-center text-sm">
|
||||
<span
|
||||
className={twMerge(
|
||||
"px-4 py-1 bg-white dark:bg-slate-800",
|
||||
"text-slate-500 dark:text-slate-400",
|
||||
"text-sm font-medium",
|
||||
"rounded-full",
|
||||
"relative z-10",
|
||||
"before:absolute before:w-[100px] before:h-[1px] before:bg-slate-300 dark:before:bg-slate-600 before:left-[-110px] before:top-1/2",
|
||||
"after:absolute after:w-[100px] after:h-[1px] after:bg-slate-300 dark:after:bg-slate-600 after:right-[-110px] after:top-1/2"
|
||||
)}
|
||||
<svg
|
||||
className="w-4 h-4 mr-2"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
Ou continuer avec
|
||||
</span>
|
||||
</div>
|
||||
<path
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth={2}
|
||||
d="M15 19l-7-7 7-7"
|
||||
/>
|
||||
</svg>
|
||||
Retour à l'accueil
|
||||
</a>
|
||||
|
||||
{/* Theme Toggle */}
|
||||
<Button
|
||||
variant="plain"
|
||||
isIconOnly
|
||||
onPress={toggleTheme}
|
||||
className="text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200 p-2"
|
||||
aria-label={`Changer le thème (actuellement: ${theme})`}
|
||||
>
|
||||
{getThemeIcon()}
|
||||
</Button>
|
||||
</div>
|
||||
|
||||
<LoginWithGoogle />
|
||||
{/* Xtablo Icon */}
|
||||
<div className="flex justify-center mb-6">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-16 h-16 object-contain block dark:hidden"
|
||||
/>
|
||||
<img
|
||||
src="/logo_white.png"
|
||||
alt="Xtablo"
|
||||
className="w-16 h-16 object-contain hidden dark:block"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<p className="text-center text-sm text-slate-600 dark:text-slate-400">
|
||||
Pas encore de compte ?{" "}
|
||||
<Link to="/signup">
|
||||
<a className="text-blue-600 hover:text-blue-500 font-medium">
|
||||
S'inscrire
|
||||
</a>
|
||||
</Link>
|
||||
</p>
|
||||
<h1 className="text-3xl font-bold text-slate-900 dark:text-white mb-8 text-center">
|
||||
Se connecter à Xtablo
|
||||
</h1>
|
||||
|
||||
<div className="space-y-4 flex flex-col items-center">
|
||||
<Form
|
||||
className="space-y-4 w-95 max-w-md mx-auto"
|
||||
onSubmit={onSubmit}
|
||||
validationErrors={errors}
|
||||
>
|
||||
<TextField isRequired name="email">
|
||||
<Label>
|
||||
Email <span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="email"
|
||||
value={formData.email}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, email: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField>
|
||||
|
||||
<TextField isRequired name="password">
|
||||
<Label>
|
||||
Mot de passe <span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="password"
|
||||
value={formData.password}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, password: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField>
|
||||
|
||||
{/* <div className="flex items-center justify-between">
|
||||
<Link to="/reset-password">
|
||||
<a className="text-sm text-purple-600 hover:text-purple-500 dark:text-purple-400 dark:hover:text-purple-300">
|
||||
Mot de passe oublié ?
|
||||
</a>
|
||||
</Link>
|
||||
</div> */}
|
||||
|
||||
<Button
|
||||
className={twMerge(
|
||||
"w-full bg-black border-black text-white dark:bg-black dark:border-black dark:text-white",
|
||||
"hover:bg-gray-800 dark:hover:bg-gray-800 transition-colors"
|
||||
)}
|
||||
type="submit"
|
||||
pendingLabel="Connexion..."
|
||||
>
|
||||
{isPending ? "Connexion..." : "Se connecter"}
|
||||
</Button>
|
||||
</Form>
|
||||
|
||||
<div className="relative my-6">
|
||||
<div className="absolute inset-0 flex items-center">
|
||||
<div className="w-full border-t border-slate-200 dark:border-slate-700"></div>
|
||||
</div>
|
||||
<div className="relative flex justify-center text-sm">
|
||||
<span
|
||||
className={twMerge(
|
||||
"px-4 py-1 bg-white dark:bg-slate-800",
|
||||
"text-slate-500 dark:text-slate-400",
|
||||
"text-sm font-medium",
|
||||
"rounded-full",
|
||||
"relative z-10",
|
||||
"before:absolute before:w-[100px] before:h-[1px] before:bg-slate-300 dark:before:bg-slate-600 before:left-[-110px] before:top-1/2",
|
||||
"after:absolute after:w-[100px] after:h-[1px] after:bg-slate-300 dark:after:bg-slate-600 after:right-[-110px] after:top-1/2"
|
||||
)}
|
||||
>
|
||||
Ou continuer avec
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<LoginWithGoogle />
|
||||
|
||||
<p className="text-center text-sm text-slate-600 dark:text-slate-400">
|
||||
Pas encore de compte ?{" "}
|
||||
<Link to="/signup">
|
||||
<a className="text-black hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-300 font-medium text-sm px-2 py-1 rounded border-gray-300 dark:border-slate-600 hover:bg-gray-50 dark:hover:bg-slate-700 transition-colors">
|
||||
S'inscrire
|
||||
</a>
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -766,7 +766,7 @@ export const PlanningPage = () => {
|
|||
|
||||
<button
|
||||
onClick={() => setIsImportModalOpen(true)}
|
||||
className="w-full px-4 py-2 bg-purple-600 text-white rounded-lg hover:bg-purple-700 transition-colors font-medium shadow-sm mt-2 flex items-center justify-center space-x-2"
|
||||
className="w-full px-4 py-2 bg-green-600 dark:bg-purple-600 text-white rounded-lg hover:bg-green-700 dark:hover:bg-purple-700 transition-colors font-medium shadow-sm mt-2 flex items-center justify-center space-x-2"
|
||||
>
|
||||
<FolderInputIcon className="w-5 h-5 mr-2" />
|
||||
<span className="text-sm">Importer un planning</span>
|
||||
|
|
|
|||
|
|
@ -7,6 +7,9 @@ import { useSignUp } from "@ui/hooks/auth";
|
|||
import { Form } from "@ui/ui-library/form";
|
||||
import { Text } from "@ui/ui-library/text";
|
||||
import { LoginWithGoogle } from "@ui/components/BrandButtons/LoginWithGoogle";
|
||||
import { AnimatedBackground } from "@ui/components/AnimatedBackground";
|
||||
import { useTheme } from "@ui/contexts/ThemeContext";
|
||||
import { SunIcon, MoonIcon, MonitorIcon } from "lucide-react";
|
||||
|
||||
export function SignUpPage() {
|
||||
const navigate = useNavigate();
|
||||
|
|
@ -26,14 +29,40 @@ export function SignUpPage() {
|
|||
business_name: "",
|
||||
});
|
||||
|
||||
// Theme
|
||||
const { theme, setTheme } = useTheme();
|
||||
|
||||
const toggleTheme = () => {
|
||||
if (theme === "light") {
|
||||
setTheme("dark");
|
||||
} else if (theme === "dark") {
|
||||
setTheme("system");
|
||||
} else {
|
||||
setTheme("light");
|
||||
}
|
||||
};
|
||||
|
||||
const getThemeIcon = () => {
|
||||
switch (theme) {
|
||||
case "light":
|
||||
return <SunIcon className="w-5 h-5" />;
|
||||
case "dark":
|
||||
return <MoonIcon className="w-5 h-5" />;
|
||||
case "system":
|
||||
return <MonitorIcon className="w-5 h-5" />;
|
||||
default:
|
||||
return <SunIcon className="w-5 h-5" />;
|
||||
}
|
||||
};
|
||||
|
||||
const validateForm = () => {
|
||||
const errors: Record<string, string> = {};
|
||||
|
||||
// Business name validation
|
||||
if (formData.business_name.length < 3) {
|
||||
errors.business_name =
|
||||
"Le nom de l'entreprise doit contenir au moins 3 caractères";
|
||||
}
|
||||
// // Business name validation
|
||||
// if (formData.business_name.length < 3) {
|
||||
// errors.business_name =
|
||||
// "Le nom de l'entreprise doit contenir au moins 3 caractères";
|
||||
// }
|
||||
|
||||
// Password length validation
|
||||
if (formData.password.length < 8) {
|
||||
|
|
@ -75,212 +104,249 @@ export function SignUpPage() {
|
|||
|
||||
return (
|
||||
<div
|
||||
className="min-h-screen flex items-center justify-center bg-gradient-to-br from-blue-100 via-blue-50 to-white dark:bg-gradient-to-br dark:from-slate-900 dark:via-blue-950 dark:via-blue-900 dark:to-blue-800"
|
||||
className="min-h-screen flex items-center justify-center bg-gradient-to-br from-purple-100 via-purple-50 to-white dark:bg-gradient-to-br dark:from-gray-900 dark:via-slate-900 dark:via-gray-800 dark:to-slate-800 animate-gradient-x bg-[length:400%_400%] relative overflow-hidden"
|
||||
onClick={() => navigate("/")}
|
||||
>
|
||||
<AnimatedBackground />
|
||||
<div
|
||||
className={twMerge(
|
||||
"w-full max-w-xl p-8 bg-white dark:bg-slate-800/50 backdrop-blur-lg rounded-2xl",
|
||||
"border border-blue-200 dark:border-blue-900/30",
|
||||
"shadow-xl"
|
||||
"w-full max-w-xl rounded-2xl animate-border-light",
|
||||
"shadow-2xl shadow-purple-500/10 dark:shadow-black/30"
|
||||
)}
|
||||
onClick={(e) => e.stopPropagation()}
|
||||
>
|
||||
<div className="mb-6">
|
||||
<Link
|
||||
to="/landing"
|
||||
className="inline-flex items-center text-sm text-slate-600 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200 transition-colors"
|
||||
>
|
||||
<svg
|
||||
className="w-4 h-4 mr-2"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
<div className="relative w-full h-full p-6 bg-white/80 dark:bg-slate-900/80 backdrop-blur-md rounded-2xl border border-purple-200 dark:border-purple-400/30 z-10">
|
||||
<div className="mb-4 flex items-center justify-between">
|
||||
<a
|
||||
href="https://www.xtablo.com"
|
||||
className="inline-flex items-center text-sm text-slate-600 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200 transition-colors"
|
||||
>
|
||||
<path
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth={2}
|
||||
d="M15 19l-7-7 7-7"
|
||||
/>
|
||||
</svg>
|
||||
Retour à l'accueil
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
<h1 className="text-3xl font-bold text-slate-900 dark:text-white mb-8 text-center">
|
||||
Créer un compte
|
||||
</h1>
|
||||
|
||||
<div className="space-y-4 flex flex-col items-center">
|
||||
<Form
|
||||
className="space-y-4 w-full"
|
||||
onSubmit={onSubmit}
|
||||
validationErrors={errors}
|
||||
>
|
||||
<div className="grid grid-cols-2 gap-4">
|
||||
<TextField isRequired name="first_name">
|
||||
<Label>
|
||||
Prénom <span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="text"
|
||||
value={formData.first_name}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, first_name: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField>
|
||||
<TextField isRequired name="last_name">
|
||||
<Label>
|
||||
Nom <span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="text"
|
||||
value={formData.last_name}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, last_name: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField>
|
||||
</div>
|
||||
|
||||
<TextField isRequired name="business_name">
|
||||
<Label>
|
||||
Nom de l'entreprise <span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="text"
|
||||
value={formData.business_name}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, business_name: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField>
|
||||
|
||||
<TextField isRequired name="email">
|
||||
<Label>
|
||||
Email professionnel <span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="email"
|
||||
value={formData.email}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, email: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField>
|
||||
|
||||
<TextField isRequired name="password">
|
||||
<Label>
|
||||
Mot de passe <span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="password"
|
||||
value={formData.password}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, password: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
{!errors.password && (
|
||||
<Text slot="description" className="text-red-500">
|
||||
{errors.password}
|
||||
</Text>
|
||||
)}
|
||||
</TextField>
|
||||
|
||||
<TextField isRequired name="confirmPassword">
|
||||
<Label>
|
||||
Confirmer le mot de passe{" "}
|
||||
<span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="password"
|
||||
value={formData.confirmPassword}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, confirmPassword: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField>
|
||||
|
||||
<TextField className="flex items-start">
|
||||
<Input
|
||||
type="checkbox"
|
||||
id="terms"
|
||||
className="mt-1 mr-2 h-4 w-4 text-blue-600 focus:ring-blue-500 border-slate-300 rounded"
|
||||
required
|
||||
/>
|
||||
<Label
|
||||
htmlFor="terms"
|
||||
className="text-sm text-slate-700 dark:text-slate-300"
|
||||
<svg
|
||||
className="w-4 h-4 mr-2"
|
||||
fill="none"
|
||||
stroke="currentColor"
|
||||
viewBox="0 0 24 24"
|
||||
>
|
||||
J'accepte les{" "}
|
||||
<a href="#" className="text-blue-600 hover:text-blue-500">
|
||||
conditions d'utilisation
|
||||
</a>{" "}
|
||||
et la{" "}
|
||||
<a href="#" className="text-blue-600 hover:text-blue-500">
|
||||
politique de confidentialité
|
||||
</a>
|
||||
</Label>
|
||||
</TextField>
|
||||
<path
|
||||
strokeLinecap="round"
|
||||
strokeLinejoin="round"
|
||||
strokeWidth={2}
|
||||
d="M15 19l-7-7 7-7"
|
||||
/>
|
||||
</svg>
|
||||
Retour à l'accueil
|
||||
</a>
|
||||
|
||||
{/* Theme Toggle */}
|
||||
<Button
|
||||
className={twMerge(
|
||||
"w-full bg-blue-700 text-white",
|
||||
"hover:bg-blue-600"
|
||||
)}
|
||||
type="submit"
|
||||
isPending={isPending}
|
||||
pendingLabel="Création du compte..."
|
||||
variant="plain"
|
||||
isIconOnly
|
||||
onPress={toggleTheme}
|
||||
className="text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200 p-2"
|
||||
aria-label={`Changer le thème (actuellement: ${theme})`}
|
||||
>
|
||||
{isPending ? "Création du compte..." : "Créer mon compte"}
|
||||
{getThemeIcon()}
|
||||
</Button>
|
||||
</Form>
|
||||
|
||||
<div className="relative my-6">
|
||||
<div className="absolute inset-0 flex items-center">
|
||||
<div className="w-full border-t border-slate-200 dark:border-slate-700"></div>
|
||||
</div>
|
||||
<div className="relative flex justify-center text-sm">
|
||||
<span
|
||||
className={twMerge(
|
||||
"px-4 py-1 bg-white dark:bg-slate-800",
|
||||
"text-slate-500 dark:text-slate-400",
|
||||
"text-sm font-medium",
|
||||
"rounded-full",
|
||||
"relative z-10",
|
||||
"before:absolute before:w-[100px] before:h-[1px] before:bg-slate-300 dark:before:bg-slate-600 before:left-[-110px] before:top-1/2",
|
||||
"after:absolute after:w-[100px] after:h-[1px] after:bg-slate-300 dark:after:bg-slate-600 after:right-[-110px] after:top-1/2"
|
||||
)}
|
||||
>
|
||||
Ou continuer avec
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<LoginWithGoogle />
|
||||
{/* Xtablo Icon */}
|
||||
<div className="flex justify-center mb-4">
|
||||
<img
|
||||
src="/icon.png"
|
||||
alt="Xtablo"
|
||||
className="w-12 h-12 object-contain block dark:hidden"
|
||||
/>
|
||||
<img
|
||||
src="/logo_white.png"
|
||||
alt="Xtablo"
|
||||
className="w-12 h-12 object-contain hidden dark:block"
|
||||
/>
|
||||
</div>
|
||||
|
||||
<p className="text-center text-sm text-slate-600 dark:text-slate-400">
|
||||
Déjà un compte ?{" "}
|
||||
<Link to="/login">
|
||||
<a className="text-blue-600 hover:text-blue-500 font-medium">
|
||||
Se connecter
|
||||
</a>
|
||||
</Link>
|
||||
</p>
|
||||
<h1 className="text-2xl font-bold text-slate-900 dark:text-white mb-6 text-center">
|
||||
Créer un compte Xtablo
|
||||
</h1>
|
||||
|
||||
<div className="space-y-3 flex flex-col items-center">
|
||||
<Form
|
||||
className="space-y-3 w-full"
|
||||
onSubmit={onSubmit}
|
||||
validationErrors={errors}
|
||||
>
|
||||
<div className="grid grid-cols-2 gap-3">
|
||||
<TextField isRequired name="first_name">
|
||||
<Label className="text-sm">
|
||||
Prénom <span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="text"
|
||||
value={formData.first_name}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, first_name: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField>
|
||||
<TextField isRequired name="last_name">
|
||||
<Label className="text-sm">
|
||||
Nom <span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="text"
|
||||
value={formData.last_name}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, last_name: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField>
|
||||
</div>
|
||||
|
||||
{/* <TextField isRequired name="business_name">
|
||||
<Label>
|
||||
Nom de l'entreprise{" "}
|
||||
<span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="text"
|
||||
value={formData.business_name}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, business_name: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField> */}
|
||||
|
||||
<TextField isRequired name="email">
|
||||
<Label className="text-sm">
|
||||
Email professionnel <span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="email"
|
||||
value={formData.email}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, email: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField>
|
||||
|
||||
<TextField isRequired name="password">
|
||||
<Label className="text-sm">
|
||||
Mot de passe <span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="password"
|
||||
value={formData.password}
|
||||
onChange={(e) =>
|
||||
setFormData({ ...formData, password: e.target.value })
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
{!errors.password && (
|
||||
<Text slot="description" className="text-red-500">
|
||||
{errors.password}
|
||||
</Text>
|
||||
)}
|
||||
</TextField>
|
||||
|
||||
<TextField isRequired name="confirmPassword">
|
||||
<Label className="text-sm">
|
||||
Confirmer le mot de passe{" "}
|
||||
<span className="text-red-500">*</span>
|
||||
</Label>
|
||||
<Input
|
||||
type="password"
|
||||
value={formData.confirmPassword}
|
||||
onChange={(e) =>
|
||||
setFormData({
|
||||
...formData,
|
||||
confirmPassword: e.target.value,
|
||||
})
|
||||
}
|
||||
required
|
||||
/>
|
||||
<FieldError />
|
||||
</TextField>
|
||||
|
||||
<TextField className="flex items-start">
|
||||
<Input
|
||||
type="checkbox"
|
||||
id="terms"
|
||||
className="mt-1 mr-2 h-4 w-4 text-blue-600 focus:ring-blue-500 border-slate-300 rounded"
|
||||
required
|
||||
/>
|
||||
<Label
|
||||
htmlFor="terms"
|
||||
className="text-xs text-slate-600 dark:text-slate-300"
|
||||
>
|
||||
J'accepte les{" "}
|
||||
<a
|
||||
href="#"
|
||||
className="text-black hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-300"
|
||||
>
|
||||
conditions d'utilisation
|
||||
</a>{" "}
|
||||
et la{" "}
|
||||
<a
|
||||
href="#"
|
||||
className="text-black hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-300"
|
||||
>
|
||||
politique de confidentialité
|
||||
</a>
|
||||
</Label>
|
||||
</TextField>
|
||||
|
||||
<Button
|
||||
className={twMerge(
|
||||
"w-full bg-black border-black text-white dark:bg-black dark:border-black dark:text-white",
|
||||
"hover:bg-gray-800 dark:hover:bg-gray-800 transition-colors"
|
||||
)}
|
||||
type="submit"
|
||||
isPending={isPending}
|
||||
pendingLabel="Création du compte..."
|
||||
>
|
||||
{isPending ? "Création du compte..." : "Créer mon compte"}
|
||||
</Button>
|
||||
</Form>
|
||||
|
||||
<div className="relative my-4">
|
||||
<div className="absolute inset-0 flex items-center">
|
||||
<div className="w-full border-t border-slate-200 dark:border-slate-700"></div>
|
||||
</div>
|
||||
<div className="relative flex justify-center text-sm">
|
||||
<span
|
||||
className={twMerge(
|
||||
"px-3 py-1 bg-white dark:bg-slate-800",
|
||||
"text-slate-500 dark:text-slate-400",
|
||||
"text-xs font-medium",
|
||||
"rounded-full",
|
||||
"relative z-10",
|
||||
"before:absolute before:w-[100px] before:h-[1px] before:bg-slate-300 dark:before:bg-slate-600 before:left-[-110px] before:top-1/2",
|
||||
"after:absolute after:w-[100px] after:h-[1px] after:bg-slate-300 dark:after:bg-slate-600 after:right-[-110px] after:top-1/2"
|
||||
)}
|
||||
>
|
||||
Ou continuer avec
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<LoginWithGoogle />
|
||||
|
||||
<p className="text-center text-xs text-slate-600 dark:text-slate-400">
|
||||
Déjà un compte ?{" "}
|
||||
<Link to="/login">
|
||||
<a className="text-black hover:text-gray-800 dark:text-gray-400 dark:hover:text-gray-300 font-medium text-sm px-2 py-1 rounded border-gray-300 dark:border-slate-600 hover:bg-gray-50 dark:hover:bg-slate-700 transition-colors">
|
||||
Se connecter
|
||||
</a>
|
||||
</Link>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
|
|
|||
Loading…
Reference in a new issue