diff --git a/layers/components/blocks/Button/Launcher.vue b/layers/components/blocks/Button/Launcher.vue index c9edde2..1f97cdf 100644 --- a/layers/components/blocks/Button/Launcher.vue +++ b/layers/components/blocks/Button/Launcher.vue @@ -1,5 +1,6 @@ @@ -100,14 +158,14 @@ const handleClick = () => { diff --git a/layers/components/layouts/Header.vue b/layers/components/layouts/Header.vue index c4c5c7e..b782288 100644 --- a/layers/components/layouts/Header.vue +++ b/layers/components/layouts/Header.vue @@ -6,26 +6,18 @@ import type { GameDataMenuChildren, GameDataResourceGroup, GameDataResourceGroupSet, - PlatformTransformType, } from '#layers/types/api/gameData' const MORE_WIDTH = 72 const START_WIDTH_MARGIN = 40 -const PLATFORM_LABEL_KEY: Record = { - pc: 'PC', - google_play: 'Google Play', - app_store: 'App Store', -} as const const route = useRoute() const { tm } = useI18n() const { width } = useWindowSize() -const device = useDevice() const gameDataStore = useGameDataStore() const pageDataStore = usePageDataStore() const scrollStore = useScrollStore() const breakpoints = useResponsiveBreakpoints() -const modalStore = useModalStore() const { gameData } = storeToRefs(gameDataStore) const { pageLayoutType } = storeToRefs(pageDataStore) @@ -55,16 +47,8 @@ const start1depthData = computed( const start2depthData = computed( () => gnbData.value?.buttons[1]?.button_json as GameDataResourceGroupSet ) -const supportedPlatforms = computed( - () => - getSupportedPlatforms( - gameData.value?.platform_type, - gameData.value?.os_type - ) as PlatformTransformType[] -) -const isStartPCVisible = computed(() => { - return device.isDesktop && gameData.value?.platform_type !== '2' -}) + +console.log('start2depthData', start2depthData.value) // 자식 중 활성 링크 존재 여부 확인 const hasActiveChild = (children?: GameDataMenuChildren) => { @@ -158,52 +142,6 @@ const has2depthButton = (gnbItem: GameDataMenu) => { return gnbItem.children && Object.keys(gnbItem.children).length > 0 } -const highlight = (text: string) => `${text}` - -const tmWithGameName = (key: string): string => { - const raw = tm(key) - if (typeof raw !== 'string') return '' - - const withName = raw.replace( - /%게임명%/g, - highlight(gameData.value?.game_name || '') - ) - - const platformLines = supportedPlatforms.value - .map(platform => highlight(PLATFORM_LABEL_KEY[platform] as string)) - .filter(Boolean) - - return platformLines.length - ? `${withName}

${platformLines.join('
')}` - : withName -} - -const showNotSupportedOSAlert = () => { - return modalStore.handleOpenAlert({ - contentText: tmWithGameName('Alert_Not_SupportedOS'), - }) -} - -const handleStartClick = () => { - if (isStartPCVisible.value) return - - const target = device.isAndroid - ? 'google_play' - : device.isApple - ? 'app_store' - : null - - if (!target || !supportedPlatforms.value.includes(target)) { - showNotSupportedOSAlert() - return - } - - const url = gameData.value?.market_json?.[target]?.url || '' - if (!url) return showNotSupportedOSAlert() - - window.open(url, '_blank') -} - onMounted(() => { overflowCount.value = 0 isMounted.value = true @@ -263,14 +201,14 @@ onMounted(() => {