From 3ac06fbce591c7bf86a8eebd6f7c420ef958df27 Mon Sep 17 00:00:00 2001 From: Zamitto <167933696+zamitto@users.noreply.github.com> Date: Sat, 15 Jun 2024 20:31:26 -0300 Subject: [PATCH] feat: files and components --- .../src/components/sidebar/sidebar-profile.tsx | 2 +- src/renderer/src/main.tsx | 4 ++-- .../profile-content.tsx => user/user-content.tsx} | 4 ++-- .../profile-skeleton.tsx => user/user-skeleton.tsx} | 4 ++-- .../{profile/profile.css.tsx => user/user.css.tsx} | 0 .../src/pages/{profile/profile.tsx => user/user.tsx} | 12 ++++++------ 6 files changed, 13 insertions(+), 13 deletions(-) rename src/renderer/src/pages/{profile/profile-content.tsx => user/user-content.tsx} (97%) rename src/renderer/src/pages/{profile/profile-skeleton.tsx => user/user-skeleton.tsx} (68%) rename src/renderer/src/pages/{profile/profile.css.tsx => user/user.css.tsx} (100%) rename src/renderer/src/pages/{profile/profile.tsx => user/user.tsx} (78%) diff --git a/src/renderer/src/components/sidebar/sidebar-profile.tsx b/src/renderer/src/components/sidebar/sidebar-profile.tsx index f26ffa4e..c454c348 100644 --- a/src/renderer/src/components/sidebar/sidebar-profile.tsx +++ b/src/renderer/src/components/sidebar/sidebar-profile.tsx @@ -11,7 +11,7 @@ export function SidebarProfile() { const [isUserProfileLoading, setIsUserProfileLoading] = useState(true); const handleClickProfile = () => { - navigate(`/profile/${userProfile!.id}`); + navigate(`/user/${userProfile!.id}`); }; const handleClickLogin = () => { diff --git a/src/renderer/src/main.tsx b/src/renderer/src/main.tsx index de3f2d72..9f136e97 100644 --- a/src/renderer/src/main.tsx +++ b/src/renderer/src/main.tsx @@ -27,7 +27,7 @@ import { import { store } from "./store"; import * as resources from "@locales"; -import { Profile } from "./pages/profile/profile"; +import { User } from "./pages/user/user"; i18n .use(LanguageDetector) @@ -55,7 +55,7 @@ ReactDOM.createRoot(document.getElementById("root")!).render( - + diff --git a/src/renderer/src/pages/profile/profile-content.tsx b/src/renderer/src/pages/user/user-content.tsx similarity index 97% rename from src/renderer/src/pages/profile/profile-content.tsx rename to src/renderer/src/pages/user/user-content.tsx index b8311adb..d738bb57 100644 --- a/src/renderer/src/pages/profile/profile-content.tsx +++ b/src/renderer/src/pages/user/user-content.tsx @@ -1,6 +1,6 @@ import { ProfileGame, UserProfile } from "@types"; import cn from "classnames"; -import * as styles from "./profile.css"; +import * as styles from "./user.css"; import { SPACING_UNIT, vars } from "@renderer/theme.css"; import { useMemo } from "react"; import { useTranslation } from "react-i18next"; @@ -16,7 +16,7 @@ export interface ProfileContentProps { userProfile: UserProfile; } -export const ProfileContent = ({ userProfile }: ProfileContentProps) => { +export const UserContent = ({ userProfile }: ProfileContentProps) => { const { t, i18n } = useTranslation("user_profile"); const navigate = useNavigate(); diff --git a/src/renderer/src/pages/profile/profile-skeleton.tsx b/src/renderer/src/pages/user/user-skeleton.tsx similarity index 68% rename from src/renderer/src/pages/profile/profile-skeleton.tsx rename to src/renderer/src/pages/user/user-skeleton.tsx index 0298b07a..9b7c82ad 100644 --- a/src/renderer/src/pages/profile/profile-skeleton.tsx +++ b/src/renderer/src/pages/user/user-skeleton.tsx @@ -1,7 +1,7 @@ import Skeleton from "react-loading-skeleton"; -import * as styles from "./profile.css"; +import * as styles from "./user.css"; -export const ProfileSkeleton = () => { +export const UserSkeleton = () => { return ( <> diff --git a/src/renderer/src/pages/profile/profile.css.tsx b/src/renderer/src/pages/user/user.css.tsx similarity index 100% rename from src/renderer/src/pages/profile/profile.css.tsx rename to src/renderer/src/pages/user/user.css.tsx diff --git a/src/renderer/src/pages/profile/profile.tsx b/src/renderer/src/pages/user/user.tsx similarity index 78% rename from src/renderer/src/pages/profile/profile.tsx rename to src/renderer/src/pages/user/user.tsx index 06efbbfc..80f6125c 100644 --- a/src/renderer/src/pages/profile/profile.tsx +++ b/src/renderer/src/pages/user/user.tsx @@ -3,13 +3,13 @@ import { useEffect, useState } from "react"; import { useParams } from "react-router-dom"; import { setHeaderTitle } from "@renderer/features"; import { useAppDispatch } from "@renderer/hooks"; -import { ProfileSkeleton } from "./profile-skeleton"; -import { ProfileContent } from "./profile-content"; +import { UserSkeleton } from "./user-skeleton"; +import { UserContent } from "./user-content"; import { SkeletonTheme } from "react-loading-skeleton"; import { vars } from "@renderer/theme.css"; -import * as styles from "./profile.css"; +import * as styles from "./user.css"; -export const Profile = () => { +export const User = () => { const { username } = useParams(); const [userProfile, setUserProfile] = useState(); @@ -28,9 +28,9 @@ export const Profile = () => {
{userProfile ? ( - + ) : ( - + )}