From 2cea9110d73711d3eaf2d75ff26548f82074bf61 Mon Sep 17 00:00:00 2001 From: Seojin Kim Date: Mon, 16 Jan 2023 04:10:48 +0900 Subject: [PATCH 1/3] =?UTF-8?q?=E2=9C=A8feat:=20CommonModal=EC=97=90?= =?UTF-8?q?=EC=84=9C=20=ED=99=95=EC=9D=B8=20=EB=B2=84=ED=8A=BC=20label?= =?UTF-8?q?=EC=9D=84=20prop=EC=9C=BC=EB=A1=9C=20=EB=B0=9B=EB=8F=84?= =?UTF-8?q?=EB=A1=9D=20=EC=88=98=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/presentation/components/common/Modal/index.tsx | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/presentation/components/common/Modal/index.tsx b/src/presentation/components/common/Modal/index.tsx index e82d713d..f9fef790 100644 --- a/src/presentation/components/common/Modal/index.tsx +++ b/src/presentation/components/common/Modal/index.tsx @@ -8,10 +8,11 @@ interface CommonModalProps { title: string; description?: string; isOpened: boolean; + confirmLabel?: string; } export default function CommonModal(props: CommonModalProps) { - const { onClickConfirm, onClickCancel, title, description, isOpened } = props; + const { onClickConfirm, onClickCancel, title, description, isOpened, confirmLabel } = props; return ( @@ -20,7 +21,7 @@ export default function CommonModal(props: CommonModalProps) { {description && {description}}
- +
From e156a3efd61a3ef2dafaaa1df07e666c84ddb1b8 Mon Sep 17 00:00:00 2001 From: Seojin Kim Date: Mon, 16 Jan 2023 04:12:12 +0900 Subject: [PATCH 2/3] =?UTF-8?q?=E2=9C=A8feat:=20=EC=9D=B8=EC=95=B1?= =?UTF-8?q?=EB=B8=8C=EB=9D=BC=EC=9A=B0=EC=A0=80=20=EA=B2=BD=EA=B3=A0=20?= =?UTF-8?q?=EB=AA=A8=EB=8B=AC=EC=9D=B4=20=EB=A1=9C=EA=B7=B8=EC=9D=B8?= =?UTF-8?q?=EB=90=98=EC=97=88=EC=9D=84=20=EB=95=8C=EB=A7=8C=20=EB=93=B1?= =?UTF-8?q?=EC=9E=A5=ED=95=98=EB=8F=84=EB=A1=9D=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../components/InAppBrowserEscape/index.tsx | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/presentation/components/InAppBrowserEscape/index.tsx b/src/presentation/components/InAppBrowserEscape/index.tsx index 5ef6e9f9..3c71af4d 100644 --- a/src/presentation/components/InAppBrowserEscape/index.tsx +++ b/src/presentation/components/InAppBrowserEscape/index.tsx @@ -1,8 +1,12 @@ import CommonModal from '@components/common/Modal'; -import React, { useCallback, useEffect, useState } from 'react'; +import { useCallback, useEffect, useState } from 'react'; + +import { useLoginUser } from '@hooks/useLoginUser'; const InAppBrowserEscape = () => { const [isModalOpened, setIsModalOpened] = useState(false); + const { isAuthenticated } = useLoginUser(); + const openRealBrowser = useCallback(() => { const isIOS = navigator.userAgent.match(/iPhone|iPad/i); if (isIOS) { @@ -14,12 +18,15 @@ const InAppBrowserEscape = () => { '#Intent;scheme=http;package=com.android.chrome;end'; } }, []); + useEffect(() => { + if (!isAuthenticated) return; + const isInAppBrowser = navigator.userAgent.match( /inapp|NAVER|KAKAOTALK|Snapchat|Line|WirtschaftsWoche|Thunderbird|Instagram|everytimeApp|WhatsApp|Electron|wadiz|AliApp|zumapp|iPhone(.*)Whale|Android(.*)Whale|kakaostory|band|twitter|DaumApps|DaumDevice\/mobile|FB_IAB|FB4A|FBAN|FBIOS|FBSS|SamsungBrowser\/[^1]/i, ); if (isInAppBrowser !== null) setIsModalOpened(true); - }, []); + }, [isAuthenticated]); return ( Date: Mon, 16 Jan 2023 04:12:38 +0900 Subject: [PATCH 3/3] =?UTF-8?q?=E2=9C=A8feat:=20=EC=9D=B8=EC=95=B1=20?= =?UTF-8?q?=EB=B8=8C=EB=9D=BC=EC=9A=B0=EC=A0=80=20=EA=B2=BD=EA=B3=A0=20?= =?UTF-8?q?=EA=B4=80=EB=A0=A8=20=EB=AC=B8=EA=B5=AC=20=EB=B3=80=EA=B2=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/presentation/components/InAppBrowserEscape/index.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/presentation/components/InAppBrowserEscape/index.tsx b/src/presentation/components/InAppBrowserEscape/index.tsx index 3c71af4d..860abcfe 100644 --- a/src/presentation/components/InAppBrowserEscape/index.tsx +++ b/src/presentation/components/InAppBrowserEscape/index.tsx @@ -32,10 +32,15 @@ const InAppBrowserEscape = () => { setIsModalOpened(false)} onClickConfirm={openRealBrowser} + confirmLabel="크롬에서 보기" isOpened={isModalOpened} /> );