forked from GrowthMemory/PWA
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(GrowthMemory#4): isLoginTemplate 수정, 로그인 정보 확인
- Loading branch information
1 parent
2802074
commit e10bc04
Showing
3 changed files
with
50 additions
and
45 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,38 +1,38 @@ | ||
import HeaderBox from "../components/common/header/HeaderBox"; | ||
import Button from "../components/common/Button"; | ||
import Terms from "../components/common/Terms"; | ||
import TermsBox from "../components/collectPersonalData/TermsBox"; | ||
import TermsBox from "../components/CollectPersonalData/TermsBox"; | ||
import styled from "styled-components"; | ||
import { Context } from "../components/context/context"; | ||
import { useContext } from "react"; | ||
import SignUpProvider from "../components/provider/SignUpPovider"; | ||
import BackHeader from "../components/common/header/BackHeader"; | ||
|
||
export default function CollectPersonalData() { | ||
return ( | ||
<> | ||
<SignUpProvider> | ||
<BackHeader /> | ||
<Section> | ||
<HeaderBox> | ||
<span>서비스 이용을 위해</span> | ||
<span>{"약관 동의를 해주세요 :)"}</span> | ||
</HeaderBox> | ||
<Button text={"agree"} /> | ||
<TermsBox /> | ||
<Button text={"next"} /> | ||
</Section> | ||
</SignUpProvider> | ||
</> | ||
); | ||
return ( | ||
<> | ||
<SignUpProvider> | ||
<BackHeader /> | ||
<Section> | ||
<HeaderBox> | ||
<span>서비스 이용을 위해</span> | ||
<span>{"약관 동의를 해주세요 :)"}</span> | ||
</HeaderBox> | ||
<Button text={"agree"} /> | ||
<TermsBox /> | ||
<Button text={"next"} /> | ||
</Section> | ||
</SignUpProvider> | ||
</> | ||
); | ||
} | ||
|
||
const Section = styled.section` | ||
width: 360px; | ||
height: 500px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: space-between; | ||
/* background-color: aqua; */ | ||
width: 360px; | ||
height: 500px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
justify-content: space-between; | ||
/* background-color: aqua; */ | ||
`; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
import { useNavigate } from "react-router-dom"; | ||
import { useEffect } from "react"; | ||
import { firebaseAuth } from "../service/firebaseConfig"; | ||
import { onAuthStateChanged } from "firebase/auth"; | ||
import { auth } from "../service/auth"; | ||
|
||
function IsLoginTemplate(props) { | ||
const navigate = useNavigate(); | ||
const navigate = useNavigate(); | ||
|
||
useEffect(() => { | ||
if (firebaseAuth.currentUser) { | ||
navigate("/Home"); | ||
} | ||
}, []); | ||
useEffect(() => { | ||
onAuthStateChanged(auth, (user) => { | ||
if (user) { | ||
navigate("/Home"); | ||
} else { | ||
navigate("/Login"); | ||
} | ||
}); | ||
}, [auth]); | ||
|
||
return <>{props.children}</>; | ||
return <>{props.children}</>; | ||
} | ||
|
||
export default IsLoginTemplate; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters