feat: dynamic app icon

This commit is contained in:
Adrian Castro
2024-03-19 10:24:19 +01:00
parent 202e1484f5
commit f1032f8033
5 changed files with 48 additions and 0 deletions

View File

@@ -58,6 +58,31 @@ const defineConfig = (): ExpoConfig => ({
},
},
],
[
"expo-dynamic-app-icon",
{
main: {
image: "./assets/images/main.png",
prerendered: true,
},
blue: {
image: "./assets/images/blue.png",
prerendered: true,
},
gray: {
image: "./assets/images/gray.png",
prerendered: true,
},
red: {
image: "./assets/images/red.png",
prerendered: true,
},
teal: {
image: "./assets/images/teal.png",
prerendered: true,
},
},
],
],
});

View File

Before

Width:  |  Height:  |  Size: 5.9 KiB

After

Width:  |  Height:  |  Size: 5.9 KiB

View File

@@ -35,6 +35,7 @@
"expo-brightness": "~11.8.0",
"expo-build-properties": "~0.11.1",
"expo-constants": "~15.4.5",
"expo-dynamic-app-icon": "github:simonsturge/expo-dynamic-app-icon",
"expo-haptics": "~12.8.1",
"expo-linear-gradient": "^12.7.2",
"expo-linking": "~6.2.2",

View File

@@ -1,3 +1,4 @@
import { setAppIcon } from "expo-dynamic-app-icon";
import { create } from "zustand";
import { immer } from "zustand/middleware/immer";
@@ -14,6 +15,7 @@ export const useThemeStore = create(
setTheme(v) {
set((s) => {
s.theme = v;
setAppIcon(v);
});
},
})),