-
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.
Browse files
Browse the repository at this point in the history
…tyView Feat/#26/community view
- Loading branch information
Showing
19 changed files
with
366 additions
and
2 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
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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,23 @@ | ||
import { GivePost1, GivePost2, GivePost3, GivePost4, GivePost5 } from '../icon/icon'; | ||
|
||
import React from 'react'; | ||
import { styled } from 'styled-components'; | ||
|
||
const GivePosts = () => { | ||
return ( | ||
<PostsWrapper> | ||
<GivePost1 /> | ||
<GivePost2 /> | ||
<GivePost3 /> | ||
<GivePost4 /> | ||
<GivePost5 /> | ||
</PostsWrapper> | ||
); | ||
}; | ||
|
||
export default GivePosts; | ||
|
||
const PostsWrapper = styled.main` | ||
margin-top: 8.2rem; | ||
margin-bottom: 15rem; | ||
`; |
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,57 @@ | ||
import React from 'react'; | ||
import Text from '../common/Text'; | ||
import { communityTapState } from '../../states/communityTapState'; | ||
import { styled } from 'styled-components'; | ||
import { theme } from '../../styles/theme'; | ||
import { useRecoilState } from 'recoil'; | ||
|
||
const Header = () => { | ||
const [currentTap, setCurrentTap] = useRecoilState(communityTapState); | ||
const handleTap = () => { | ||
setCurrentTap(!currentTap); | ||
}; | ||
|
||
return ( | ||
<HeaderWrapper> | ||
<HeaderTap onClick={handleTap} isCurrentTap={currentTap === false}> | ||
{currentTap === false ? ( | ||
<Text font="head5" color={theme.colors.black}> | ||
헌혈증서 나눔 | ||
</Text> | ||
) : ( | ||
<Text font="head5" color={theme.colors.gray01}> | ||
헌혈증서 나눔 | ||
</Text> | ||
)} | ||
</HeaderTap> | ||
<HeaderTap onClick={handleTap} isCurrentTap={currentTap === true}> | ||
{currentTap === true ? ( | ||
<Text font="head5" color={theme.colors.black}> | ||
지정헌혈 구인 | ||
</Text> | ||
) : ( | ||
<Text font="head5" color={theme.colors.gray01}> | ||
지정헌혈 구인 | ||
</Text> | ||
)} | ||
</HeaderTap> | ||
</HeaderWrapper> | ||
); | ||
}; | ||
|
||
export default Header; | ||
|
||
const HeaderWrapper = styled.header` | ||
display: flex; | ||
position: absolute; | ||
width: 100%; | ||
`; | ||
|
||
const HeaderTap = styled.div<{ isCurrentTap: boolean }>` | ||
display: flex; | ||
justify-content: center; | ||
border-bottom: 0.2rem solid ${(props) => (props.isCurrentTap ? theme.colors.deepred : theme.colors.gray01)}; | ||
cursor: pointer; | ||
width: 100%; | ||
height: 5.6rem; | ||
`; |
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,23 @@ | ||
import { HelpPost1, HelpPost2, HelpPost3, HelpPost4, HelpPost5 } from '../icon/icon'; | ||
|
||
import React from 'react'; | ||
import { styled } from 'styled-components'; | ||
|
||
const HelpPosts = () => { | ||
return ( | ||
<PostsWrapper> | ||
<HelpPost1 /> | ||
<HelpPost2 /> | ||
<HelpPost3 /> | ||
<HelpPost4 /> | ||
<HelpPost5 /> | ||
</PostsWrapper> | ||
); | ||
}; | ||
|
||
export default HelpPosts; | ||
|
||
const PostsWrapper = styled.main` | ||
margin-top: 8.2rem; | ||
margin-bottom: 15rem; | ||
`; |
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,21 @@ | ||
import Footer from '../components/common/Footer'; | ||
import GivePosts from '../components/community/GivePosts'; | ||
import Header from '../components/community/Header'; | ||
import HelpPosts from '../components/community/HelpPosts'; | ||
import React from 'react'; | ||
import { communityTapState } from '../states/communityTapState'; | ||
import { useRecoilValue } from 'recoil'; | ||
|
||
const Community = () => { | ||
const currentTap = useRecoilValue(communityTapState); | ||
return ( | ||
<> | ||
<Header /> | ||
{currentTap ? <HelpPosts></HelpPosts> : <GivePosts />} | ||
|
||
<Footer /> | ||
</> | ||
); | ||
}; | ||
|
||
export default Community; |
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,6 @@ | ||
import { atom } from 'recoil'; | ||
|
||
export const communityTapState = atom({ | ||
key: 'communityTapState', | ||
default: false, | ||
}); |
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