11import { css } from "@emotion/react" ;
22import Hotjar from "@hotjar/browser" ;
3- // import { PATHS } from "@layer/shared";
3+ import { PATHS } from "@layer/shared" ;
44import { useEffect } from "react" ;
5- import { Outlet } from "react-router-dom" ;
6- // import { useLocation } from "react-router-dom";
5+ import { Outlet , useLocation } from "react-router-dom" ;
76
8- import { Announcement } from "@/component/announcement/Announcement" ;
97import { Modal } from "@/component/common/Modal" ;
10- import { Typography } from "@/component/common/typography" ;
118import { PreventExternalBrowser } from "@/helper/preventExternalBrowser.tsx" ;
12- import { useBottomSheet } from "@/hooks/useBottomSheet" ;
13- // import ChannelService from "@/lib/channel-talk/service";
9+ import ChannelService from "@/lib/channel-talk/service" ;
1410import { useBridge } from "@/lib/provider/bridge-provider" ;
1511
1612const siteId = import . meta. env . VITE_HOTJAR_KEY as number ;
1713const hotjarVersion = import . meta. env . VITE_HOTJAR_VERSION as number ;
18- const SHEET_ID = "announcement" ;
1914
2015export default function GlobalLayout ( ) {
16+ const location = useLocation ( ) ;
2117 const { safeAreaHeight } = useBridge ( ) ;
22- const { openBottomSheet, closeBottomSheet } = useBottomSheet ( ) ;
2318
2419 useEffect ( ( ) => {
2520 Hotjar . init ( siteId , hotjarVersion ) ;
26- openBottomSheet ( { id : SHEET_ID } ) ;
2721 } , [ ] ) ;
2822
29- /* NOTE - 인프라 이전 기간동안 채널톡 모든 페이지 노출 */
30- // useEffect(() => {
31- // if (location.pathname.startsWith(PATHS.myInfo())) {
32- // ChannelService.showChannelButton();
33- // } else {
34- // ChannelService.hideChannelButton();
35- // }
36- // }, [location]);
23+ useEffect ( ( ) => {
24+ if ( location . pathname . startsWith ( PATHS . myInfo ( ) ) ) {
25+ ChannelService . showChannelButton ( ) ;
26+ } else {
27+ ChannelService . hideChannelButton ( ) ;
28+ }
29+ } , [ location ] ) ;
3730
3831 return (
3932 < div
@@ -54,65 +47,6 @@ export default function GlobalLayout() {
5447 ${ safeAreaHeight && { height : `calc(100dvh-${ safeAreaHeight * 2 } px)` } }
5548 ` }
5649 >
57- < Announcement
58- sheetId = { SHEET_ID }
59- onConfirm = { closeBottomSheet }
60- title = "인프라 이전 안내"
61- content = {
62- < >
63- < Typography
64- variant = { "body16Medium" }
65- color = { "gray600" }
66- css = { css `
67- white-space : pre-wrap;
68- ` }
69- >
70- { `안녕하세요, 레이어 서비스입니다.
71- 항상 저희 서비스를 이용해 주셔서 감사드립니다.
72-
73- 서비스 품질 향상을 위한 인프라 이전을 진행하고자 하오니 잠시 양해를 부탁드립니다.
74- 작업 진행 시간 동안 서비스가 접속이 되지 않거나 느려지는 현상이 있을 수 있으니 이용에 참고하시기 바랍니다.
75-
76- 1. 점검 시간
77-
78- ` }
79- </ Typography >
80- < Typography variant = { "subtitle16SemiBold" } > 2024년 11월 10일(일) 13:00 ~ 22:00</ Typography >
81- < Typography
82- variant = { "body16Medium" }
83- color = { "gray600" }
84- css = { css `
85- white-space : pre-wrap;
86- ` }
87- >
88- { `
89- ※ 모든 시간은 한국시간 기준입니다.
90- ※ 작업 진행상황에 따라 일정은 변경될 수 있습니다.
91-
92- 2. 대상 서비스
93-
94- 레이어 서비스
95-
96- 해당 기간동안 궁금하신 점은 ` }
97- </ Typography >
98- < Typography variant = { "subtitle16SemiBold" } > 페이지 하단의 문의하기</ Typography >
99- < Typography
100- variant = { "body16Medium" }
101- color = { "gray600" }
102- css = { css `
103- white-space : pre-wrap;
104- ` }
105- >
106- { `를 통해 채팅 남겨주시면 빠르게 확인 후 순차적으로 답변 드리겠습니다.
107-
108- 이용에 불편을 드려 죄송합니다.
109- 보다 안정적인 서비스를 제공하기 위해 노력하는 레이어가 되겠습니다.
110-
111- 감사합니다.` }
112- </ Typography >
113- </ >
114- }
115- />
11650 < Modal />
11751 < PreventExternalBrowser >
11852 < Outlet />
0 commit comments