Skip to content

Commit da6a193

Browse files
authored
Merge pull request #39 from WildCodeSchool/tv
Tv
2 parents 7901178 + 200f2f5 commit da6a193

File tree

94 files changed

+4844
-622
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

94 files changed

+4844
-622
lines changed

package-lock.json

Lines changed: 1740 additions & 28 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
"scripts": {
77
"dev": "vite",
88
"build": "tsc -b && vite build",
9+
"test": "vitest",
910
"lint": "eslint .",
1011
"preview": "vite preview",
1112
"start:docker": "docker-compose pull && docker-compose up"
@@ -16,13 +17,15 @@
1617
"@graphql-codegen/typescript-operations": "^4.6.0",
1718
"@graphql-codegen/typescript-react-apollo": "^4.3.2",
1819
"@hookform/resolvers": "^5.2.1",
19-
"@radix-ui/react-dropdown-menu": "^2.1.16",
20+
"@radix-ui/react-alert-dialog": "^1.1.15",
2021
"@radix-ui/react-checkbox": "^1.3.3",
22+
"@radix-ui/react-dropdown-menu": "^2.1.16",
2123
"@radix-ui/react-label": "^2.1.7",
2224
"@radix-ui/react-popover": "^1.1.15",
2325
"@radix-ui/react-scroll-area": "^1.2.10",
2426
"@radix-ui/react-slot": "^1.2.3",
2527
"@radix-ui/react-tabs": "^1.1.12",
28+
"@radix-ui/react-toast": "^1.2.15",
2629
"@radix-ui/react-tooltip": "^1.2.7",
2730
"@tailwindcss/vite": "^4.1.11",
2831
"@tanstack/react-table": "^8.21.3",
@@ -32,34 +35,41 @@
3235
"graphql": "^16.10.0",
3336
"lucide-react": "^0.534.0",
3437
"qrcode.react": "^4.2.0",
35-
"react": "^19.0.0",
38+
"react": "^19.1.1",
3639
"react-dom": "^19.0.0",
3740
"react-hook-form": "^7.62.0",
3841
"react-icons": "^5.5.0",
3942
"react-qr-code": "^2.0.18",
4043
"react-router": "^7.7.1",
4144
"react-router-dom": "^7.5.0",
45+
"sonner": "^2.0.7",
4246
"tailwind-merge": "^3.3.1",
4347
"yup": "^1.7.0"
4448
},
4549
"devDependencies": {
4650
"@eslint/js": "^9.22.0",
4751
"@graphql-codegen/cli": "^5.0.5",
52+
"@testing-library/jest-dom": "^6.8.0",
53+
"@testing-library/react": "^16.3.0",
54+
"@testing-library/user-event": "^14.6.1",
4855
"@types/node": "^24.1.0",
49-
"@types/react": "^19.0.10",
56+
"@types/react": "^19.1.16",
5057
"@types/react-dom": "^19.0.4",
5158
"@types/react-router-dom": "^5.3.3",
59+
"@types/testing-library__jest-dom": "^5.14.9",
5260
"@vitejs/plugin-react": "^4.3.4",
5361
"autoprefixer": "^10.4.21",
5462
"eslint": "^9.22.0",
5563
"eslint-plugin-react-hooks": "^5.2.0",
5664
"eslint-plugin-react-refresh": "^0.4.19",
5765
"globals": "^16.0.0",
66+
"jsdom": "^26.1.0",
5867
"postcss": "^8.5.3",
5968
"tailwindcss": "^4.1.11",
6069
"tw-animate-css": "^1.3.6",
6170
"typescript": "~5.7.2",
6271
"typescript-eslint": "^8.26.1",
63-
"vite": "^6.3.0"
72+
"vite": "^6.3.0",
73+
"vitest": "^3.2.4"
6474
}
6575
}

src/common/.gitkeep

Whitespace-only changes.
Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,23 @@
11
import company from "../../assets/company.png";
2-
import logoWhite from "../../assets/nextone-white.png"
2+
import logoWhite from "../../assets/nextone-white.png";
33

44
function CompanyIllustration() {
55
return (
6-
<div className="hidden p-4 md:flex w-full md:w-1/2 bg-white items-start justify-center mt-4 md:mt-[10px]">
7-
<div className="relative max-h-[90%] w-full md:w-auto rounded-lg overflow-hidden">
8-
<img src={company} alt="image-entreprise" className="w-full h-auto object-cover" style={{ aspectRatio: "4 / 5" }}/>
6+
<div className="hidden md:flex w-full md:w-1/2 h-screen p-8">
7+
<div className="relative w-full h-full rounded-lg overflow-hidden">
8+
<img src={company} alt="image-entreprise" className="w-full h-full object-cover"/>
99
<span className="absolute bottom-2 right-2 px-2 py-1 rounded flex items-center gap-2 text-white">
10-
<img src={logoWhite} alt="logo NextOne" className="w-8 h-10 md:w-9 md:h-11" />
11-
<div>
10+
<img src={logoWhite} alt="logo NextOne" className="w-8 h-10 md:w-9 md:h-11"/>
11+
<div className="text-left">
1212
<p className="text-[8px] md:text-[10px] leading-none">Powered by</p>
13-
<p className="font-semibold text-[20px] md:text-[24px] leading-none">NextOne</p>
13+
<p className="font-semibold text-[20px] md:text-[24px] leading-none">
14+
NextOne
15+
</p>
1416
</div>
1517
</span>
1618
</div>
1719
</div>
1820
);
1921
}
2022

21-
2223
export default CompanyIllustration;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import { Button } from "../../components/ui/button";
2+
3+
export type StepControlsProps = {
4+
onBack?: () => void;
5+
onNext?: () => void;
6+
onCancel?: () => void;
7+
updateTicket?: () => void;
8+
};
9+
10+
function NavigationActions({ onBack, onNext, onCancel, updateTicket }: StepControlsProps) {
11+
const handleNext = () => {
12+
updateTicket?.();
13+
onNext?.();
14+
};
15+
16+
const handleBack = () => {
17+
updateTicket?.();
18+
onBack?.();
19+
};
20+
21+
return (
22+
<div className="flex w-full items-center justify-between mt-6">
23+
<div className="flex space-x-9">
24+
<Button type="button" onClick={handleBack} variant="ghost" className="text-primary text-[17px] p-6">
25+
Retour
26+
</Button>
27+
<Button type="submit" onClick={handleNext} className="text-[17px] p-6">
28+
Continuer
29+
</Button>
30+
</div>
31+
{onCancel && (
32+
<Button type="button" onClick={onCancel} variant="ghost" className="text-primary text-[17px] p-6">
33+
Annuler
34+
</Button>
35+
)}
36+
</div>
37+
);
38+
}
39+
40+
export default NavigationActions;

src/components/terminal/Stepper.tsx renamed to src/common/terminal/Stepper.tsx

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,18 @@
11
import { StepperProps } from "@/types/terminal";
22
import { clsx } from "clsx";
3+
import steps from "../../utils/constants/steps";
34

4-
const steps = [
5-
{ label: "Choix du service" },
6-
{ label: "Informations personnelles" },
7-
{ label: "Coordonnées" },
8-
];
9-
10-
interface StepperWithCancelProps extends StepperProps {
11-
onCancel?: () => void;
12-
}
13-
14-
function Stepper({ currentStep, onCancel }: StepperWithCancelProps) {
5+
function Stepper({ currentStep }: StepperProps) {
156
return (
16-
<div className="w-full mb-6">
7+
<div className="w-full">
178
<div className="flex justify-between items-center mb-3">
189
{steps.map((step, i) => {
1910
const stepNumber = i + 1;
2011
const isActive = stepNumber === currentStep;
2112
const isCompleted = stepNumber < currentStep;
2213
return (
2314
<div key={step.label} className="flex flex-col items-center">
24-
<div className={clsx( "w-8 h-8 rounded-full flex items-center justify-center border-2 z-10",
15+
<div data-testid={`step-circle-${stepNumber}`} className={clsx( "w-8 h-8 rounded-full flex items-center justify-center border-2 z-10",
2516
{ "bg-primary text-white border-primary": isActive || isCompleted,
2617
"bg-white text-gray-400 border-gray-300": !isActive && !isCompleted,
2718
})}>
@@ -36,15 +27,8 @@ function Stepper({ currentStep, onCancel }: StepperWithCancelProps) {
3627
)})}
3728
</div>
3829
<div className="h-1 bg-gray-300 rounded-full">
39-
<div className="h-1 bg-primary rounded-full transition-all duration-300" style={{ width: `${(currentStep / steps.length) * 100}%` }}/>
30+
<div className="h-1 bg-primary rounded-full transition-all duration-300" role="progressbar" style={{ width: `${(currentStep / steps.length) * 100}%` }}/>
4031
</div>
41-
{onCancel && (
42-
<div className="mt-4 flex justify-start">
43-
<button onClick={onCancel} className="px-5 py-2 rounded-full border-2 border-primary text-primary font-semibold hover:bg-primary hover:text-white transition-colors duration-300 shadow-sm">
44-
Annuler
45-
</button>
46-
</div>
47-
)}
4832
</div>
4933
);
5034
}

src/components/.gitkeep

Whitespace-only changes.

src/components/dashboard/.gitkeep

Whitespace-only changes.

src/components/dashboard/DashboardLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { MdRoomService } from "react-icons/md";
55
import { IoPerson } from "react-icons/io5";
66
import { LuLayoutDashboard } from "react-icons/lu";
77
import { IoIosSettings } from "react-icons/io";
8-
import { useAuth } from "@/context/AuthContext";
8+
import { useAuth } from "../../context/AuthContext";
99

1010
export type DashboardMenuItem = {
1111
name: string;

0 commit comments

Comments
 (0)