From de469e9b70e4f2552fca0b7f0f5b02d3a6175fbd Mon Sep 17 00:00:00 2001 From: Zalko <88582103+Zalk0@users.noreply.github.com> Date: Mon, 27 Nov 2023 21:07:43 +0100 Subject: [PATCH] fix: lint wrapper and add mention to create database --- src/components/Wrapper.tsx | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/components/Wrapper.tsx b/src/components/Wrapper.tsx index 4e1248c..a2eb6dd 100644 --- a/src/components/Wrapper.tsx +++ b/src/components/Wrapper.tsx @@ -1,12 +1,10 @@ 'use client'; -import { ReactNode, useEffect } from 'react'; +import React, { ReactNode, useEffect } from 'react'; import { usePathname, useRouter } from 'next/navigation'; import { useDispatch, useSelector } from 'react-redux'; import { State } from '@/types'; import { autoLogin } from '@/reducers/login'; -import Page from '@/app/login/page'; - import Loader from './pageLoader'; import { type Action } from '@reduxjs/toolkit'; @@ -43,12 +41,9 @@ export default function Wrapper({ if (state.login.loading) return ; - if (!state.login.token) router.push("/login"); - else if (pathname.match("/login")) router.push("/") - + if (!state.login.token) router.push('/login'); + else if (pathname.match('/login')) router.push('/'); // Render the layout with child components - return ( - children - ); + return children; }