Skip to content

Commit

Permalink
Nicer app icon screen (#6972)
Browse files Browse the repository at this point in the history
* wip exploration

* list format instead of grid

* fix normalising default name

* adjust margins

* Rework the app icon link

* Decrease app icon size

* Adjust some spacing

* Move some things around to fix web errors

* Fix pathname

---------

Co-authored-by: Paul Frazee <[email protected]>
Co-authored-by: Eric Bailey <[email protected]>
  • Loading branch information
3 people authored Dec 11, 2024
1 parent 69f22b9 commit e49dad2
Show file tree
Hide file tree
Showing 10 changed files with 478 additions and 270 deletions.
260 changes: 0 additions & 260 deletions src/screens/Settings/AppIconSettings.tsx

This file was deleted.

33 changes: 33 additions & 0 deletions src/screens/Settings/AppIconSettings/AppIconImage.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import {Image} from 'expo-image'

import {AppIconSet} from '#/screens/Settings/AppIconSettings/types'
import {atoms as a, platform, useTheme} from '#/alf'

export function AppIconImage({
icon,
size = 50,
}: {
icon: AppIconSet
size: number
}) {
const t = useTheme()
return (
<Image
source={platform({
ios: icon.iosImage(),
android: icon.androidImage(),
})}
style={[
{width: size, height: size},
platform({
ios: {borderRadius: size / 5},
android: a.rounded_full,
}),
a.curve_continuous,
t.atoms.border_contrast_medium,
a.border,
]}
accessibilityIgnoresInvertColors
/>
)
}
29 changes: 29 additions & 0 deletions src/screens/Settings/AppIconSettings/SettingsListItem.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {View} from 'react-native'
import {msg, Trans} from '@lingui/macro'
import {useLingui} from '@lingui/react'

import {AppIconImage} from '#/screens/Settings/AppIconSettings/AppIconImage'
import {useCurrentAppIcon} from '#/screens/Settings/AppIconSettings/useCurrentAppIcon'
import * as SettingsList from '#/screens/Settings/components/SettingsList'
import {atoms as a} from '#/alf'
import {Shapes_Stroke2_Corner0_Rounded as Shapes} from '#/components/icons/Shapes'

export function SettingsListItem() {
const {_} = useLingui()
const icon = useCurrentAppIcon()

return (
<SettingsList.LinkItem
to="/settings/app-icon"
label={_(msg`App Icon`)}
contentContainerStyle={[a.align_start]}>
<SettingsList.ItemIcon icon={Shapes} />
<View style={[a.flex_1]}>
<SettingsList.ItemText style={[a.pt_xs, a.pb_md]}>
<Trans>App Icon</Trans>
</SettingsList.ItemText>
<AppIconImage icon={icon} size={60} />
</View>
</SettingsList.LinkItem>
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export function SettingsListItem() {}
Loading

0 comments on commit e49dad2

Please sign in to comment.