Skip to content

Commit

Permalink
fix :: tokenCheck hook error 수정 #10
Browse files Browse the repository at this point in the history
  • Loading branch information
kyumin7487 committed Aug 29, 2024
1 parent ec5487f commit 67bf2e4
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
4 changes: 2 additions & 2 deletions src/components/common/HOF/authcheck.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ import { ProvidersProps } from "../providers/type";
import { useEffect } from "react";
import { ACCESS_TOKEN_KEY } from 'src/constants/token/token.constants';
import Token from 'src/libs/token/token';
import {tokenCheck} from "src/libs/tokenCheck/tokenCheck";
import { useTokenCheck } from "src/libs/tokenCheck/tokenCheck";
const AuthCheck = ({ children }: ProvidersProps)=>{
const { setTokenCheck } = tokenCheck();
const { setTokenCheck } = useTokenCheck();

useEffect(() => {
const token = Token.getToken(ACCESS_TOKEN_KEY);
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/header/index.tsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import React from "react";
import { useGetProfile } from "src/queries/profile/profile.queries";
import { tokenCheck } from "src/libs/tokenCheck/tokenCheck";
import { useTokenCheck } from "src/libs/tokenCheck/tokenCheck";
import logoImg from "src/assets/img/logo.svg";
import profileImg from "src/assets/img/profileImg.svg";
import * as S from "src/components/common/header/style";

const Header = () => {
const { data } = useGetProfile();
const { getTokenCheck } = tokenCheck();
const { getTokenCheck } = useTokenCheck();

return (
<S.headWrap>
Expand Down
4 changes: 2 additions & 2 deletions src/components/common/pageTemplate/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import useExceptionHandling from "src/constants/exceptionHandling/constants";
import Layout from "src/components/common/layout";
import Header from "src/components/common/header";

const pageTemplate = ({ children }: ProvidersProps) => {
const PageTemplate = ({ children }: ProvidersProps) => {
const exceptionHandling = useExceptionHandling();
return (
<S.layoutWrap>
Expand All @@ -15,4 +15,4 @@ const pageTemplate = ({ children }: ProvidersProps) => {
);
};

export default pageTemplate;
export default PageTemplate;
4 changes: 2 additions & 2 deletions src/libs/tokenCheck/tokenCheck.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { useAtom, useSetAtom } from 'jotai';
import { tokenValidAtom } from 'src/store/token/token.atom';

export const tokenCheck = () => {
export const useTokenCheck = () => {
const setTokenValid = useSetAtom(tokenValidAtom);
const [tokenValid] = useAtom(tokenValidAtom);

Expand All @@ -14,4 +14,4 @@ export const tokenCheck = () => {
};

return { setTokenCheck, getTokenCheck };
};
};

0 comments on commit 67bf2e4

Please sign in to comment.