@mediacubeco/expo-template-fsd 2.1.5 → 2.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "private": false,
3
- "version": "2.1.5",
3
+ "version": "2.2.1",
4
4
  "name": "@mediacubeco/expo-template-fsd",
5
5
  "description": "Application by Mediacube developers",
6
6
  "license": "MIT",
@@ -72,9 +72,9 @@
72
72
  "react-native-svg": "15.15.4",
73
73
  "react-native-web": "^0.21.0",
74
74
  "react-native-worklets": "0.8.3",
75
- "@mediacubeco/base": "2.1.1",
76
- "@mediacubeco/base-react": "2.1.1",
77
- "@mediacubeco/base-react-native": "2.1.1"
75
+ "@mediacubeco/base": "2.2.1",
76
+ "@mediacubeco/base-react": "2.2.1",
77
+ "@mediacubeco/base-react-native": "2.2.1"
78
78
  },
79
79
  "devDependencies": {
80
80
  "@types/react": "^19.2.0",
@@ -83,16 +83,16 @@
83
83
  "husky": "^9.1.7",
84
84
  "prettier": "^3.8.1",
85
85
  "typescript": "^6.0.3",
86
- "@mediacubeco/eslint-config": "2.1.1",
87
- "@mediacubeco/eslint-config-fsd": "2.1.1",
88
- "@mediacubeco/prettier-config": "2.1.1",
89
- "@mediacubeco/eslint-config-react-native": "2.1.1",
90
- "@mediacubeco/eslint-config-react": "2.1.1",
91
- "@mediacubeco/typescript-config": "2.1.1",
92
- "@mediacubeco/typescript-config-fsd": "2.1.1",
93
- "@mediacubeco/typescript-config-react": "2.1.1",
94
- "@mediacubeco/prettier-config-fsd": "2.1.1",
95
- "@mediacubeco/typescript-config-react-native": "2.1.1"
86
+ "@mediacubeco/eslint-config-fsd": "2.2.2",
87
+ "@mediacubeco/eslint-config-react": "2.2.1",
88
+ "@mediacubeco/eslint-config-react-native": "2.2.1",
89
+ "@mediacubeco/prettier-config": "2.2.1",
90
+ "@mediacubeco/prettier-config-fsd": "2.2.1",
91
+ "@mediacubeco/typescript-config": "2.2.1",
92
+ "@mediacubeco/typescript-config-fsd": "2.2.1",
93
+ "@mediacubeco/typescript-config-react": "2.2.1",
94
+ "@mediacubeco/typescript-config-react-native": "2.2.1",
95
+ "@mediacubeco/eslint-config": "2.2.1"
96
96
  },
97
97
  "scripts": {
98
98
  "postinstall": "npx husky && npx skills update",
@@ -168,7 +168,13 @@ const useAnimated = <Value extends AnimatedState = AnimatedState>(
168
168
  ): Range[number] => {
169
169
  'worklet'
170
170
 
171
- const defaultInputRange = range.map((_, index, { length }) => (1 / (length - 1)) * index)
171
+ const defaultInputRange: number[] = []
172
+
173
+ const segments = range.length - 1
174
+
175
+ for (let index = 0; index < range.length; index += 1) {
176
+ defaultInputRange.push(segments > 0 ? (1 / segments) * index : 0)
177
+ }
172
178
 
173
179
  if (typeof range[0] === 'number') {
174
180
  return reInterpolate(
@@ -4,4 +4,4 @@ class Api {
4
4
  static authRepository = new AuthRepository('/auth')
5
5
  }
6
6
 
7
- export default Api
7
+ export { Api }
@@ -9,7 +9,10 @@ import { type ThemeProviderProps } from './theme.types'
9
9
  const ThemeProvider = ({ children }: ThemeProviderProps) => {
10
10
  const didDefine = useRef(false)
11
11
  const [themeMode, setThemeMode] = useState(hasDarkMode ? ThemeMode.System : ThemeMode.Light)
12
- const themeModeSystem = (useColorScheme() as ThemeModeSystem) ?? ThemeModeSystem.Light
12
+ const colorScheme = useColorScheme()
13
+
14
+ const themeModeSystem =
15
+ colorScheme === 'unspecified' ? ThemeModeSystem.Light : (colorScheme as ThemeModeSystem)
13
16
 
14
17
  const currentThemeMode = {
15
18
  [ThemeMode.Light]: ThemeModeSystem.Light,
@@ -21,6 +24,10 @@ const ThemeProvider = ({ children }: ThemeProviderProps) => {
21
24
  return themes[currentThemeMode]
22
25
  }, [currentThemeMode])
23
26
 
27
+ const value = useMemo(() => {
28
+ return { theme, themeMode, themeModeSystem, setThemeMode }
29
+ }, [theme, themeMode, themeModeSystem, setThemeMode])
30
+
24
31
  const updateThemeModeSystem = useCallback((themeMode: ThemeMode) => {
25
32
  if (Platform.isIos) {
26
33
  if (!hasDarkMode) {
@@ -67,11 +74,7 @@ const ThemeProvider = ({ children }: ThemeProviderProps) => {
67
74
  )
68
75
  }, [currentThemeMode])
69
76
 
70
- return (
71
- <ThemeContext.Provider value={{ theme, themeMode, themeModeSystem, setThemeMode }}>
72
- {children}
73
- </ThemeContext.Provider>
74
- )
77
+ return <ThemeContext.Provider value={value}>{children}</ThemeContext.Provider>
75
78
  }
76
79
 
77
80
  export default ThemeProvider