From ed950b23d50f9b3993cfd2ac2386a5b3a68d5e57 Mon Sep 17 00:00:00 2001 From: Rafi Zadanly Date: Mon, 20 Feb 2023 17:03:28 +0700 Subject: fix --- src/core/components/elements/Sidebar/Sidebar.jsx | 37 +++++++++++++++--------- src/core/components/layouts/AnimationLayout.jsx | 2 +- src/core/components/layouts/AppLayout.jsx | 2 +- src/core/hooks/useAuth.js | 3 +- 4 files changed, 28 insertions(+), 16 deletions(-) (limited to 'src/core') diff --git a/src/core/components/elements/Sidebar/Sidebar.jsx b/src/core/components/elements/Sidebar/Sidebar.jsx index 74984393..412ed915 100644 --- a/src/core/components/elements/Sidebar/Sidebar.jsx +++ b/src/core/components/elements/Sidebar/Sidebar.jsx @@ -1,13 +1,22 @@ -import { getAuth } from "@/core/utils/auth" import Link from "../Link/Link" import greeting from "@/core/utils/greeting" import { Cog6ToothIcon } from "@heroicons/react/24/solid" +import useAuth from "@/core/hooks/useAuth" const Sidebar = ({ active, close }) => { - const auth = getAuth() + const auth = useAuth() + + const SidebarLink = ({ children, ...props }) => ( + { children } + ) + + const itemClassName = 'px-4 py-3 block !text-gray_r-12/80 font-normal' return ( <> @@ -24,29 +33,31 @@ const Sidebar = ({ { auth && ( <>
- {/* { greeting() }, */} + { greeting() }, { auth?.name }
- + ) } - + Semua Brand - - + + Tentang Indoteknik - - + + Pusat Bantuan - - - Kategori - + + diff --git a/src/core/components/layouts/AnimationLayout.jsx b/src/core/components/layouts/AnimationLayout.jsx index adb6b081..cf2b06d5 100644 --- a/src/core/components/layouts/AnimationLayout.jsx +++ b/src/core/components/layouts/AnimationLayout.jsx @@ -2,7 +2,7 @@ import { motion } from 'framer-motion' const AnimationLayout = ({ children, ...props }) => { const transition = { - ease: 'easeOut', + ease: 'easeIn', duration: 0.3 } diff --git a/src/core/components/layouts/AppLayout.jsx b/src/core/components/layouts/AppLayout.jsx index 7aaa52ca..3e986477 100644 --- a/src/core/components/layouts/AppLayout.jsx +++ b/src/core/components/layouts/AppLayout.jsx @@ -4,8 +4,8 @@ import AnimationLayout from "./AnimationLayout" const AppLayout = ({ children, title }) => { return ( <> - + { children } diff --git a/src/core/hooks/useAuth.js b/src/core/hooks/useAuth.js index 488562f6..13f04454 100644 --- a/src/core/hooks/useAuth.js +++ b/src/core/hooks/useAuth.js @@ -1,3 +1,4 @@ +import { useEffect, useState } from "react" import { getAuth } from "../utils/auth" const useAuth = () => { @@ -8,7 +9,7 @@ const useAuth = () => { handleIsAuthenticated() }, []) - return [auth, setAuth] + return auth } export default useAuth \ No newline at end of file -- cgit v1.2.3