-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
-비밀번호 컴포넌트에서 서버와의 통신 문제로 에러가 발생 -비밀번호 모달의 다음 창으로 환영합니다 모달이 뜨도록 구현 -환영합니다 다음에는 모달창이 닫히도록 구현 Issues #15
- Loading branch information
김병현
authored and
김병현
committed
Sep 6, 2023
1 parent
ba9bd1f
commit 1c1b1db
Showing
3 changed files
with
101 additions
and
7 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
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 |
---|---|---|
@@ -0,0 +1,74 @@ | ||
// client/src/components/Signups/Welcome.tsx | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import StockHolmLogo from '../../asset/images/StockHolmLogo.png'; | ||
|
||
const Welcome: React.FC<WelcomeProps> = ({ onClose }) => { | ||
return ( | ||
<ModalBackground> | ||
<ModalContainer> | ||
<Title>환영합니다.</Title> | ||
<Logo src={StockHolmLogo} alt="StockHolm Logo" /> | ||
<ConfirmButton onClick={onClose}>시작하기</ConfirmButton> | ||
</ModalContainer> | ||
</ModalBackground> | ||
); | ||
}; | ||
|
||
export default Welcome; | ||
|
||
type WelcomeProps = { | ||
onClose: () => void; | ||
}; | ||
|
||
// 모달 배경 스타일 | ||
const ModalBackground = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
position: fixed; | ||
top: 0; | ||
left: 0; | ||
width: 100%; | ||
height: 100%; | ||
background-color: rgba(0, 0, 0, 0.5); | ||
`; | ||
|
||
// 모달 컨테이너 스타일 | ||
const ModalContainer = styled.div` | ||
position: relative; | ||
background-color: white; | ||
padding: 20px; | ||
width: 400px; | ||
border-radius: 10px; | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
`; | ||
|
||
// 모달 제목 스타일 | ||
const Title = styled.h2` | ||
margin-bottom: 20px; | ||
font-size: 1.6rem; | ||
font-weight: 400; | ||
`; | ||
|
||
// 스톡홀름 로고 스타일 | ||
const Logo = styled.img` | ||
margin-top: 20px; | ||
margin-bottom: 20px; | ||
width: 150px; // 이미지 크기 조절을 위해 추가 | ||
height: auto; | ||
`; | ||
|
||
// 시작하기 버튼 스타일 | ||
const ConfirmButton = styled.button` | ||
width: 100%; | ||
padding: 10px; | ||
margin-top: 10px; | ||
background-color: darkslategray; | ||
color: white; | ||
border: none; | ||
border-radius: 5px; | ||
cursor: pointer; | ||
`; |
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 |
---|---|---|
|
@@ -14,6 +14,7 @@ import WatchList from "../components/watchlist/WatchList"; | |
import Holdings from "../components/watchlist/Holdings"; // Assuming you have a Holdings component | ||
import CompareChartSection from "../components/CompareChartSection/Index"; | ||
import StockOrderSection from "../components/StockOrderSection/Index"; | ||
import Welcome from "../components/Signups/Welcome"; | ||
|
||
import { StateProps } from "../models/stateProps"; | ||
|
||
|
@@ -25,6 +26,7 @@ const MainPage = () => { | |
const [isEmailLoginModalOpen, setEmailLoginModalOpen] = useState(false); | ||
const [isEmailSignupModalOpen, setEmailSignupModalOpen] = useState(false); | ||
const [userEmail, setUserEmail] = useState(''); | ||
const [isWelcomeModalOpen, setWelcomeModalOpen] = useState(false); | ||
|
||
const openOAuthModal = useCallback(() => { | ||
setOAuthModalOpen(true); | ||
|
@@ -52,6 +54,7 @@ const MainPage = () => { | |
setEmailSignupModalOpen(false); | ||
}, []); | ||
|
||
|
||
const [isEmailVerificationModalOpen, setEmailVerificationModalOpen] = useState(false); | ||
|
||
// 이메일 인증 모달을 열 때 사용자가 입력한 이메일을 저장하도록 변경 | ||
|
@@ -74,6 +77,15 @@ const MainPage = () => { | |
|
||
const closePasswordSettingModal = useCallback(() => { | ||
setPasswordSettingModalOpen(false); | ||
}, []); | ||
|
||
const openWelcomeModal = useCallback(() => { | ||
setPasswordSettingModalOpen(false); // 비밀번호 설정 모달 닫기 | ||
setWelcomeModalOpen(true); // Welcome 모달 열기 | ||
}, []); | ||
|
||
const closeWelcomeModal = useCallback(() => { | ||
setWelcomeModalOpen(false); | ||
}, []); | ||
|
||
const [isLoggedIn, setIsLoggedIn] = useState(false); // 로그인 상태 관리 | ||
|
@@ -114,11 +126,16 @@ const MainPage = () => { | |
|
||
{isPasswordSettingModalOpen && ( | ||
<PasswordSettingModal | ||
onClose={closePasswordSettingModal} // Password 모달을 닫는다. | ||
onNext={openWelcomeModal} // Welcome 모달을 연다. | ||
email={userEmail} // email을 userEmail로 설정 | ||
/> | ||
)} | ||
{isWelcomeModalOpen && ( | ||
<Welcome | ||
onClose={() => { | ||
handleLogin(); | ||
closePasswordSettingModal(); | ||
closeWelcomeModal(); | ||
}} | ||
email="[email protected]" | ||
/> | ||
)} | ||
</Container> | ||
|