Skip to content

Commit 5a6f728

Browse files
authored
Merge pull request #422 from depromeet/chore/420/announce1109
인프라 이전 공지사항 추가
2 parents f1dec8c + 3aef83c commit 5a6f728

File tree

4 files changed

+149
-48
lines changed

4 files changed

+149
-48
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
import { css } from "@emotion/react";
2+
import Cookies from "js-cookie";
3+
4+
import { BottomSheet } from "@/component/BottomSheet";
5+
import { ButtonProvider } from "@/component/common/button";
6+
import { Icon } from "@/component/common/Icon";
7+
import { Typography } from "@/component/common/typography";
8+
9+
type AnnouncementProps = { title: string; content: React.ReactNode; onConfirm: () => void; sheetId: string };
10+
11+
export function Announcement({ title, content, onConfirm, sheetId }: AnnouncementProps) {
12+
const SHOW_ANNOUNCEMENT_KEY = "announcement-checked";
13+
14+
const hideAnnouncement = Cookies.get(SHOW_ANNOUNCEMENT_KEY);
15+
16+
if (hideAnnouncement) return;
17+
18+
return (
19+
<BottomSheet
20+
sheetHeight={620}
21+
id={sheetId}
22+
contents={
23+
<div
24+
css={css`
25+
display: flex;
26+
flex-direction: column;
27+
align-items: center;
28+
gap: 2rem;
29+
overflow: hidden;
30+
height: 100%;
31+
`}
32+
>
33+
<div
34+
css={css`
35+
display: flex;
36+
flex-direction: column;
37+
align-items: center;
38+
gap: 1.6rem;
39+
`}
40+
>
41+
<Icon icon={"ic_letter"} size={4.8} />
42+
<Typography variant={"title18Bold"} color={"gray900"}>
43+
{title}
44+
</Typography>
45+
</div>
46+
<div
47+
css={css`
48+
overflow-y: auto;
49+
::-webkit-scrollbar {
50+
display: block;
51+
}
52+
`}
53+
>
54+
{content}
55+
</div>
56+
57+
<ButtonProvider.Primary
58+
onClick={() => {
59+
Cookies.set(SHOW_ANNOUNCEMENT_KEY, new Date().toISOString(), { expires: 1 });
60+
onConfirm();
61+
}}
62+
>
63+
확인
64+
</ButtonProvider.Primary>
65+
</div>
66+
}
67+
/>
68+
);
69+
}

apps/web/src/component/common/announcement/Announcement.tsx

-48
This file was deleted.

apps/web/src/layout/GlobalLayout.tsx

+76
Original file line numberDiff line numberDiff line change
@@ -4,20 +4,28 @@ import { PATHS } from "@layer/shared";
44
import { useEffect } from "react";
55
import { Outlet, useLocation } from "react-router-dom";
66

7+
import { Announcement } from "@/component/announcement/Announcement";
78
import { Modal } from "@/component/common/Modal";
9+
import { Typography } from "@/component/common/typography";
810
import { PreventExternalBrowser } from "@/helper/preventExternalBrowser.tsx";
11+
import { useBottomSheet } from "@/hooks/useBottomSheet";
12+
import { useToast } from "@/hooks/useToast";
913
import ChannelService from "@/lib/channel-talk/service";
1014
import { useBridge } from "@/lib/provider/bridge-provider";
1115

1216
const siteId = import.meta.env.VITE_HOTJAR_KEY as number;
1317
const hotjarVersion = import.meta.env.VITE_HOTJAR_VERSION as number;
18+
const SHEET_ID = "announcement";
1419

1520
export default function GlobalLayout() {
1621
const { safeAreaHeight } = useBridge();
1722
const location = useLocation();
23+
const { openBottomSheet, closeBottomSheet } = useBottomSheet();
24+
const { toast } = useToast();
1825

1926
useEffect(() => {
2027
Hotjar.init(siteId, hotjarVersion);
28+
openBottomSheet({ id: SHEET_ID });
2129
}, []);
2230

2331
useEffect(() => {
@@ -47,6 +55,74 @@ export default function GlobalLayout() {
4755
${safeAreaHeight && { height: `calc(100dvh-${safeAreaHeight * 2}px)` }}
4856
`}
4957
>
58+
<Announcement
59+
sheetId={SHEET_ID}
60+
onConfirm={closeBottomSheet}
61+
title="인프라 이전 안내"
62+
content={
63+
<>
64+
<Typography
65+
as="p"
66+
variant={"body16Medium"}
67+
color={"gray600"}
68+
css={css`
69+
white-space: pre-wrap;
70+
`}
71+
>
72+
{`안녕하세요, 레이어 서비스입니다.
73+
항상 저희 서비스를 이용해 주셔서 감사드립니다.
74+
75+
서비스 품질 향상을 위한 인프라 이전을 진행하고자 하오니 잠시 양해를 부탁드립니다.
76+
작업 진행 시간 동안 서비스가 접속이 되지 않거나 느려지는 현상이 있을 수 있으니 이용에 참고하시기 바랍니다.
77+
78+
1. 점검 시간
79+
80+
2024년 11월 10일(일) 13:00 ~ 22:00
81+
※ 모든 시간은 한국시간 기준입니다.
82+
※ 작업 진행상황에 따라 일정은 변경될 수 있습니다.
83+
84+
2. 대상 서비스
85+
86+
레이어 서비스
87+
88+
해당 기간동안 궁금하신 점은`}
89+
</Typography>
90+
<Typography
91+
variant={"body16Medium"}
92+
color={"blue500"}
93+
css={css`
94+
text-decoration: underline;
95+
cursor: pointer;
96+
`}
97+
onClick={async () => {
98+
try {
99+
await navigator.clipboard.writeText("gentlemonster77@likelion.org");
100+
toast.success("이메일이 클립보드에 복사되었습니다");
101+
} catch (e) {
102+
toast.success("다시 시도해주세요");
103+
}
104+
}}
105+
>
106+
gentlemonster77@likelion.org
107+
</Typography>
108+
<Typography
109+
as="p"
110+
variant={"body16Medium"}
111+
color={"gray600"}
112+
css={css`
113+
white-space: pre-wrap;
114+
`}
115+
>
116+
{`로 문의를 주시면 빠르게 확인 후 순차적으로 답변 드리겠습니다.
117+
118+
이용에 불편을 드려 죄송합니다.
119+
보다 안정적인 서비스를 제공하기 위해 노력하는 레이어가 되겠습니다.
120+
121+
감사합니다.`}
122+
</Typography>
123+
</>
124+
}
125+
/>
50126
<Modal />
51127
<PreventExternalBrowser>
52128
<Outlet />

apps/web/src/style/global.css

+4
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,10 @@ textarea {
6363
resize: none;
6464
}
6565

66+
p {
67+
margin: 0;
68+
}
69+
6670
::-webkit-scrollbar {
6771
border: none;
6872
width: 1rem;

0 commit comments

Comments
 (0)