{!isDark && (
-
+ width="16"
+ height="16"
+ viewBox="0 0 13 13"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ //
)}
{isDark && (
-
+ width="16"
+ height="16"
+ viewBox="0 0 13 13"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+
+
+
+ //
)}
-
+
+
+
+ {/*
+ > */}
{profileImg === null && (
-
+ width="40"
+ height="40"
+ viewBox="0 0 40 40"
+ fill="none"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+
+
+
+
+
+
+
+
+
+
+ //
)}
{profileImg !== null && (
Today's
@@ -42,15 +42,15 @@ function NavbarHome() {
Statistics
diff --git a/src/pages/Home.js b/src/pages/Home.js
index 014c01b..4758628 100644
--- a/src/pages/Home.js
+++ b/src/pages/Home.js
@@ -1,12 +1,50 @@
-import React from "react";
+import axios from "axios";
+import React, { useEffect, useState } from "react";
import { Outlet } from "react-router-dom";
import NavbarHome from "../components/navbarHome";
+import isLogin from "../utils/isLogin";
export default function Home() {
- console.log("home");
+ const TOKEN = localStorage.getItem("accessToken");
+
+ const [nickname, setNickname] = useState("");
+ const [email, setEmail] = useState("");
+ const [profileImg, setProfileImg] = useState("");
+ const [Level, setLevel] = useState("");
+ const [levelImagae, setLevelImage] = useState("");
+ const [profileMsg, setProfileMsg] = useState("");
+ const [timeGoal, setTimeGoal] = useState("");
+
+ useEffect(() => {
+ if (isLogin()) {
+ axios
+ .get("/users", {
+ headers: {
+ Authorization: `Bearer ${TOKEN}`,
+ },
+ })
+ .then((res) => {
+ const USER = res.data.user;
+ setNickname(USER.userNickname);
+ setEmail(USER.userEmail);
+ setProfileImg(USER.userImg);
+ setLevel(USER.userLevel.levelName);
+ setLevelImage(USER.userImageLevel.levelImg);
+ setProfileMsg(USER.userProfileMsg);
+ setTimeGoal(USER.userTimeGoal);
+ });
+ }
+ });
+
return (
);
diff --git a/src/statics/css/home.css b/src/statics/css/home.css
new file mode 100644
index 0000000..e826839
--- /dev/null
+++ b/src/statics/css/home.css
@@ -0,0 +1,3 @@
+
+
+/*# sourceMappingURL=home.css.map */
diff --git a/src/statics/css/home.css.map b/src/statics/css/home.css.map
new file mode 100644
index 0000000..fc640df
--- /dev/null
+++ b/src/statics/css/home.css.map
@@ -0,0 +1 @@
+{"version":3,"sourceRoot":"","sources":[],"names":[],"mappings":"","file":"home.css"}
\ No newline at end of file
diff --git a/src/statics/scss/home.scss b/src/statics/scss/home.scss
new file mode 100644
index 0000000..e69de29