Skip to content

Commit

Permalink
feat : withlogin, layout 수정 (#244)
Browse files Browse the repository at this point in the history
* fix(volunteer): withlogin 컴포넌트 early return 추가

* feat(shared): 보호소 어플 회원가입 페이지에 접근가능하도록 허용, layout console 제거

* fix(shared): 봉사자 앱, 보호소 앱 react strict mode 제거
  • Loading branch information
DongjaJ authored Nov 30, 2023
1 parent 9e6b867 commit 816d9ec
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 13 deletions.
7 changes: 1 addition & 6 deletions apps/shelter/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import ReactDOM from 'react-dom/client';

import App from './App.tsx';
Expand All @@ -16,9 +15,5 @@ async function deferRender() {
}

deferRender().then(() => {
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>,
);
ReactDOM.createRoot(document.getElementById('root')!).render(<App />);
});
2 changes: 1 addition & 1 deletion apps/volunteer/src/components/WithLogin.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export default function WithLogin({ children }: { children: ReactNode }) {
const { user } = useAuthStore();

if (user) {
children;
return children;
}

return <Navigate to="/signin" />;
Expand Down
7 changes: 1 addition & 6 deletions apps/volunteer/src/main.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import React from 'react';
import ReactDOM from 'react-dom/client';

import App from './App.tsx';
Expand All @@ -16,9 +15,5 @@ async function deferRender() {
}

deferRender().then(() => {
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>,
);
ReactDOM.createRoot(document.getElementById('root')!).render(<App />);
});
3 changes: 3 additions & 0 deletions packages/shared/layout/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ export default function Layout({ appType }: LayoutProps) {
if (appType === 'VOLUNTEER_APP' && pathname === '/') {
navigate('/volunteers');
} else if (appType === 'SHELTER_APP') {
if (pathname === '/signup' || pathname === '/signin') {
return;
}
navigate('/signin');
}

Expand Down

0 comments on commit 816d9ec

Please sign in to comment.