Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

42gg-onboarding-fe-02 #3

Open
wants to merge 5 commits into
base: main
Choose a base branch
from

Conversation

parksangmin1543
Copy link

@parksangmin1543 parksangmin1543 commented Apr 18, 2023

구현

  • normal, manager, admin 3개의 권한을 가진 유저별 정보 제공
  • 권한별 routing page 구현
  • 상단 navbar, sidebar 제작

Copy link
Contributor

@mike2ox mike2ox left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨어요! 중복되는 부분은 custom hook으로 빼보는 연습하면 코드가 더 깔끔해질거에요.

Comment on lines +17 to +27
const [auth, setAuth] = useRecoilState(authAtom);

useEffect(() => {
const authFromLocalStorage = JSON.parse(localStorage.getItem('auth'));
if (authFromLocalStorage)
{
setAuth(authFromLocalStorage);
console.log(auth);
}
}, [setAuth]);

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이부분을 custom hook으로 바꾸면 Mainpage 함수를 사용 안해도 될거 같아요

Comment on lines +14 to +49
function Header() {
return (
<header>
<nav className={styles.nav_item}>
<Link to="/" className={styles.Home}>
<Button style={{color: '#d0936d'}}>Bookjeok Bookjeok</Button>
</Link>
<Link to="/about">
<Button style={{color: '#d0936d'}}>About</Button>
</Link>
<Link to="/users">
<Button style={{color: '#d0936d'}}>Users</Button>
</Link>
<Link to="/Profile">
<Button style={{color: '#d0936d'}}>Profile</Button>
</Link>
</nav>
</header>
);
}

function Body() {
const users = () => {
return <Users />;
};
return (
<Routes className={styles.bodypage}>
<Route path="/*" element={<Home />} />
<Route path="/about" element={<About />} />
<Route path="/users/*" element={<PrivateRoute Component={users} />} />
<Route path="/profile" element={<Profile />} />
<Route path="/login" element={<LoginForm />}/>
<Route path="*" element={<NotFound />} />
</Routes>
)
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

따로 파일로 빼는게 더 깔끔할 거 같아요.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants