-
Notifications
You must be signed in to change notification settings - Fork 2
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
#728 2024 봄 이벤트 퀘스트 페이지 만들기
- Loading branch information
Showing
13 changed files
with
321 additions
and
100 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
61 changes: 48 additions & 13 deletions
61
packages/web/src/components/Event/CreditAmoutContainer/index.tsx
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
125 changes: 125 additions & 0 deletions
125
packages/web/src/components/Event/SuggestJoinEventContainer/index.tsx
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,125 @@ | ||
import { memo, useMemo, useState } from "react"; | ||
|
||
import { useIsLogin, useValueRecoilState } from "@/hooks/useFetchRecoilState"; | ||
|
||
import Button from "@/components/Button"; | ||
import { | ||
ModalEvent2023FallJoin, | ||
ModalNotification, | ||
} from "@/components/ModalPopup"; | ||
import WhiteContainer from "@/components/WhiteContainer"; | ||
|
||
import eventTheme from "@/tools/eventTheme"; | ||
import theme from "@/tools/theme"; | ||
|
||
const SuggestJoinEventContainer = () => { | ||
const isLogin = useIsLogin(); | ||
const { isAgreeOnTermsOfEvent, completedQuests } = | ||
useValueRecoilState("event2024SpringInfo") || {}; | ||
|
||
const randomToken = useMemo(() => !!Math.floor(Math.random() * 2), []); | ||
const [isOpenJoin, setIsOpenJoin] = useState<boolean>(false); | ||
const [isOpenNotification, setIsOpenNotification] = useState<boolean>(false); | ||
|
||
const styleButton = { | ||
padding: "12px", | ||
borderRadius: "12px", | ||
...eventTheme.font12_bold, | ||
background: eventTheme.blue_title, | ||
}; | ||
const styleTitle = { | ||
...eventTheme.font16_bold, | ||
background: eventTheme.blue_title, | ||
backgroundClip: "text", | ||
textFillColor: "transparent", | ||
marginBottom: "4px", | ||
}; | ||
const styleDescription = { | ||
...eventTheme.font10, | ||
color: theme.white, | ||
margin: "12px", | ||
}; | ||
|
||
return ( | ||
<> | ||
{!isLogin ? null : !isAgreeOnTermsOfEvent ? ( | ||
<WhiteContainer | ||
css={{ | ||
padding: "14px 16px", | ||
background: eventTheme.black, | ||
border: "1px solid #FFF", | ||
}} | ||
> | ||
<div css={styleTitle}>🌟 첫 발걸음</div> | ||
<div css={styleDescription}> | ||
이벤트 참여 동의 이후 퀘스트 달성이 가능합니다. 많은 혜택과 기회를 | ||
놓치지 마세요! | ||
</div> | ||
<Button | ||
type="purple" | ||
css={styleButton} | ||
onClick={() => setIsOpenJoin(true)} | ||
> | ||
이벤트 참여하기 | ||
</Button> | ||
</WhiteContainer> | ||
) : randomToken && | ||
completedQuests && | ||
!completedQuests.includes("adPushAgreement") ? ( | ||
<WhiteContainer | ||
css={{ | ||
padding: "14px 16px", | ||
background: eventTheme.black, | ||
border: "1px solid #FFF", | ||
}} | ||
> | ||
<div css={styleTitle}>🌟 Taxi의 소울메이트</div> | ||
<div css={styleDescription}> | ||
Taxi 서비스를 잊지 않도록 가끔 찾아갈게요! 광고성 푸시 알림 수신 | ||
동의를 해주시면 방이 많이 모이는 시즌, 주변에 택시앱 사용자가 있을 | ||
때 알려드릴 수 있어요. | ||
</div> | ||
<Button | ||
type="purple" | ||
css={styleButton} | ||
onClick={() => setIsOpenNotification(true)} | ||
> | ||
광고성 푸시 알림 수신 동의하고 넙죽코인 50개 얻기 | ||
</Button> | ||
</WhiteContainer> | ||
) : completedQuests && !completedQuests.includes("adPushAgreement") ? ( | ||
<WhiteContainer | ||
css={{ | ||
padding: "14px 16px", | ||
background: eventTheme.black, | ||
border: "1px solid #FFF", | ||
}} | ||
> | ||
<div css={styleTitle}>🌟 Taxi의 소울메이트</div> | ||
<div css={styleDescription}> | ||
Taxi 서비스를 잊지 않도록 가끔 찾아갈게요! 광고성 푸시 알림 수신 | ||
동의를 해주시면 방이 많이 모이는 시즌, 주변에 택시앱 사용자가 있을 | ||
때 알려드릴 수 있어요. | ||
</div> | ||
<Button | ||
type="purple" | ||
css={styleButton} | ||
onClick={() => setIsOpenNotification(true)} | ||
> | ||
광고성 푸시 알림 수신 동의하고 넙죽코인 50개 얻기 | ||
</Button> | ||
</WhiteContainer> | ||
) : null} | ||
<ModalEvent2023FallJoin | ||
isOpen={isOpenJoin} | ||
onChangeIsOpen={setIsOpenJoin} | ||
/> | ||
<ModalNotification | ||
isOpen={isOpenNotification} | ||
onChangeIsOpen={setIsOpenNotification} | ||
/> | ||
</> | ||
); | ||
}; | ||
|
||
export default memo(SuggestJoinEventContainer); |
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,13 @@ | ||
import { CSSProperties, useEffect } from "react"; | ||
|
||
export const useEventBackgroundEffect = ( | ||
color: CSSProperties["color"] = "#000000" | ||
) => { | ||
useEffect(() => { | ||
const prevBackground = document.body.style.background; | ||
document.body.style.background = color; | ||
return () => { | ||
document.body.style.background = prevBackground; | ||
}; | ||
}, [color]); | ||
}; |
Oops, something went wrong.