-
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.
- Loading branch information
1 parent
97b10dd
commit ba3f36f
Showing
5 changed files
with
94 additions
and
110 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 |
---|---|---|
@@ -1,27 +1,25 @@ | ||
import { useEffect, useState } from "react"; | ||
import PreLogin from "./auth/PreLogin"; | ||
import PostLogin from "./auth/PostLogin"; | ||
import { useEffect, useState } from 'react'; | ||
import PreLogin from './auth/PreLogin'; | ||
import PostLogin from './auth/PostLogin'; | ||
|
||
export type LandingFunnelStateProps = "pre-login" | "post-login"; | ||
export type LandingFunnelStateProps = 'pre-login' | 'post-login'; | ||
|
||
const Auth = () => { | ||
const [landingFunnelState, setLandingFunnelState] = | ||
useState<LandingFunnelStateProps>('pre-login'); | ||
|
||
const [landingFunnelState, setLandingFunnelState] = useState<LandingFunnelStateProps>("pre-login"); | ||
const userId = localStorage.getItem('userId'); | ||
|
||
const userId = localStorage.getItem('userId') | ||
useEffect(() => { | ||
if (!userId) return; | ||
setLandingFunnelState('post-login'); | ||
}, [userId]); | ||
|
||
useEffect(() => { | ||
if (!userId) return; | ||
setLandingFunnelState("post-login") | ||
}, [userId]); | ||
if (landingFunnelState === 'post-login') { | ||
return <PostLogin />; | ||
} | ||
|
||
if (landingFunnelState === 'post-login') { | ||
return <PostLogin /> | ||
} | ||
|
||
return ( | ||
<PreLogin setLandingFunnelState={setLandingFunnelState} /> | ||
); | ||
return <PreLogin setLandingFunnelState={setLandingFunnelState} />; | ||
}; | ||
|
||
export default Auth; | ||
export default Auth; |
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,87 +1,90 @@ | ||
import styled from '@emotion/styled'; | ||
import { css } from '@emotion/react' | ||
import { css } from '@emotion/react'; | ||
import getFontStyle from '@theme/font/getFontSize'; | ||
import Header from '@components/Header'; | ||
import HomeSwiper from '@components/HomeSwiper'; | ||
import HumanSVG from "@assets/svg/human.svg?react"; | ||
import AddIconSVG from "@assets/svg/ico_add.svg?react"; | ||
import HumanSVG from '@assets/svg/human.svg?react'; | ||
import AddIconSVG from '@assets/svg/ico_add.svg?react'; | ||
import { colors } from '@theme'; | ||
import { Link } from 'react-router-dom'; | ||
import headerImage from '../assets/images/home_header.png'; | ||
|
||
const Home = () => { | ||
return ( | ||
<Wrapper> | ||
<Header> | ||
<img src="/src/assets/images/home_header.png" alt='home_header' width={"160px"} /> | ||
</Header> | ||
<p | ||
css={css` | ||
margin-left: 16px; | ||
margin-top: 20px; | ||
white-space: pre-wrap; | ||
${getFontStyle('header1')} | ||
`} | ||
> | ||
{`현재 3명의` + '\n' + '일지를 볼 수 있어요'} | ||
</p> | ||
return ( | ||
<Wrapper> | ||
<Header> | ||
<img src={headerImage} alt="home_header" width={'160px'} /> | ||
</Header> | ||
<p | ||
css={css` | ||
margin-left: 16px; | ||
margin-top: 20px; | ||
white-space: pre-wrap; | ||
${getFontStyle('header1')} | ||
`} | ||
> | ||
{`현재 3명의` + '\n' + '일지를 볼 수 있어요'} | ||
</p> | ||
|
||
<HomeSwiper /> | ||
<HomeSwiper /> | ||
|
||
<Footer css={css` | ||
margin-left: 16px; | ||
margin-right: 16px; | ||
`}> | ||
<Link to={'/my'}> | ||
<button> | ||
<HumanSVG /> | ||
내 일지보기 | ||
</button> | ||
</Link> | ||
<Link to={'/write'}> | ||
<button css={css` | ||
background-color: ${colors.primaryDark}; | ||
border: none; | ||
color: white; | ||
`}> | ||
<AddIconSVG /> | ||
일지작성 | ||
</button> | ||
</Link> | ||
</Footer> | ||
</Wrapper> | ||
); | ||
<Footer | ||
css={css` | ||
margin-left: 16px; | ||
margin-right: 16px; | ||
`} | ||
> | ||
<Link to={'/my'}> | ||
<button> | ||
<HumanSVG />내 일지보기 | ||
</button> | ||
</Link> | ||
<Link to={'/write'}> | ||
<button | ||
css={css` | ||
background-color: ${colors.primaryDark}; | ||
border: none; | ||
color: white; | ||
`} | ||
> | ||
<AddIconSVG /> | ||
일지작성 | ||
</button> | ||
</Link> | ||
</Footer> | ||
</Wrapper> | ||
); | ||
}; | ||
|
||
export default Home; | ||
|
||
|
||
const Wrapper = styled.div` | ||
padding-top: 20px; | ||
width: 100%; | ||
height: 100vh; | ||
` | ||
padding-top: 20px; | ||
width: 100%; | ||
height: 100vh; | ||
`; | ||
|
||
const Footer = styled.footer` | ||
width: calc(100% - 32px); | ||
position: absolute; | ||
bottom: 0; | ||
max-width: 768px; | ||
height: 100px; | ||
width: calc(100% - 32px); | ||
position: absolute; | ||
bottom: 0; | ||
max-width: 768px; | ||
height: 100px; | ||
display: flex; | ||
justify-content: center; | ||
gap: 8px; | ||
button { | ||
width: 171px; | ||
height: 56px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 8px; | ||
} | ||
button { | ||
width: 171px; | ||
height: 56px; | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
gap: 8px; | ||
} | ||
a { | ||
text-decoration: none; | ||
} | ||
` | ||
a { | ||
text-decoration: none; | ||
} | ||
`; |
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