Skip to content

Commit

Permalink
Merge pull request #422 from depromeet/chore/420/announce1109
Browse files Browse the repository at this point in the history
인프라 이전 공지사항 추가
  • Loading branch information
leeminhee119 authored Nov 9, 2024
2 parents f1dec8c + 3aef83c commit 5a6f728
Show file tree
Hide file tree
Showing 4 changed files with 149 additions and 48 deletions.
69 changes: 69 additions & 0 deletions apps/web/src/component/announcement/Announcement.tsx
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 apps/web/src/component/common/announcement/Announcement.tsx

This file was deleted.

76 changes: 76 additions & 0 deletions apps/web/src/layout/GlobalLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,28 @@ import { PATHS } from "@layer/shared";
import { useEffect } from "react";
import { Outlet, useLocation } from "react-router-dom";

import { Announcement } from "@/component/announcement/Announcement";
import { Modal } from "@/component/common/Modal";
import { Typography } from "@/component/common/typography";
import { PreventExternalBrowser } from "@/helper/preventExternalBrowser.tsx";
import { useBottomSheet } from "@/hooks/useBottomSheet";
import { useToast } from "@/hooks/useToast";
import ChannelService from "@/lib/channel-talk/service";
import { useBridge } from "@/lib/provider/bridge-provider";

const siteId = import.meta.env.VITE_HOTJAR_KEY as number;
const hotjarVersion = import.meta.env.VITE_HOTJAR_VERSION as number;
const SHEET_ID = "announcement";

export default function GlobalLayout() {
const { safeAreaHeight } = useBridge();
const location = useLocation();
const { openBottomSheet, closeBottomSheet } = useBottomSheet();
const { toast } = useToast();

useEffect(() => {
Hotjar.init(siteId, hotjarVersion);
openBottomSheet({ id: SHEET_ID });
}, []);

useEffect(() => {
Expand Down Expand Up @@ -47,6 +55,74 @@ export default function GlobalLayout() {
${safeAreaHeight && { height: `calc(100dvh-${safeAreaHeight * 2}px)` }}
`}
>
<Announcement
sheetId={SHEET_ID}
onConfirm={closeBottomSheet}
title="인프라 이전 안내"
content={
<>
<Typography
as="p"
variant={"body16Medium"}
color={"gray600"}
css={css`
white-space: pre-wrap;
`}
>
{`안녕하세요, 레이어 서비스입니다.
항상 저희 서비스를 이용해 주셔서 감사드립니다.
서비스 품질 향상을 위한 인프라 이전을 진행하고자 하오니 잠시 양해를 부탁드립니다.
작업 진행 시간 동안 서비스가 접속이 되지 않거나 느려지는 현상이 있을 수 있으니 이용에 참고하시기 바랍니다.
1. 점검 시간
2024년 11월 10일(일) 13:00 ~ 22:00
※ 모든 시간은 한국시간 기준입니다.
※ 작업 진행상황에 따라 일정은 변경될 수 있습니다.
2. 대상 서비스
레이어 서비스
해당 기간동안 궁금하신 점은`}
</Typography>
<Typography
variant={"body16Medium"}
color={"blue500"}
css={css`
text-decoration: underline;
cursor: pointer;
`}
onClick={async () => {
try {
await navigator.clipboard.writeText("[email protected]");
toast.success("이메일이 클립보드에 복사되었습니다");
} catch (e) {
toast.success("다시 시도해주세요");
}
}}
>
[email protected]
</Typography>
<Typography
as="p"
variant={"body16Medium"}
color={"gray600"}
css={css`
white-space: pre-wrap;
`}
>
{`로 문의를 주시면 빠르게 확인 후 순차적으로 답변 드리겠습니다.
이용에 불편을 드려 죄송합니다.
보다 안정적인 서비스를 제공하기 위해 노력하는 레이어가 되겠습니다.
감사합니다.`}
</Typography>
</>
}
/>
<Modal />
<PreventExternalBrowser>
<Outlet />
Expand Down
4 changes: 4 additions & 0 deletions apps/web/src/style/global.css
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ textarea {
resize: none;
}

p {
margin: 0;
}

::-webkit-scrollbar {
border: none;
width: 1rem;
Expand Down

0 comments on commit 5a6f728

Please sign in to comment.