diff --git a/src/constants/path.ts b/src/constants/path.ts index ff89d31..43867c3 100644 --- a/src/constants/path.ts +++ b/src/constants/path.ts @@ -8,4 +8,6 @@ export const PATH = { REVIEW_RESULT: "/review-result", LOADING: "/loading", CREATE_REVIEW_FAIL: "/create-review-fail", + APP_DOWNLOAD: "/download", + }; diff --git a/src/pages/DownloadPage/DownloadPage.tsx b/src/pages/DownloadPage/DownloadPage.tsx new file mode 100644 index 0000000..3c973a0 --- /dev/null +++ b/src/pages/DownloadPage/DownloadPage.tsx @@ -0,0 +1,21 @@ + +import { useUserAgent } from '@/components/provider/UserAgentProvider'; + +export default function DownloadPage() { + + const userAgent = useUserAgent(); + + const isIOS = userAgent.isIOS; + + const iosAppStoreUrl = 'https://apps.apple.com/kr/app/%EB%AF%B8%EC%8B%9D-misik-ai-%EC%98%81%EC%88%98%EC%A6%9D-%EB%A6%AC%EB%B7%B0/id6741109313'; + const androidPlayStoreUrl = 'https://play.google.com/store/apps/details?id=com.nexters.misik'; + + if (isIOS) { + window.location.href = iosAppStoreUrl; + } else{ + window.location.href = androidPlayStoreUrl; + } + return ( + <> + ) +} diff --git a/src/router/AppRouter.tsx b/src/router/AppRouter.tsx index ab97d7e..3212122 100644 --- a/src/router/AppRouter.tsx +++ b/src/router/AppRouter.tsx @@ -5,6 +5,7 @@ import App from "@/App"; import { PATH } from "@/constants/path"; import CreateReviewFailPage from "@/pages/CreateReviewFailPage/CreateReviewFailPage"; +import DownloadPage from "@/pages/DownloadPage/DownloadPage"; import HomePage from "@/pages/HomePage/HomePage"; import LoadingPage from "@/pages/LoadingPage/LoadingPage"; import ReceiptEditPage from "@/pages/ReceiptEditPage/ReceiptEditPage"; @@ -53,6 +54,7 @@ const AppRouter = () => { element: , }, { path: PATH.CREATE_REVIEW_FAIL, element: }, + { path: PATH.APP_DOWNLOAD, element: }, ], }, ]);