-
Notifications
You must be signed in to change notification settings - Fork 5
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 #425 from depromeet/develop
Merge to Main
- Loading branch information
Showing
11 changed files
with
382 additions
and
53 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
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,69 @@ | ||
import { css } from "@emotion/react"; | ||
import Cookies from "js-cookie"; | ||
|
||
import { BottomSheet } from "@/component/BottomSheet"; | ||
import { ButtonProvider } from "@/component/common/button"; | ||
import { Icon } from "@/component/common/Icon"; | ||
import { Typography } from "@/component/common/typography"; | ||
|
||
type AnnouncementProps = { title: string; content: React.ReactNode; onConfirm: () => void; sheetId: string }; | ||
|
||
export function Announcement({ title, content, onConfirm, sheetId }: AnnouncementProps) { | ||
const SHOW_ANNOUNCEMENT_KEY = "announcement-checked"; | ||
|
||
const hideAnnouncement = Cookies.get(SHOW_ANNOUNCEMENT_KEY); | ||
|
||
if (hideAnnouncement) return; | ||
|
||
return ( | ||
<BottomSheet | ||
sheetHeight={620} | ||
id={sheetId} | ||
contents={ | ||
<div | ||
css={css` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 2rem; | ||
overflow: hidden; | ||
height: 100%; | ||
`} | ||
> | ||
<div | ||
css={css` | ||
display: flex; | ||
flex-direction: column; | ||
align-items: center; | ||
gap: 1.6rem; | ||
`} | ||
> | ||
<Icon icon={"ic_letter"} size={4.8} /> | ||
<Typography variant={"title18Bold"} color={"gray900"}> | ||
{title} | ||
</Typography> | ||
</div> | ||
<div | ||
css={css` | ||
overflow-y: auto; | ||
::-webkit-scrollbar { | ||
display: block; | ||
} | ||
`} | ||
> | ||
{content} | ||
</div> | ||
|
||
<ButtonProvider.Primary | ||
onClick={() => { | ||
Cookies.set(SHOW_ANNOUNCEMENT_KEY, new Date().toISOString(), { expires: 1 }); | ||
onConfirm(); | ||
}} | ||
> | ||
확인 | ||
</ButtonProvider.Primary> | ||
</div> | ||
} | ||
/> | ||
); | ||
} |
48 changes: 0 additions & 48 deletions
48
apps/web/src/component/common/announcement/Announcement.tsx
This file was deleted.
Oops, something went wrong.
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,18 @@ | ||
import { Fragment, PropsWithChildren } from "react"; | ||
|
||
export function PreventExternalBrowser({ children }: PropsWithChildren) { | ||
const agent = navigator.userAgent; | ||
const URL = document.URL; | ||
const isKakao = agent.includes("KAKAO"); | ||
const isInstagram = agent.includes("Instagram"); | ||
|
||
if (isKakao) { | ||
window.open(`kakaotalk://web/openExternal?url=${encodeURIComponent(URL)}`); | ||
} else if (isInstagram) { | ||
/** | ||
* NOTE: 현재는 해당 인스타그램 인앱 탈출 코드가 작동하지 않는 것 같음 | ||
* 추후 카카오톡처럼 인스타그램 인앱 방지 분석 후 코드 추가 예정 | ||
*/ | ||
} | ||
return <Fragment> {children} </Fragment>; | ||
} |
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
Oops, something went wrong.