Skip to content

Commit 33938c4

Browse files
리니_이경린lgrin-byte
authored andcommitted
feat: 앱 다운로드 링크 페이지 ios/안드로이드 리다이렉트 되도록 (#152)
1 parent 85a5b78 commit 33938c4

File tree

3 files changed

+25
-0
lines changed

3 files changed

+25
-0
lines changed

src/constants/path.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,6 @@ export const PATH = {
88
REVIEW_RESULT: "/review-result",
99
LOADING: "/loading",
1010
CREATE_REVIEW_FAIL: "/create-review-fail",
11+
APP_DOWNLOAD: "/download",
12+
1113
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
2+
import { useUserAgent } from '@/components/provider/UserAgentProvider';
3+
4+
export default function DownloadPage() {
5+
6+
const userAgent = useUserAgent();
7+
8+
const isIOS = userAgent.isIOS;
9+
10+
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';
11+
const androidPlayStoreUrl = 'https://play.google.com/store/apps/details?id=com.nexters.misik';
12+
13+
if (isIOS) {
14+
window.location.href = iosAppStoreUrl;
15+
} else{
16+
window.location.href = androidPlayStoreUrl;
17+
}
18+
return (
19+
<></>
20+
)
21+
}

src/router/AppRouter.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import App from "@/App";
55
import { PATH } from "@/constants/path";
66

77
import CreateReviewFailPage from "@/pages/CreateReviewFailPage/CreateReviewFailPage";
8+
import DownloadPage from "@/pages/DownloadPage/DownloadPage";
89
import HomePage from "@/pages/HomePage/HomePage";
910
import LoadingPage from "@/pages/LoadingPage/LoadingPage";
1011
import ReceiptEditPage from "@/pages/ReceiptEditPage/ReceiptEditPage";
@@ -53,6 +54,7 @@ const AppRouter = () => {
5354
element: <ReviewResultPage />,
5455
},
5556
{ path: PATH.CREATE_REVIEW_FAIL, element: <CreateReviewFailPage /> },
57+
{ path: PATH.APP_DOWNLOAD, element: <DownloadPage /> },
5658
],
5759
},
5860
]);

0 commit comments

Comments
 (0)