-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from PoolC/pre-release
신입 지원 배너 추가 및 travis.yml 변경
- Loading branch information
Showing
5 changed files
with
101 additions
and
1 deletion.
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,51 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
import { MENU } from '../../../constants/menus'; | ||
import colors from '../../../lib/styles/colors'; | ||
import { withRouter } from 'react-router-dom'; | ||
|
||
const BannerBlock = styled.div` | ||
display: flex; | ||
justify-content: center; | ||
align-items: center; | ||
width: 95vw; | ||
max-width: 1366px; | ||
margin: 0px 0 10px 0; | ||
`; | ||
|
||
export const Banner = styled.div` | ||
cursor: pointer; | ||
display: flex; | ||
color: white; | ||
font-size: 0.9rem; | ||
font-weight: 600; | ||
justify-content: center; | ||
align-items: center; | ||
width: 95%; | ||
border-radius: 10px; | ||
box-shadow: ${colors.gray[1]}; | ||
height: 60px; | ||
background-color: ${colors.mint[2]}; | ||
transition: 0.3s; | ||
&:hover { | ||
transition: 0.3s; | ||
opacity: 0.75; | ||
//background-color: ${colors.mint[1]}; | ||
} | ||
`; | ||
|
||
const ApplyBanner = ({ history }) => { | ||
const redirectToApplyPage = () => { | ||
history.push(`/${MENU.APPLY}`); | ||
}; | ||
return ( | ||
<BannerBlock> | ||
{/* eslint-disable-next-line jsx-a11y/accessible-emoji */} | ||
<Banner onClick={redirectToApplyPage}> | ||
PoolC 신입회원 지원하러 가기 ✨ | ||
</Banner> | ||
</BannerBlock> | ||
); | ||
}; | ||
|
||
export default withRouter(ApplyBanner); |
41 changes: 41 additions & 0 deletions
41
src/containers/home/ApplyBannerContainer/ApplyBannerContainer.jsx
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,41 @@ | ||
import React, { useState, useEffect } from 'react'; | ||
import * as infoAPI from '../../../lib/api/info'; | ||
import Spinner from '../../../components/common/Spinner/Spinner'; | ||
import ApplyBanner from '../../../components/home/ApplyBanner/ApplyBanner'; | ||
import { useSelector } from 'react-redux'; | ||
|
||
const ApplyBannerContainer = () => { | ||
const [loading, setLoading] = useState(true); | ||
const [isSubscriptionPeriod, setIsSubscriptionPeriod] = useState(null); | ||
const [applyUri, setApplyUri] = useState(null); | ||
const member = useSelector((state) => state.auth); | ||
const isLogin = member.status.isLogin; | ||
const role = member.user.role; | ||
|
||
useEffect(() => { | ||
infoAPI.getPoolCInfo().then((res) => { | ||
if (res.status === 200) { | ||
setIsSubscriptionPeriod(res.data.isSubscriptionPeriod); | ||
setApplyUri(res.data.applyUri); | ||
setLoading(false); | ||
} | ||
}); | ||
}); | ||
|
||
if ( | ||
isSubscriptionPeriod == null || | ||
(isSubscriptionPeriod === true && applyUri == null) || | ||
isSubscriptionPeriod === false || | ||
(isLogin && role !== 'UNACCEPTED') | ||
) | ||
return null; | ||
|
||
return ( | ||
<> | ||
{loading && <Spinner />} | ||
{!loading && <ApplyBanner />} | ||
</> | ||
); | ||
}; | ||
|
||
export default ApplyBannerContainer; |
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