Update @mozzius/expo-dynamic-app-icon (#8834)
This commit is contained in:
@@ -28,7 +28,7 @@ export function AppIconSettingsScreen({}: Props) {
|
||||
getAppIconName(DynamicAppIcon.getAppIcon()),
|
||||
)
|
||||
|
||||
const onSetAppIcon = (icon: string) => {
|
||||
const onSetAppIcon = (icon: DynamicAppIcon.IconName) => {
|
||||
if (isAndroid) {
|
||||
const next =
|
||||
sets.defaults.find(i => i.id === icon) ??
|
||||
@@ -37,7 +37,7 @@ export function AppIconSettingsScreen({}: Props) {
|
||||
next
|
||||
? _(msg`Change app icon to "${next.name}"`)
|
||||
: _(msg`Change app icon`),
|
||||
// to determine - can we stop this happening? -sfn
|
||||
// unfortunately necessary -sfn
|
||||
_(msg`The app will be restarted`),
|
||||
[
|
||||
{
|
||||
@@ -119,7 +119,7 @@ export function AppIconSettingsScreen({}: Props) {
|
||||
)
|
||||
}
|
||||
|
||||
function setAppIcon(icon: string) {
|
||||
function setAppIcon(icon: DynamicAppIcon.IconName) {
|
||||
if (icon === 'default_light') {
|
||||
return getAppIconName(DynamicAppIcon.setAppIcon(null))
|
||||
} else {
|
||||
@@ -127,11 +127,11 @@ function setAppIcon(icon: string) {
|
||||
}
|
||||
}
|
||||
|
||||
function getAppIconName(icon: string | false) {
|
||||
function getAppIconName(icon: string | false): DynamicAppIcon.IconName {
|
||||
if (!icon || icon === 'DEFAULT') {
|
||||
return 'default_light'
|
||||
} else {
|
||||
return icon
|
||||
return icon as DynamicAppIcon.IconName
|
||||
}
|
||||
}
|
||||
|
||||
@@ -143,8 +143,8 @@ function Group({
|
||||
}: {
|
||||
children: React.ReactNode
|
||||
label: string
|
||||
value: string
|
||||
onChange: (value: string) => void
|
||||
value: DynamicAppIcon.IconName
|
||||
onChange: (value: DynamicAppIcon.IconName) => void
|
||||
}) {
|
||||
return (
|
||||
<Toggle.Group
|
||||
@@ -153,7 +153,7 @@ function Group({
|
||||
values={[value]}
|
||||
maxSelections={1}
|
||||
onChange={vals => {
|
||||
if (vals[0]) onChange(vals[0])
|
||||
if (vals[0]) onChange(vals[0] as DynamicAppIcon.IconName)
|
||||
}}>
|
||||
<View style={[a.flex_1, a.rounded_md, a.overflow_hidden]}>
|
||||
{children}
|
||||
|
||||
@@ -1,7 +1,8 @@
|
||||
import {ImageSourcePropType} from 'react-native'
|
||||
import {type ImageSourcePropType} from 'react-native'
|
||||
import type * as DynamicAppIcon from '@mozzius/expo-dynamic-app-icon'
|
||||
|
||||
export type AppIconSet = {
|
||||
id: string
|
||||
id: DynamicAppIcon.IconName
|
||||
name: string
|
||||
iosImage: () => ImageSourcePropType
|
||||
androidImage: () => ImageSourcePropType
|
||||
|
||||
@@ -37,6 +37,16 @@ export function useAppIconSets() {
|
||||
)
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'next',
|
||||
name: _(msg({context: 'Name of app icon variant', message: 'Next'})),
|
||||
iosImage: () => {
|
||||
return require(`../../../../assets/app-icons/icon_default_next.png`)
|
||||
},
|
||||
androidImage: () => {
|
||||
return require(`../../../../assets/app-icons/icon_default_next.png`)
|
||||
},
|
||||
},
|
||||
] satisfies AppIconSet[]
|
||||
|
||||
/**
|
||||
|
||||
@@ -12,7 +12,6 @@ import {
|
||||
type CommonNavigatorParams,
|
||||
type NativeStackScreenProps,
|
||||
} from '#/lib/routes/types'
|
||||
import {useGate} from '#/lib/statsig/statsig'
|
||||
import {isNative} from '#/platform/detection'
|
||||
import {useSetThemePrefs, useThemePrefs} from '#/state/shell'
|
||||
import {SettingsListItem as AppIconSettingsListItem} from '#/screens/Settings/AppIconSettings/SettingsListItem'
|
||||
@@ -32,7 +31,6 @@ type Props = NativeStackScreenProps<CommonNavigatorParams, 'AppearanceSettings'>
|
||||
export function AppearanceSettingsScreen({}: Props) {
|
||||
const {_} = useLingui()
|
||||
const {fonts} = useAlf()
|
||||
const gate = useGate()
|
||||
|
||||
const {colorMode, darkTheme} = useThemePrefs()
|
||||
const {setColorMode, setDarkTheme} = useSetThemePrefs()
|
||||
@@ -180,7 +178,7 @@ export function AppearanceSettingsScreen({}: Props) {
|
||||
onChange={onChangeFontScale}
|
||||
/>
|
||||
|
||||
{isNative && IS_INTERNAL && gate('debug_subscriptions') && (
|
||||
{isNative && IS_INTERNAL && (
|
||||
<>
|
||||
<SettingsList.Divider />
|
||||
<AppIconSettingsListItem />
|
||||
|
||||
Reference in New Issue
Block a user