Guide « Installer Bobinoo » aussi sur Mac (Safari : Ajouter au Dock ; Chrome, Edge : icône d'installation)
deploy / deploy (push) Successful in 1m2s

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVo1qxKoBQCaMd7Ue8PGbe
This commit is contained in:
Claude committed 2026-12-02 10:04:00 +00:00
1 parent a907f829f1
commit 39e1395fec
22 files changed
+168 -29

No files matched your search

+35 -20
View File
@@ -1,26 +1,41 @@
import { Plus, Share, SquarePlus, X } from 'lucide-react'
import { useState } from 'react'
import { t } from '../i18n'
import { canInstallOnIos } from '../lib/install'
import { Menu, MonitorDown, Plus, Share, SquarePlus, X } from 'lucide-react'
import { useState, type ReactNode } from 'react'
import { t, type TKey } from '../i18n'
import { installPlatform, type InstallPlatform } from '../lib/install'
/**
* Installer Bobinoo sur un iPhone ou un iPad : il n'y a pas de bouton d'installation sur iOS, il faut passer
* par le menu Partager du navigateur. Ces trois étapes l'expliquent.
* Installer Bobinoo sur un appareil Apple : iOS n'a pas de bouton d'installation (menu Partager du navigateur),
* Safari sur Mac passe par Fichier → Ajouter au Dock, Chrome et Edge par l'icône de la barre d'adresse.
*/
export function InstallSteps() {
const steps = [
{ icon: <Share size={16} />, text: t('install.step1') },
{ icon: <SquarePlus size={16} />, text: t('install.step2') },
{ icon: <Plus size={16} />, text: t('install.step3') },
]
const STEPS: Record<InstallPlatform, { icon: ReactNode; key: TKey }[]> = {
ios: [
{ icon: <Share size={16} />, key: 'install.step1' },
{ icon: <SquarePlus size={16} />, key: 'install.step2' },
{ icon: <Plus size={16} />, key: 'install.step3' },
],
'mac-safari': [
{ icon: <Menu size={16} />, key: 'install.macSafari1' },
{ icon: <SquarePlus size={16} />, key: 'install.macSafari2' },
{ icon: <Plus size={16} />, key: 'install.macSafari3' },
],
'mac-chrome': [
{ icon: <MonitorDown size={16} />, key: 'install.macChrome1' },
{ icon: <Plus size={16} />, key: 'install.macChrome2' },
],
}
/** Phrase d'introduction : écran d'accueil (iPhone, iPad) ou Dock (Mac). */
export const installHint = (platform: InstallPlatform) => t(platform === 'ios' ? 'install.hint' : 'install.hintMac')
export function InstallSteps({ platform }: { platform: InstallPlatform }) {
return (
<ol className="space-y-3">
{steps.map((s, i) => (
<li key={i} className="flex items-start gap-3 text-sm leading-relaxed text-ink-2">
{STEPS[platform].map((s) => (
<li key={s.key} className="flex items-start gap-3 text-sm leading-relaxed text-ink-2">
<span className="grid size-7 shrink-0 place-items-center rounded-full border border-line-strong text-ink" aria-hidden>
{s.icon}
</span>
<span className="pt-0.5">{s.text}</span>
<span className="pt-0.5">{t(s.key)}</span>
</li>
))}
</ol>
@@ -29,10 +44,10 @@ export function InstallSteps() {
const HIDDEN_KEY = 'azuucine:install-hint'
/** Carte de l'accueil, dans le navigateur d'un iPhone ou d'un iPad seulement, masquable pour de bon. */
/** Carte de l'accueil, sur un appareil Apple seulement, masquable pour de bon. */
export function InstallHint() {
const [platform] = useState(installPlatform)
const [hidden, setHidden] = useState(() => {
if (!canInstallOnIos()) return true
try {
return localStorage.getItem(HIDDEN_KEY) === '1'
} catch {
@@ -40,7 +55,7 @@ export function InstallHint() {
}
})
const [open, setOpen] = useState(false)
if (hidden) return null
if (!platform || hidden) return null
const hide = () => {
setHidden(true)
@@ -56,7 +71,7 @@ export function InstallHint() {
<div className="flex items-start gap-3">
<div className="min-w-0 flex-1">
<h2 className="font-semibold">{t('install.title')}</h2>
<p className="mt-1 text-sm text-ink-2">{t('install.hint')}</p>
<p className="mt-1 text-sm text-ink-2">{installHint(platform)}</p>
</div>
<button type="button" onClick={hide} aria-label={t('netPill.hide')} className="-me-1.5 -mt-1.5 grid size-8 shrink-0 place-items-center rounded-full text-ink-3 active:bg-surface-2">
<X size={16} />
@@ -64,7 +79,7 @@ export function InstallHint() {
</div>
{open ? (
<div className="mt-4">
<InstallSteps />
<InstallSteps platform={platform} />
</div>
) : (
<button type="button" onClick={() => setOpen(true)} className="btn btn-ghost mt-3 px-3 py-2 text-sm">