Skip to content

Commit f56d79d

Browse files
authored
Merge pull request #12 from EliasJHL/refactor/frontend
Refactor/frontend
2 parents 3c560be + bcabb10 commit f56d79d

File tree

16 files changed

+32
-26
lines changed

16 files changed

+32
-26
lines changed

frontend/src/app/RegisterPage.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import { RegisterForm } from '../features/auth/components/RegisterForm';
1212
export const RegisterPage = () => {
1313
const { t } = useTranslation();
1414

15+
if (!t) return null;
16+
1517
return (
1618
<AuthLayout
1719
title="Créer un compte"

frontend/src/components/layouts/Header.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ export const Header = () => {
1111
const { t } = useTranslation();
1212
const navigate = useNavigate();
1313

14+
if (!t) return null;
15+
1416
const isAuthenticated = false;
1517

1618
return (

frontend/src/components/ui/animated-beam.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
import { RefObject, useEffect, useId, useState } from "react"
1+
import { useEffect, useId, useState } from "react"
2+
import type { FC, RefObject } from "react"
23
import { motion } from "motion/react"
34

45
import { cn } from "@/lib/utils"
@@ -23,7 +24,7 @@ export interface AnimatedBeamProps {
2324
endYOffset?: number
2425
}
2526

26-
export const AnimatedBeam: React.FC<AnimatedBeamProps> = ({
27+
export const AnimatedBeam: FC<AnimatedBeamProps> = ({
2728
className,
2829
containerRef,
2930
fromRef,

frontend/src/components/ui/bento-grid.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ComponentPropsWithoutRef, ReactNode } from "react"
1+
import type { ComponentPropsWithoutRef, ElementType, ReactNode } from "react"
22
import { ArrowRightIcon } from "@radix-ui/react-icons"
33

44
import { cn } from "@/lib/utils"
@@ -13,7 +13,7 @@ interface BentoCardProps extends ComponentPropsWithoutRef<"div"> {
1313
name: string
1414
className: string
1515
background: ReactNode
16-
Icon: React.ElementType
16+
Icon: ElementType
1717
description: string
1818
href: string
1919
cta: string

frontend/src/components/ui/dock.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,14 @@
1-
import React, { PropsWithChildren, useRef } from "react"
1+
import React, { useRef } from "react"
2+
import type { PropsWithChildren } from "react"
23
import { cva, type VariantProps } from "class-variance-authority"
34
import {
45
motion,
5-
MotionValue,
66
useMotionValue,
77
useSpring,
88
useTransform,
99
} from "motion/react"
1010
import type { MotionProps } from "motion/react"
11+
import type { MotionValue } from "motion/react"
1112

1213
import { cn } from "@/lib/utils"
1314

frontend/src/components/ui/dot-pattern.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ export function DotPattern({
121121
<stop offset="100%" stopColor="currentColor" stopOpacity="0" />
122122
</radialGradient>
123123
</defs>
124-
{dots.map((dot, index) => (
124+
{dots.map((dot) => (
125125
<motion.circle
126126
key={`${dot.x}-${dot.y}`}
127127
cx={dot.x}

frontend/src/components/ui/highlighter.tsx

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ interface HighlighterProps {
2222
iterations?: number;
2323
padding?: number;
2424
multiline?: boolean;
25-
isView?: boolean;
2625
className?: string;
2726
}
2827

@@ -35,7 +34,6 @@ export function Highlighter({
3534
iterations = 2,
3635
padding = 2,
3736
multiline = true,
38-
isView = false,
3937
className,
4038
}: HighlighterProps) {
4139
const elementRef = useRef<HTMLSpanElement>(null);
@@ -115,4 +113,4 @@ export function Highlighter({
115113
<span className="relative z-10">{children}</span>
116114
</span>
117115
);
118-
}
116+
}

frontend/src/components/ui/marquee.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { ComponentPropsWithoutRef } from "react"
1+
import type { ComponentPropsWithoutRef, ReactNode } from "react"
22

33
import { cn } from "@/lib/utils"
44

@@ -20,7 +20,7 @@ interface MarqueeProps extends ComponentPropsWithoutRef<"div"> {
2020
/**
2121
* Content to be displayed in the marquee
2222
*/
23-
children: React.ReactNode
23+
children: ReactNode
2424
/**
2525
* Whether to animate vertically instead of horizontally
2626
* @default false

frontend/src/components/ui/particles.tsx

Lines changed: 4 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
1-
import React, {
2-
ComponentPropsWithoutRef,
3-
useEffect,
4-
useRef,
5-
useState,
6-
} from "react"
1+
import { useEffect, useRef, useState } from "react"
2+
import type { ComponentPropsWithoutRef, FC } from "react"
73

84
import { cn } from "@/lib/utils"
95

@@ -75,7 +71,7 @@ type Circle = {
7571
magnetism: number
7672
}
7773

78-
export const Particles: React.FC<ParticlesProps> = ({
74+
export const Particles: FC<ParticlesProps> = ({
7975
className = "",
8076
quantity = 100,
8177
staticity = 50,
@@ -96,7 +92,7 @@ export const Particles: React.FC<ParticlesProps> = ({
9692
const canvasSize = useRef<{ w: number; h: number }>({ w: 0, h: 0 })
9793
const dpr = typeof window !== "undefined" ? window.devicePixelRatio : 1
9894
const rafID = useRef<number | null>(null)
99-
const resizeTimeout = useRef<NodeJS.Timeout | null>(null)
95+
const resizeTimeout = useRef<ReturnType<typeof setTimeout> | null>(null)
10096

10197
useEffect(() => {
10298
if (canvasRef.current) {

frontend/src/features/auth/components/LoginForm.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ export const LoginForm = () => {
1717
const { t } = useTranslation();
1818
const { login, isLoading: loading } = useLogin();
1919

20+
if (!t) return null;
21+
2022
return (
2123
<div className="grid gap-6">
2224
<form onSubmit={handleSubmit(login)}>

0 commit comments

Comments
 (0)