bb
deploy / deploy (push) Successful in 31s

This commit is contained in:
Romain committed 2026-10-04 17:20:37 +02:00
1 parent 1eed66e1c4
commit 542ad8cd14
20 files changed
+158 -9

No files matched your search

+6
View File
@@ -234,6 +234,12 @@ const dict: Translations = {
'settings.installApp': 'تثبيت التطبيق',
'settings.installHint': 'أضِف AzuuCine إلى شاشتك الرئيسية أو سطح المكتب.',
'settings.installed': 'تم تثبيت التطبيق',
'install.title': 'تثبيت AzuuCine',
'install.ios': 'افتح AzuuCine في Safari.\nاضغط زر المشاركة (المربع مع سهم للأعلى).\nاختر «إضافة إلى الشاشة الرئيسية» ثم «إضافة».',
'install.android': 'افتح AzuuCine في Chrome.\nاضغط قائمة ⋮ في أعلى اليمين.\nاختر «إضافة إلى الشاشة الرئيسية» (أو «تثبيت التطبيق»).',
'install.desktop': 'في شريط العنوان، انقر أيقونة التثبيت على اليمين (شاشة بها سهم).\nأو: قائمة ⋮ في المتصفح → «تثبيت AzuuCine».\nأكِّد بـ «تثبيت».',
'install.other': 'افتح قائمة متصفحك.\nابحث عن «تثبيت التطبيق» أو «إضافة إلى الشاشة الرئيسية».',
'install.gotIt': 'حسنًا',
'settings.themeX': 'سمة {name}',
'settings.pickColor': 'اختيار لون مخصص',
'settings.freeColor': 'لون مخصص',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': 'App installieren',
'settings.installHint': 'Füge AzuuCine zum Startbildschirm oder Desktop hinzu.',
'settings.installed': 'App installiert',
'install.title': 'AzuuCine installieren',
'install.ios': 'Öffne AzuuCine in Safari.\nTippe auf die Teilen-Schaltfläche (das Quadrat mit Pfeil nach oben).\nWähle „Zum Home-Bildschirm“ und dann „Hinzufügen“.',
'install.android': 'Öffne AzuuCine in Chrome.\nTippe oben rechts auf das Menü ⋮.\nWähle „Zum Startbildschirm hinzufügen“ (oder „App installieren“).',
'install.desktop': 'Klicke in der Adressleiste rechts auf das Installationssymbol (ein Bildschirm mit Pfeil).\nOder: Browser-Menü ⋮ → „AzuuCine installieren“.\nBestätige mit „Installieren“.',
'install.other': 'Öffne das Menü deines Browsers.\nSuche nach „App installieren“ oder „Zum Startbildschirm hinzufügen“.',
'install.gotIt': 'Verstanden',
'settings.themeX': 'Design {name}',
'settings.pickColor': 'Eigene Farbe wählen',
'settings.freeColor': 'Eigene Farbe',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': 'Install the app',
'settings.installHint': 'Add AzuuCine to your home screen or desktop.',
'settings.installed': 'App installed',
'install.title': 'Install AzuuCine',
'install.ios': 'Open AzuuCine in Safari.\nTap the Share button (the square with an up arrow).\nChoose “Add to Home Screen”, then “Add”.',
'install.android': 'Open AzuuCine in Chrome.\nTap the ⋮ menu at the top right.\nChoose “Add to Home screen” (or “Install app”).',
'install.desktop': 'In the address bar, click the install icon on the right (a screen with an arrow).\nOr: browser ⋮ menu → “Install AzuuCine”.\nConfirm with “Install”.',
'install.other': 'Open your browser’s menu.\nLook for “Install app” or “Add to Home screen”.',
'install.gotIt': 'Got it',
'settings.themeX': '{name} theme',
'settings.pickColor': 'Pick a custom color',
'settings.freeColor': 'Custom color',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': 'Instalar la aplicación',
'settings.installHint': 'Añade AzuuCine a tu pantalla de inicio o escritorio.',
'settings.installed': 'Aplicación instalada',
'install.title': 'Instalar AzuuCine',
'install.ios': 'Abre AzuuCine en Safari.\nToca el botón Compartir (el cuadrado con una flecha hacia arriba).\nElige «Añadir a inicio» y luego «Añadir».',
'install.android': 'Abre AzuuCine en Chrome.\nToca el menú ⋮ arriba a la derecha.\nElige «Añadir a la pantalla de inicio» (o «Instalar aplicación»).',
'install.desktop': 'En la barra de direcciones, haz clic en el icono de instalación a la derecha (una pantalla con una flecha).\nO: menú ⋮ del navegador → «Instalar AzuuCine».\nConfirma con «Instalar».',
'install.other': 'Abre el menú de tu navegador.\nBusca «Instalar aplicación» o «Añadir a la pantalla de inicio».',
'install.gotIt': 'Entendido',
'settings.themeX': 'Tema {name}',
'settings.pickColor': 'Elegir un color libre',
'settings.freeColor': 'Color libre',
+6
View File
@@ -230,6 +230,12 @@ const dict = {
'settings.installApp': 'Installer l\'application',
'settings.installHint': 'Ajoute AzuuCine à ton écran d\'accueil ou ton bureau.',
'settings.installed': 'Application installée',
'install.title': 'Installer AzuuCine',
'install.ios': 'Ouvre AzuuCine dans Safari.\nAppuie sur le bouton Partager (le carré avec une flèche vers le haut).\nChoisis « Sur l\'écran d\'accueil », puis « Ajouter ».',
'install.android': 'Ouvre AzuuCine dans Chrome.\nAppuie sur le menu ⋮ en haut à droite.\nChoisis « Ajouter à l\'écran d\'accueil » (ou « Installer l\'application »).',
'install.desktop': 'Dans la barre d\'adresse, clique sur l\'icône d\'installation à droite (un écran avec une flèche).\nOu : menu ⋮ du navigateur → « Installer AzuuCine ».\nConfirme avec « Installer ».',
'install.other': 'Ouvre le menu de ton navigateur.\nCherche « Installer l\'application » ou « Ajouter à l\'écran d\'accueil ».',
'install.gotIt': 'Compris',
'settings.themeX': 'Thème {name}',
'settings.pickColor': 'Choisir une couleur libre',
'settings.freeColor': 'Couleur libre',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': 'ऐप इंस्टॉल करें',
'settings.installHint': 'AzuuCine को अपनी होम स्क्रीन या डेस्कटॉप पर जोड़ें।',
'settings.installed': 'ऐप इंस्टॉल हो गया',
'install.title': 'AzuuCine इंस्टॉल करें',
'install.ios': 'AzuuCine को Safari में खोलें।\nShare बटन दबाएँ (ऊपर तीर वाला वर्ग)।\n“Add to Home Screen” चुनें, फिर “Add”।',
'install.android': 'AzuuCine को Chrome में खोलें।\nऊपर दाईं ओर ⋮ मेनू दबाएँ।\n“होम स्क्रीन में जोड़ें” (या “ऐप इंस्टॉल करें”) चुनें।',
'install.desktop': 'एड्रेस बार में दाईं ओर इंस्टॉल आइकन पर क्लिक करें (तीर वाली स्क्रीन)।\nया: ब्राउज़र का ⋮ मेनू → “AzuuCine इंस्टॉल करें”।\n“Install” से पुष्टि करें।',
'install.other': 'अपने ब्राउज़र का मेनू खोलें।\n“ऐप इंस्टॉल करें” या “होम स्क्रीन में जोड़ें” खोजें।',
'install.gotIt': 'समझ गया',
'settings.themeX': '{name} थीम',
'settings.pickColor': 'अपना रंग चुनें',
'settings.freeColor': 'कस्टम रंग',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': 'Pasang aplikasi',
'settings.installHint': 'Tambahkan AzuuCine ke layar utama atau desktop kamu.',
'settings.installed': 'Aplikasi terpasang',
'install.title': 'Pasang AzuuCine',
'install.ios': 'Buka AzuuCine di Safari.\nKetuk tombol Bagikan (kotak dengan panah ke atas).\nPilih “Ke Layar Utama”, lalu “Tambah”.',
'install.android': 'Buka AzuuCine di Chrome.\nKetuk menu ⋮ di kanan atas.\nPilih “Tambahkan ke layar utama” (atau “Pasang aplikasi”).',
'install.desktop': 'Di bilah alamat, klik ikon pasang di sebelah kanan (layar dengan panah).\nAtau: menu ⋮ browser → “Pasang AzuuCine”.\nKonfirmasi dengan “Pasang”.',
'install.other': 'Buka menu browser kamu.\nCari “Pasang aplikasi” atau “Tambahkan ke layar utama”.',
'install.gotIt': 'Mengerti',
'settings.themeX': 'Tema {name}',
'settings.pickColor': 'Pilih warna bebas',
'settings.freeColor': 'Warna bebas',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': 'Installa l\'app',
'settings.installHint': 'Aggiungi AzuuCine alla schermata home o al desktop.',
'settings.installed': 'App installata',
'install.title': 'Installa AzuuCine',
'install.ios': 'Apri AzuuCine in Safari.\nTocca il pulsante Condividi (il quadrato con la freccia in su).\nScegli «Aggiungi a Home», poi «Aggiungi».',
'install.android': 'Apri AzuuCine in Chrome.\nTocca il menu ⋮ in alto a destra.\nScegli «Aggiungi a schermata Home» (o «Installa app»).',
'install.desktop': 'Nella barra degli indirizzi, clicca sull\'icona di installazione a destra (uno schermo con una freccia).\nOppure: menu ⋮ del browser → «Installa AzuuCine».\nConferma con «Installa».',
'install.other': 'Apri il menu del browser.\nCerca «Installa app» o «Aggiungi a schermata Home».',
'install.gotIt': 'Ho capito',
'settings.themeX': 'Tema {name}',
'settings.pickColor': 'Scegli un colore libero',
'settings.freeColor': 'Colore libero',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': 'アプリをインストール',
'settings.installHint': 'AzuuCine をホーム画面やデスクトップに追加します。',
'settings.installed': 'アプリをインストール済み',
'install.title': 'AzuuCine をインストール',
'install.ios': 'Safari で AzuuCine を開きます。\n共有ボタン(上矢印付きの四角)をタップします。\n「ホーム画面に追加」を選び、「追加」をタップします。',
'install.android': 'Chrome で AzuuCine を開きます。\n右上の ⋮ メニューをタップします。\n「ホーム画面に追加」(または「アプリをインストール」)を選びます。',
'install.desktop': 'アドレスバー右側のインストールアイコン(矢印付きの画面)をクリックします。\nまたは:ブラウザの ⋮ メニュー →「AzuuCine をインストール」。\n「インストール」で確定します。',
'install.other': 'ブラウザのメニューを開きます。\n「アプリをインストール」または「ホーム画面に追加」を探します。',
'install.gotIt': 'わかりました',
'settings.themeX': '{name}テーマ',
'settings.pickColor': '好きな色を選ぶ',
'settings.freeColor': 'カスタムカラー',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': '앱 설치',
'settings.installHint': 'AzuuCine을 홈 화면이나 바탕화면에 추가하세요.',
'settings.installed': '앱 설치됨',
'install.title': 'AzuuCine 설치',
'install.ios': 'Safari에서 AzuuCine을 엽니다.\n공유 버튼(위쪽 화살표가 있는 사각형)을 누릅니다.\n“홈 화면에 추가”를 선택한 뒤 “추가”를 누릅니다.',
'install.android': 'Chrome에서 AzuuCine을 엽니다.\n오른쪽 위 ⋮ 메뉴를 누릅니다.\n“홈 화면에 추가”(또는 “앱 설치”)를 선택합니다.',
'install.desktop': '주소창 오른쪽의 설치 아이콘(화살표가 있는 화면)을 클릭합니다.\n또는: 브라우저 ⋮ 메뉴 → “AzuuCine 설치”.\n“설치”로 확인합니다.',
'install.other': '브라우저 메뉴를 엽니다.\n“앱 설치” 또는 “홈 화면에 추가”를 찾습니다.',
'install.gotIt': '확인',
'settings.themeX': '{name} 테마',
'settings.pickColor': '원하는 색 고르기',
'settings.freeColor': '사용자 지정 색',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': 'App installeren',
'settings.installHint': 'Voeg AzuuCine toe aan je startscherm of bureaublad.',
'settings.installed': 'App geïnstalleerd',
'install.title': 'AzuuCine installeren',
'install.ios': 'Open AzuuCine in Safari.\nTik op de deelknop (het vierkant met een pijl omhoog).\nKies “Zet op beginscherm” en daarna “Voeg toe”.',
'install.android': 'Open AzuuCine in Chrome.\nTik rechtsboven op het menu ⋮.\nKies “Toevoegen aan startscherm” (of “App installeren”).',
'install.desktop': 'Klik in de adresbalk rechts op het installatiepictogram (een scherm met een pijl).\nOf: browsermenu ⋮ → “AzuuCine installeren”.\nBevestig met “Installeren”.',
'install.other': 'Open het menu van je browser.\nZoek naar “App installeren” of “Toevoegen aan startscherm”.',
'install.gotIt': 'Begrepen',
'settings.themeX': 'Thema {name}',
'settings.pickColor': 'Kies een eigen kleur',
'settings.freeColor': 'Eigen kleur',
+6
View File
@@ -232,6 +232,12 @@ const dict: Translations = {
'settings.installApp': 'Zainstaluj aplikację',
'settings.installHint': 'Dodaj AzuuCine do ekranu głównego lub pulpitu.',
'settings.installed': 'Aplikacja zainstalowana',
'install.title': 'Zainstaluj AzuuCine',
'install.ios': 'Otwórz AzuuCine w Safari.\nDotknij przycisku Udostępnij (kwadrat ze strzałką w górę).\nWybierz „Do ekranu początkowego”, a potem „Dodaj”.',
'install.android': 'Otwórz AzuuCine w Chrome.\nDotknij menu ⋮ w prawym górnym rogu.\nWybierz „Dodaj do ekranu głównego” (lub „Zainstaluj aplikację”).',
'install.desktop': 'Na pasku adresu kliknij ikonę instalacji po prawej (ekran ze strzałką).\nLub: menu ⋮ przeglądarki → „Zainstaluj AzuuCine”.\nPotwierdź przyciskiem „Zainstaluj”.',
'install.other': 'Otwórz menu przeglądarki.\nPoszukaj „Zainstaluj aplikację” lub „Dodaj do ekranu głównego”.',
'install.gotIt': 'Rozumiem',
'settings.themeX': 'Motyw {name}',
'settings.pickColor': 'Wybierz własny kolor',
'settings.freeColor': 'Własny kolor',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': 'Instalar o app',
'settings.installHint': 'Adicione o AzuuCine à tela inicial ou à área de trabalho.',
'settings.installed': 'App instalado',
'install.title': 'Instalar o AzuuCine',
'install.ios': 'Abra o AzuuCine no Safari.\nToque no botão Compartilhar (o quadrado com uma seta para cima).\nEscolha “Adicionar à Tela de Início” e depois “Adicionar”.',
'install.android': 'Abra o AzuuCine no Chrome.\nToque no menu ⋮ no canto superior direito.\nEscolha “Adicionar à tela inicial” (ou “Instalar app”).',
'install.desktop': 'Na barra de endereço, clique no ícone de instalação à direita (uma tela com uma seta).\nOu: menu ⋮ do navegador → “Instalar AzuuCine”.\nConfirme com “Instalar”.',
'install.other': 'Abra o menu do seu navegador.\nProcure por “Instalar app” ou “Adicionar à tela inicial”.',
'install.gotIt': 'Entendi',
'settings.themeX': 'Tema {name}',
'settings.pickColor': 'Escolher uma cor livre',
'settings.freeColor': 'Cor livre',
+6
View File
@@ -232,6 +232,12 @@ const dict: Translations = {
'settings.installApp': 'Установить приложение',
'settings.installHint': 'Добавь AzuuCine на главный экран или рабочий стол.',
'settings.installed': 'Приложение установлено',
'install.title': 'Установить AzuuCine',
'install.ios': 'Открой AzuuCine в Safari.\nНажми кнопку «Поделиться» (квадрат со стрелкой вверх).\nВыбери «На экран «Домой»», затем «Добавить».',
'install.android': 'Открой AzuuCine в Chrome.\nНажми меню ⋮ в правом верхнем углу.\nВыбери «Добавить на главный экран» (или «Установить приложение»).',
'install.desktop': 'В адресной строке нажми значок установки справа (экран со стрелкой).\nИли: меню ⋮ браузера → «Установить AzuuCine».\nПодтверди кнопкой «Установить».',
'install.other': 'Открой меню браузера.\nНайди «Установить приложение» или «Добавить на главный экран».',
'install.gotIt': 'Понятно',
'settings.themeX': 'Тема «{name}»',
'settings.pickColor': 'Выбрать свой цвет',
'settings.freeColor': 'Свой цвет',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': 'ติดตั้งแอป',
'settings.installHint': 'เพิ่ม AzuuCine ไปที่หน้าจอหลักหรือเดสก์ท็อปของคุณ',
'settings.installed': 'ติดตั้งแอปแล้ว',
'install.title': 'ติดตั้ง AzuuCine',
'install.ios': 'เปิด AzuuCine ใน Safari\nแตะปุ่มแชร์ (สี่เหลี่ยมที่มีลูกศรชี้ขึ้น)\nเลือก “เพิ่มไปยังหน้าจอโฮม” แล้ว “เพิ่ม”',
'install.android': 'เปิด AzuuCine ใน Chrome\nแตะเมนู ⋮ ที่มุมขวาบน\nเลือก “เพิ่มไปยังหน้าจอหลัก” (หรือ “ติดตั้งแอป”)',
'install.desktop': 'ในแถบที่อยู่ คลิกไอคอนติดตั้งทางขวา (หน้าจอที่มีลูกศร)\nหรือ: เมนู ⋮ ของเบราว์เซอร์ → “ติดตั้ง AzuuCine”\nยืนยันด้วย “ติดตั้ง”',
'install.other': 'เปิดเมนูของเบราว์เซอร์\nมองหา “ติดตั้งแอป” หรือ “เพิ่มไปยังหน้าจอหลัก”',
'install.gotIt': 'เข้าใจแล้ว',
'settings.themeX': 'ธีม {name}',
'settings.pickColor': 'เลือกสีเอง',
'settings.freeColor': 'สีที่เลือกเอง',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': 'Uygulamayı yükle',
'settings.installHint': 'AzuuCine’i ana ekranına veya masaüstüne ekle.',
'settings.installed': 'Uygulama yüklendi',
'install.title': 'AzuuCine’i yükle',
'install.ios': 'AzuuCine’i Safari’de aç.\nPaylaş düğmesine dokun (yukarı oklu kare).\n“Ana Ekrana Ekle” ve ardından “Ekle” seç.',
'install.android': 'AzuuCine’i Chrome’da aç.\nSağ üstteki ⋮ menüsüne dokun.\n“Ana ekrana ekle” (veya “Uygulamayı yükle”) seç.',
'install.desktop': 'Adres çubuğunda sağdaki yükleme simgesine tıkla (oklu ekran).\nVeya: tarayıcı ⋮ menüsü → “AzuuCine’i yükle”.\n“Yükle” ile onayla.',
'install.other': 'Tarayıcının menüsünü aç.\n“Uygulamayı yükle” veya “Ana ekrana ekle” seçeneğini ara.',
'install.gotIt': 'Anladım',
'settings.themeX': '{name} tema',
'settings.pickColor': 'Özel renk seç',
'settings.freeColor': 'Özel renk',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': 'Cài đặt ứng dụng',
'settings.installHint': 'Thêm AzuuCine vào màn hình chính hoặc màn hình nền của bạn.',
'settings.installed': 'Đã cài ứng dụng',
'install.title': 'Cài đặt AzuuCine',
'install.ios': 'Mở AzuuCine trong Safari.\nChạm nút Chia sẻ (hình vuông có mũi tên lên).\nChọn “Thêm vào MH chính”, rồi “Thêm”.',
'install.android': 'Mở AzuuCine trong Chrome.\nChạm menu ⋮ ở góc trên bên phải.\nChọn “Thêm vào màn hình chính” (hoặc “Cài đặt ứng dụng”).',
'install.desktop': 'Trên thanh địa chỉ, nhấp biểu tượng cài đặt bên phải (màn hình có mũi tên).\nHoặc: menu ⋮ của trình duyệt → “Cài đặt AzuuCine”.\nXác nhận bằng “Cài đặt”.',
'install.other': 'Mở menu trình duyệt của bạn.\nTìm “Cài đặt ứng dụng” hoặc “Thêm vào màn hình chính”.',
'install.gotIt': 'Đã hiểu',
'settings.themeX': 'Giao diện {name}',
'settings.pickColor': 'Chọn màu tùy chỉnh',
'settings.freeColor': 'Màu tùy chỉnh',
+6
View File
@@ -228,6 +228,12 @@ const dict: Translations = {
'settings.installApp': '安装应用',
'settings.installHint': '将 AzuuCine 添加到主屏幕或桌面。',
'settings.installed': '应用已安装',
'install.title': '安装 AzuuCine',
'install.ios': '在 Safari 中打开 AzuuCine。\n点按“分享”按钮(带向上箭头的方块)。\n选择“添加到主屏幕”,然后点“添加”。',
'install.android': '在 Chrome 中打开 AzuuCine。\n点按右上角的 ⋮ 菜单。\n选择“添加到主屏幕”(或“安装应用”)。',
'install.desktop': '在地址栏右侧点击安装图标(带箭头的屏幕)。\n或:浏览器 ⋮ 菜单 →“安装 AzuuCine”。\n点“安装”确认。',
'install.other': '打开浏览器的菜单。\n查找“安装应用”或“添加到主屏幕”。',
'install.gotIt': '知道了',
'settings.themeX': '{name}主题',
'settings.pickColor': '自选颜色',
'settings.freeColor': '自定义颜色',
+15
View File
@@ -30,6 +30,21 @@ function isStandalone(): boolean {
return window.matchMedia?.('(display-mode: standalone)').matches || (navigator as { standalone?: boolean }).standalone === true
}
/** Plateforme, pour expliquer comment ajouter l'app à l'écran d'accueil. */
export type Platform = 'ios' | 'android' | 'desktop' | 'other'
export function detectPlatform(): Platform {
if (typeof navigator === 'undefined') return 'other'
const ua = navigator.userAgent || ''
const touch = navigator.maxTouchPoints ?? 0
// iPhone / iPad (iPadOS récent se présente comme « MacIntel » mais avec un écran tactile)
if (/iphone|ipod|ipad/i.test(ua) || ((navigator.platform === 'MacIntel' || /Mac/.test(ua)) && touch > 1)) return 'ios'
if (/android/i.test(ua)) return 'android'
// Ordinateur « classique » : pas d'écran tactile principal
if (/windows|macintosh|linux|cros/i.test(ua) && touch <= 1) return 'desktop'
return 'other'
}
export function useInstallPrompt(): { canInstall: boolean; installed: boolean; install: () => Promise<boolean> } {
const [canInstall, setCanInstall] = useState(() => deferredPrompt !== null)
const [installed, setInstalled] = useState(isStandalone)
+35 -9
View File
@@ -10,7 +10,7 @@ import { testTmdbKey } from '../lib/catalogApi'
import { checkTmdbProxy, type ProxyState } from '../lib/cloud/api'
import { ALL_TOP_CATEGORIES, TOP_CATEGORIES } from '../lib/constants'
import { isHexColor, THEME_MODES, THEME_PRESETS } from '../lib/theme'
import { useInstallPrompt } from '../lib/pwa'
import { detectPlatform, useInstallPrompt } from '../lib/pwa'
import { cx } from '../lib/utils'
import { useMedia } from '../store'
@@ -133,13 +133,13 @@ export default function SettingsPage() {
setMessage({ kind: 'ok', text: t('settings.cleared') })
}
const onInstall = async () => {
if (canInstall) {
const ok = await install()
if (ok) setMessage({ kind: 'ok', text: t('settings.installed') })
} else {
setMessage({ kind: 'ok', text: t('settings.installHint') })
}
const [showInstall, setShowInstall] = useState(false)
const platform = detectPlatform()
const doNativeInstall = async () => {
const ok = await install()
setShowInstall(false)
if (ok) setMessage({ kind: 'ok', text: t('settings.installed') })
}
return (
@@ -240,7 +240,7 @@ export default function SettingsPage() {
<span className="flex-1 font-medium text-ink-3">{t('settings.installed')}</span>
</div>
) : (
<button onClick={onInstall} className="flex w-full items-center gap-3.5 px-4 py-4 text-start transition-colors active:bg-surface-2">
<button onClick={() => setShowInstall(true)} className="flex w-full items-center gap-3.5 px-4 py-4 text-start transition-colors active:bg-surface-2">
<span className="text-ink-2"><Smartphone size={19} /></span>
<span className="flex-1 font-medium">{t('settings.installApp')}</span>
<span className="text-ink-3">→</span>
@@ -249,6 +249,32 @@ export default function SettingsPage() {
</div>
<p className="mt-2.5 text-xs text-ink-3">{t('settings.installHint')}</p>
{showInstall && (
<div className="fixed inset-0 z-[70] flex items-end justify-center bg-black/70 p-4 sm:items-center" onClick={() => setShowInstall(false)}>
<div role="dialog" aria-modal="true" className="sheet-in safe-bottom w-full max-w-sm rounded-3xl border border-line-strong bg-surface p-5" onClick={(e) => e.stopPropagation()}>
<h2 className="flex items-center gap-2 text-lg"><Smartphone size={20} className="text-accent" /> {t('install.title')}</h2>
<ol className="mt-4 space-y-3">
{t(`install.${platform}`).split('\n').map((step, i) => (
<li key={i} className="flex gap-3 text-sm leading-relaxed text-ink-2">
<span className="grid size-6 shrink-0 place-items-center rounded-full bg-surface-2 text-xs font-bold text-ink">{i + 1}</span>
<span>{step}</span>
</li>
))}
</ol>
<div className="mt-5 flex gap-2">
{canInstall && (
<button onClick={doNativeInstall} className="btn btn-primary flex-1">
<Download size={17} /> {t('settings.installApp')}
</button>
)}
<button onClick={() => setShowInstall(false)} className={cx('btn', canInstall ? 'btn-ghost px-5' : 'btn-light flex-1')}>
{t('install.gotIt')}
</button>
</div>
</div>
</div>
)}
<SectionTitle>{t('settings.databases')}</SectionTitle>
<div className="card space-y-4 p-4">
<div>