Skip to content

Commit

Permalink
improve app icon on apple
Browse files Browse the repository at this point in the history
  • Loading branch information
mebtte committed Aug 14, 2023
1 parent c2de265 commit dc7e40b
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 29 deletions.
57 changes: 28 additions & 29 deletions apps/pwa/src/app/head.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import capitalize from '#/utils/capitalize';
import upperCaseFirstLetter from '#/utils/upper_case_first_letter';
import { memo } from 'react';
import { Helmet } from 'react-helmet';
import { IS_IPAD, IS_IPHONE, IS_MAC_OS } from '@/constants/browser';
import { IS_MAC_OS } from '@/constants/browser';

const MANIFEST_URL = URL.createObjectURL(
new Blob(
Expand All @@ -12,34 +12,33 @@ const MANIFEST_URL = URL.createObjectURL(
name: capitalize(t('cicada')),
short_name: capitalize(t('cicada')),
description: upperCaseFirstLetter(t('cicada_description')),
icons:
IS_MAC_OS || IS_IPAD || IS_IPHONE
? [
{
src: `${window.location.origin}/app_icon_macos_512.png`,
type: 'image/png',
sizes: '512x512',
},
{
src: `${window.location.origin}/app_icon_maskable_macos_512.png`,
type: 'image/png',
sizes: '512x512',
purpose: 'maskable',
},
]
: [
{
src: `${window.location.origin}/app_icon_512.png`,
type: 'image/png',
sizes: '512x512',
},
{
src: `${window.location.origin}/app_icon_maskable_512.png`,
type: 'image/png',
sizes: '512x512',
purpose: 'maskable',
},
],
icons: IS_MAC_OS
? [
{
src: `${window.location.origin}/app_icon_macos_512.png`,
type: 'image/png',
sizes: '512x512',
},
{
src: `${window.location.origin}/app_icon_maskable_macos_512.png`,
type: 'image/png',
sizes: '512x512',
purpose: 'maskable',
},
]
: [
{
src: `${window.location.origin}/app_icon_512.png`,
type: 'image/png',
sizes: '512x512',
},
{
src: `${window.location.origin}/app_icon_maskable_512.png`,
type: 'image/png',
sizes: '512x512',
purpose: 'maskable',
},
],
start_url: window.location.origin,
background_color: '#ffffff',
display: 'standalone',
Expand Down
File renamed without changes

0 comments on commit dc7e40b

Please sign in to comment.