11import { AnimatedButton , Button } from 'components/common' ;
22import Breakpoints from 'constants/breakpoints' ;
3+ import Path from 'constants/path' ;
34import Yapp from 'constants/yapp' ;
45import {
56 IS_RECRUITING ,
@@ -8,12 +9,15 @@ import {
89 RECRUIT_BANNER_ACTIVE ,
910} from 'database/recruit' ;
1011import DOMPurify from 'isomorphic-dompurify' ;
12+ import { useRouter } from 'next/router' ;
1113import styled from 'styled-components' ;
1214import media from 'styles/media' ;
1315
1416function RecruitBanner ( ) {
1517 const BannerInfo = IS_RECRUITING ? RECRUIT_BANNER_ACTIVE : RECRUIT_BANNER ;
16- const { title, description } = BannerInfo ;
18+ const { title, description, buttonName } = BannerInfo ;
19+ const buttonParams = IS_RECRUITING ? { width : 168 } : { width : 190 } ;
20+ const router = useRouter ( ) ;
1721
1822 return (
1923 < RecruitBannerContainer >
@@ -31,15 +35,34 @@ function RecruitBanner() {
3135 }
3236 rel = "noreferrer"
3337 >
34- < ApplyButton
35- width = { 220 }
36- height = { 65 }
37- fontColor = "white"
38- buttonColor = "grey_850"
39- borderColor = "lightGrey"
40- >
41- { IS_RECRUITING ? '모든 공고 보기' : '지원마감' }
42- </ ApplyButton >
38+ { IS_RECRUITING ? (
39+ < ApplyButton
40+ width = { 220 }
41+ height = { 65 }
42+ fontColor = "white"
43+ buttonColor = "grey_850"
44+ borderColor = "lightGrey"
45+ >
46+ { '모든 공고 보기' }
47+ </ ApplyButton >
48+ ) : (
49+ < AnimatedButton
50+ height = { 65 }
51+ fontColor = "white"
52+ buttonColor = "grey_850"
53+ className = "recruitButton"
54+ buttonText = { buttonName }
55+ onClick = { ( ) => {
56+ if ( ! IS_RECRUITING ) {
57+ window . location . href = NEXT_GENERATION_RECRUIT_LINK ;
58+ return ;
59+ }
60+
61+ router . push ( Path . Recruit ) ;
62+ } }
63+ { ...buttonParams }
64+ />
65+ ) }
4366 </ ButtonBlock >
4467 </ BannerInner >
4568 </ RecruitBannerContainer >
0 commit comments