diff --git a/src/main/events/profile/get-user-profile.ts b/src/main/events/profile/get-user-profile.ts index aa915f0e..018d0ef1 100644 --- a/src/main/events/profile/get-user-profile.ts +++ b/src/main/events/profile/get-user-profile.ts @@ -1,17 +1,15 @@ -import axios from "axios"; import { registerEvent } from "../register-event"; import { userProfileSchema } from "../helpers/validators"; import { logger } from "@main/services"; +import { HydraApi } from "@main/services/hydra-api"; const getUserProfile = async ( _event: Electron.IpcMainInvokeEvent, username: string ) => { - return axios - .get(`${process.env.API_URL}/profile/${username}`) + return HydraApi.get(`/profile/${username}`) .then((response) => { const profile = userProfileSchema.parse(response.data); - console.log(profile); return profile; }) .catch((err) => { @@ -20,4 +18,4 @@ const getUserProfile = async ( }); }; -registerEvent("getUserProfiel", getUserProfile); +registerEvent("getUserProfile", getUserProfile); diff --git a/src/renderer/src/components/header/header.tsx b/src/renderer/src/components/header/header.tsx index 046a6a4f..8b3ac2fa 100644 --- a/src/renderer/src/components/header/header.tsx +++ b/src/renderer/src/components/header/header.tsx @@ -39,6 +39,7 @@ export function Header({ onSearch, onClear, search }: HeaderProps) { const title = useMemo(() => { if (location.pathname.startsWith("/game")) return headerTitle; + if (location.pathname.startsWith("/profile")) return headerTitle; if (location.pathname.startsWith("/search")) return t("search_results"); return t(pathTitle[location.pathname]); diff --git a/src/renderer/src/components/sidebar/sidebar.tsx b/src/renderer/src/components/sidebar/sidebar.tsx index 897d6b18..62f71a7c 100644 --- a/src/renderer/src/components/sidebar/sidebar.tsx +++ b/src/renderer/src/components/sidebar/sidebar.tsx @@ -143,6 +143,10 @@ export function Sidebar() { } }; + const handleClickProfile = () => { + navigate("/profile/brownie"); + }; + return ( <>