Skip to content

Commit e510b5f

Browse files
committed
feat(pages): add Home page with navigation and theme support
1 parent fcb38dd commit e510b5f

File tree

3 files changed

+150
-1
lines changed

3 files changed

+150
-1
lines changed

src/pages/Home.tsx

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
import { Button } from "@/components/ui/button";
2+
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@/components/ui/card";
3+
import { Badge } from "@/components/ui/badge";
4+
import { ArrowRight, Github, Globe, Mail, Shield } from "lucide-react";
5+
import { useNavigate } from "react-router-dom";
6+
import { useTheme } from "@/components/theme-provider";
7+
import { ModeToggle } from "@/components/mode-toggle";
8+
import { LanguageToggle } from "@/components/language-toggle";
9+
10+
export default function Home() {
11+
const navigate = useNavigate();
12+
const { theme } = useTheme();
13+
14+
const handleGoToManager = () => {
15+
navigate("/manager");
16+
};
17+
18+
return (
19+
<div className="min-h-screen bg-background">
20+
{/* Header with theme toggle */}
21+
<header className="flex items-center justify-between px-4 py-2">
22+
<div className="flex items-center">
23+
<img
24+
src={theme === "dark" ? "https://evolution-api.com/files/evo/evolution-logo-white.svg" : "https://evolution-api.com/files/evo/evolution-logo.svg"}
25+
alt="Evolution API Logo"
26+
className="h-8"
27+
/>
28+
</div>
29+
<div className="flex items-center gap-4">
30+
<LanguageToggle />
31+
<ModeToggle />
32+
</div>
33+
</header>
34+
35+
<div className="container mx-auto px-4 py-16">
36+
<div className="max-w-4xl mx-auto">
37+
{/* Header */}
38+
<div className="text-center mb-12">
39+
<div className="flex items-center justify-center mb-6">
40+
<img
41+
src={theme === "dark" ? "https://evolution-api.com/files/evo/evolution-logo-white.svg" : "https://evolution-api.com/files/evo/evolution-logo.svg"}
42+
alt="Evolution Manager Logo"
43+
className="h-10"
44+
/>
45+
</div>
46+
<h1 className="text-4xl font-bold text-foreground mb-4">
47+
Evolution Manager v2
48+
</h1>
49+
<p className="text-xl text-muted-foreground mb-6">
50+
Modern web interface for Evolution API management
51+
</p>
52+
<Badge variant="secondary" className="text-sm px-3 py-1">
53+
Version 2.0.0
54+
</Badge>
55+
</div>
56+
57+
{/* Main Card */}
58+
<Card className="mb-8">
59+
<CardHeader>
60+
<CardTitle className="flex items-center gap-2">
61+
<Shield className="w-5 h-5 text-primary" />
62+
Welcome to Evolution Manager
63+
</CardTitle>
64+
<CardDescription>
65+
A powerful, modern dashboard for managing your WhatsApp API instances with Evolution API
66+
</CardDescription>
67+
</CardHeader>
68+
<CardContent className="space-y-6">
69+
<div className="pt-6 border-t border-border">
70+
<div className="flex flex-col sm:flex-row gap-4 justify-center items-center">
71+
<Button
72+
onClick={handleGoToManager}
73+
size="lg"
74+
className="px-8 py-3"
75+
>
76+
Access Manager Dashboard
77+
<ArrowRight className="w-4 h-4 ml-2" />
78+
</Button>
79+
</div>
80+
</div>
81+
</CardContent>
82+
</Card>
83+
84+
{/* Links Card */}
85+
<Card>
86+
<CardHeader>
87+
<CardTitle>Resources & Support</CardTitle>
88+
<CardDescription>
89+
Get help, contribute, or learn more about Evolution API
90+
</CardDescription>
91+
</CardHeader>
92+
<CardContent>
93+
<div className="grid md:grid-cols-3 gap-4">
94+
<a
95+
href="https://github.com/EvolutionAPI/evolution-manager-v2"
96+
target="_blank"
97+
rel="noopener noreferrer"
98+
className="flex items-center gap-3 p-4 rounded-lg border border-border hover:bg-accent transition-colors"
99+
>
100+
<Github className="w-5 h-5 text-muted-foreground" />
101+
<div>
102+
<div className="font-medium text-foreground">GitHub</div>
103+
<div className="text-sm text-muted-foreground">Source code</div>
104+
</div>
105+
</a>
106+
107+
<a
108+
href="https://evolution-api.com"
109+
target="_blank"
110+
rel="noopener noreferrer"
111+
className="flex items-center gap-3 p-4 rounded-lg border border-border hover:bg-accent transition-colors"
112+
>
113+
<Globe className="w-5 h-5 text-muted-foreground" />
114+
<div>
115+
<div className="font-medium text-foreground">Website</div>
116+
<div className="text-sm text-muted-foreground">Official site</div>
117+
</div>
118+
</a>
119+
120+
<a
121+
href="mailto:[email protected]"
122+
className="flex items-center gap-3 p-4 rounded-lg border border-border hover:bg-accent transition-colors"
123+
>
124+
<Mail className="w-5 h-5 text-muted-foreground" />
125+
<div>
126+
<div className="font-medium text-foreground">Contact</div>
127+
<div className="text-sm text-muted-foreground">Get support</div>
128+
</div>
129+
</a>
130+
</div>
131+
</CardContent>
132+
</Card>
133+
134+
{/* Footer */}
135+
<div className="text-center mt-12 text-sm text-muted-foreground">
136+
<p>© 2025 Evolution API. Licensed under Apache 2.0 with Evolution API custom conditions.</p>
137+
</div>
138+
</div>
139+
</div>
140+
</div>
141+
);
142+
}

src/pages/Login/index.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ import { Input } from "@/components/ui/input";
1313
import { verifyCreds } from "@/lib/queries/auth/verifyCreds";
1414
import { verifyServer } from "@/lib/queries/auth/verifyServer";
1515
import { logout, saveToken } from "@/lib/queries/token";
16+
import { useTheme } from "@/components/theme-provider";
1617

1718
const loginSchema = z.object({
1819
serverUrl: z.string({ required_error: "serverUrl is required" }).url("URL inválida"),
@@ -23,6 +24,7 @@ type LoginSchema = z.infer<typeof loginSchema>;
2324
function Login() {
2425
const { t } = useTranslation();
2526
const navigate = useNavigate();
27+
const { theme } = useTheme();
2628
const loginForm = useForm<LoginSchema>({
2729
resolver: zodResolver(loginSchema),
2830
defaultValues: {
@@ -69,7 +71,7 @@ function Login() {
6971
return (
7072
<div className="flex min-h-screen flex-col">
7173
<div className="flex items-center justify-center pt-2">
72-
<img className="h-10" src="/assets/images/evolution-logo.png" alt="logo" />
74+
<img className="h-10" src={theme === "dark" ? "https://evolution-api.com/files/evo/evolution-logo-white.svg" : "https://evolution-api.com/files/evo/evolution-logo.svg"} alt="logo" />
7375
</div>
7476
<div className="flex flex-1 items-center justify-center p-8">
7577
<Card className="b-none w-[350px] shadow-none">

src/routes/index.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,13 @@ import { Typebot } from "@/pages/instance/Typebot";
2525
import { Webhook } from "@/pages/instance/Webhook";
2626
import { Websocket } from "@/pages/instance/Websocket";
2727
import Login from "@/pages/Login";
28+
import Home from "@/pages/Home";
2829

2930
const router = createBrowserRouter([
31+
{
32+
path: "/",
33+
element: <Home />,
34+
},
3035
{
3136
path: "/manager/login",
3237
element: (

0 commit comments

Comments
 (0)