File tree Expand file tree Collapse file tree 2 files changed +28
-8
lines changed
Expand file tree Collapse file tree 2 files changed +28
-8
lines changed Original file line number Diff line number Diff line change @@ -7,14 +7,27 @@ import {
77 DropdownMenuTrigger ,
88} from "@/components/ui/dropdown-menu" ;
99import { ChevronDown } from "lucide-react" ;
10+ import { useToast } from "@/hooks/use-toast" ;
1011
1112interface StartButtonProps {
1213 location : string ;
1314}
1415
1516export const StartButton = ( { location } : StartButtonProps ) => {
17+ const { toast } = useToast ( ) ;
18+
1619 const handleClick = ( platform ?: Platform ) => {
1720 trackButtonClick ( "start_btn" , location ) ;
21+
22+ if ( platform === "android" ) {
23+ toast ( {
24+ title : "출시 준비 중" ,
25+ description : "안드로이드 앱은 현재 출시 준비 중입니다." ,
26+ } ) ;
27+
28+ return ;
29+ }
30+
1831 openKanataApp ( platform ) ;
1932 } ;
2033
Original file line number Diff line number Diff line change @@ -8,25 +8,32 @@ export function cn(...inputs: ClassValue[]) {
88
99export type Platform = "android" | "ios" | "web" | "auto" ;
1010
11- export type DeviceType = "mobile " | "desktop" ;
11+ export type DeviceType = "android" | "ios " | "desktop" ;
1212
13+ // TODO: 안드로이드 출시 후 ONE_LINK 연결
1314const ONE_LINK = "https://kanata.onelink.me/dYmZ/vukegfoa" ;
1415
1516export function getPlatformUrl ( platform : Platform ) : string {
1617 switch ( platform ) {
17- case "android" :
18- return ONE_LINK ;
1918 case "ios" :
2019 return ONE_LINK ;
21- case "web" :
20+ default :
2221 return "https://kanata.live" ;
2322 }
2423}
2524
26- function getDeviceType ( ) {
25+ function getDeviceType ( ) : DeviceType {
2726 const userAgent = navigator . userAgent || navigator . vendor || "" ;
28- const isMobile = / a n d r o i d | i P a d | i P h o n e | i P o d / i. test ( userAgent ) ;
29- return isMobile ? "mobile" : "desktop" ;
27+
28+ if ( / a n d r o i d / i. test ( userAgent ) ) {
29+ return "android" ;
30+ }
31+
32+ if ( / i P a d | i P h o n e | i P o d / i. test ( userAgent ) ) {
33+ return "ios" ;
34+ }
35+
36+ return "desktop" ;
3037}
3138
3239export function openKanataApp ( platform ?: Platform ) {
@@ -36,7 +43,7 @@ export function openKanataApp(platform?: Platform) {
3643 if ( platform ) {
3744 url = getPlatformUrl ( platform ) ;
3845 } else {
39- url = deviceType === "mobile " ? ONE_LINK : "https://kanata.live" ;
46+ url = deviceType === "ios " ? ONE_LINK : "https://kanata.live" ;
4047 }
4148
4249 trackAppOpen ( deviceType , platform ) ;
You can’t perform that action at this time.
0 commit comments