about summary refs log tree commit diff
path: root/src/screens/Settings/AppIconSettings/AppIconImage.tsx
diff options
context:
space:
mode:
authorSamuel Newman <mozzius@protonmail.com>2024-12-11 22:33:45 +0000
committerGitHub <noreply@github.com>2024-12-11 22:33:45 +0000
commite49dad28896695fc6396ba704a94d3e459711f1a (patch)
tree99a702c4a1794d8ae4223fbdcbec38fc9ece69b6 /src/screens/Settings/AppIconSettings/AppIconImage.tsx
parent69f22b9dba41987763310c1adc4ac87d58d63334 (diff)
downloadvoidsky-e49dad28896695fc6396ba704a94d3e459711f1a.tar.zst
Nicer app icon screen (#6972)
* 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 <pfrazee@gmail.com>
Co-authored-by: Eric Bailey <git@esb.lol>
Diffstat (limited to 'src/screens/Settings/AppIconSettings/AppIconImage.tsx')
-rw-r--r--src/screens/Settings/AppIconSettings/AppIconImage.tsx33
1 files changed, 33 insertions, 0 deletions
diff --git a/src/screens/Settings/AppIconSettings/AppIconImage.tsx b/src/screens/Settings/AppIconSettings/AppIconImage.tsx
new file mode 100644
index 000000000..e81d5d0d5
--- /dev/null
+++ b/src/screens/Settings/AppIconSettings/AppIconImage.tsx
@@ -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
+    />
+  )
+}