Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/png" href="https://evolution-api.com/files/evo/favicon.svg" />
<link rel="icon" type="image/png" href="/assets/images/evolution-logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Evolution Manager</title>
</head>
Expand Down
8 changes: 2 additions & 6 deletions src/components/sidebar.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Collapsible, CollapsibleContent, CollapsibleTrigger } from "@evoapi/design-system/collapsible";
import { LOGO_SRC } from "@/lib/constants";
import {
ChevronDown,
CircleHelp,
Expand All @@ -13,7 +14,6 @@ import { useMemo } from "react";
import { useTranslation } from "react-i18next";
import { NavLink, useLocation } from "react-router-dom";

import { useTheme } from "@/components/theme-provider";
import { useInstance } from "@/contexts/InstanceContext";

import { FEATURES, FeatureKey, isFeatureEnabled } from "@/lib/provider/features";
Expand Down Expand Up @@ -41,11 +41,7 @@ type Menu = MenuLeaf | MenuGroup;

function SidebarShell({ children, footer }: { children: React.ReactNode; footer?: React.ReactNode }) {
const currentYear = new Date().getFullYear();
const { theme } = useTheme();
const logoSrc =
theme === "dark"
? "https://evolution-api.com/files/evo/evolution-logo-white.svg"
: "https://evolution-api.com/files/evo/evolution-logo.svg";
const logoSrc = LOGO_SRC;

return (
<aside className="hidden md:flex bg-sidebar text-sidebar-foreground flex-col w-56 border-r border-sidebar-border">
Expand Down
1 change: 1 addition & 0 deletions src/lib/constants.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export const LOGO_SRC = "/assets/images/evolution-logo.png";
7 changes: 3 additions & 4 deletions src/pages/Home.tsx
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
import { Button } from "@evoapi/design-system/button";
import { LOGO_SRC } from "@/lib/constants";
import { Card, CardContent, CardDescription, CardHeader, CardTitle } from "@evoapi/design-system/card";
import { Badge } from "@evoapi/design-system/badge";
import { ArrowRight, Github, Globe, Mail, Shield } from "lucide-react";
import { useNavigate } from "react-router-dom";
import { useTheme } from "@/components/theme-provider";
import { ModeToggle } from "@/components/mode-toggle";
import { LanguageToggle } from "@/components/language-toggle";

export default function Home() {
const navigate = useNavigate();
const { theme } = useTheme();

const handleGoToManager = () => {
navigate("/manager");
Expand All @@ -21,7 +20,7 @@ export default function Home() {
<header className="flex items-center justify-between px-4 py-2">
<div className="flex items-center">
<img
src={theme === "dark" ? "https://evolution-api.com/files/evo/evolution-logo-white.svg" : "https://evolution-api.com/files/evo/evolution-logo.svg"}
src={LOGO_SRC}
alt="Evolution API Logo"
className="h-8"
/>
Expand All @@ -38,7 +37,7 @@ export default function Home() {
<div className="text-center mb-12">
<div className="flex items-center justify-center mb-6">
<img
src={theme === "dark" ? "https://evolution-api.com/files/evo/evolution-logo-white.svg" : "https://evolution-api.com/files/evo/evolution-logo.svg"}
src={LOGO_SRC}
alt="Evolution Manager Logo"
className="h-10"
/>
Expand Down
9 changes: 2 additions & 7 deletions src/pages/Login/LicenseCallback.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,32 +4,27 @@
// redirects back to /manager (or back to /manager/login on failure).

import { Button } from "@evoapi/design-system/button";
import { LOGO_SRC } from "@/lib/constants";
import { CheckCircle, Loader2, XCircle } from "lucide-react";
import { useCallback, useEffect, useState } from "react";
import { useTranslation } from "react-i18next";
import { useNavigate, useSearchParams } from "react-router-dom";

import { useTheme } from "@/components/theme-provider";

import { activateLicense } from "@/lib/queries/license/license";
import { getToken, TOKEN_ID } from "@/lib/queries/token";

type State = "activating" | "success" | "error";

function LicenseCallback() {
const { t } = useTranslation();
const { theme } = useTheme();
const navigate = useNavigate();
const [searchParams] = useSearchParams();
const code = searchParams.get("code") ?? "";

const [state, setState] = useState<State>("activating");
const [errorMessage, setErrorMessage] = useState("");

const logoSrc =
theme === "dark"
? "https://evolution-api.com/files/evo/evolution-logo-white.svg"
: "https://evolution-api.com/files/evo/evolution-logo.svg";
const logoSrc = LOGO_SRC;

const doActivate = useCallback(async () => {
setState("activating");
Expand Down
8 changes: 2 additions & 6 deletions src/pages/Login/index.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { zodResolver } from "@hookform/resolvers/zod";
import { LOGO_SRC } from "@/lib/constants";
import { Alert, AlertDescription, AlertTitle } from "@evoapi/design-system/alert";
import { Button } from "@evoapi/design-system/button";
import { Input } from "@/components/ui/input";
Expand All @@ -11,7 +12,6 @@ import { useNavigate } from "react-router-dom";
import { z } from "zod";

import { Form, FormSelect } from "@/components/ui/form";
import { useTheme } from "@/components/theme-provider";

import { verifyCreds } from "@/lib/queries/auth/verifyCreds";
import { verifyGoServer } from "@/lib/queries/auth/verifyGoServer";
Expand All @@ -29,13 +29,9 @@ type LoginSchema = z.infer<typeof loginSchema>;
function Login() {
const { t } = useTranslation();
const navigate = useNavigate();
const { theme } = useTheme();
const [loginError, setLoginError] = useState("");
const [submitting, setSubmitting] = useState(false);
const logoSrc =
theme === "dark"
? "https://evolution-api.com/files/evo/evolution-logo-white.svg"
: "https://evolution-api.com/files/evo/evolution-logo.svg";
const logoSrc = LOGO_SRC;

const loginForm = useForm<LoginSchema>({
resolver: zodResolver(loginSchema),
Expand Down