fix: 홈 화면에 추가를 PC Chrome·Edge(설치창을 띄울 수 있는 브라우저)에서도 보이게, PC Safari·Firefox 에선 숨김

This commit is contained in:
minaChoi committed 2026-10-21 09:10:10 +09:00
1 parent 77d29ce24f
commit c788430fa7
3 files changed
+16 -8

No files matched your search

+6 -4
View File
@@ -1,13 +1,15 @@
import { useEffect, useState } from 'react'
import { track } from '../lib/analytics'
import { dismiss, dismissed, onPhone, platform, useInstall } from './install'
import { dismiss, dismissed, platform, useInstall, useInstallable } from './install'
const SITE = 'https://weather.o2o.kr'
/** 오늘 탭의 작은 설치 카드. 오늘의 각까지 본 뒤 자리에 놓고, 휴대폰 브라우저에서만 보인다. 닫으면 2주 숨긴다 (홈 화면에서 연 경우·PC 는 안 보임) */
/** 오늘 탭의 작은 설치 카드. 오늘의 각까지 본 뒤 자리에 놓고, 설치할 수 있는 곳(휴대폰, PC Chrome·Edge)에서만 보인다. 닫으면 2주 숨긴다 */
export function InstallBanner() {
const install = useInstall()
const [hidden, setHidden] = useState(() => !onPhone() || dismissed())
const installable = useInstallable()
const [closed, setClosed] = useState(dismissed)
const hidden = !installable || closed
useEffect(() => {
if (!hidden) track('install_banner_view', {})
@@ -28,7 +30,7 @@ export function InstallBanner() {
type="button"
onClick={() => {
dismiss()
setHidden(true)
setClosed(true)
}}
className="cursor-pointer rounded-full bg-[#eef4fc] px-3 py-1.5 text-[13px] font-extrabold text-(--ink2)"
>