@mediacubeco/expo-template-fsd 2.1.3 → 2.1.5

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.3",
3
+ "version": "2.1.5",
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.0",
76
- "@mediacubeco/base-react-native": "2.1.0",
77
- "@mediacubeco/base-react": "2.1.0"
75
+ "@mediacubeco/base": "2.1.1",
76
+ "@mediacubeco/base-react": "2.1.1",
77
+ "@mediacubeco/base-react-native": "2.1.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-fsd": "2.1.0",
87
- "@mediacubeco/eslint-config-react-native": "2.1.0",
88
- "@mediacubeco/eslint-config": "2.1.0",
89
- "@mediacubeco/prettier-config": "2.1.0",
90
- "@mediacubeco/prettier-config-fsd": "2.1.0",
91
- "@mediacubeco/eslint-config-react": "2.1.0",
92
- "@mediacubeco/typescript-config": "2.1.0",
93
- "@mediacubeco/typescript-config-react": "2.1.0",
94
- "@mediacubeco/typescript-config-react-native": "2.1.0",
95
- "@mediacubeco/typescript-config-fsd": "2.1.0"
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"
96
96
  },
97
97
  "scripts": {
98
98
  "postinstall": "npx husky && npx skills update",
@@ -4,4 +4,4 @@ class Api {
4
4
  static authRepository = new AuthRepository('/auth')
5
5
  }
6
6
 
7
- export { Api }
7
+ export default Api
@@ -16,7 +16,7 @@ const formatRoute = <Params extends ApiInstanceDefaultParams>(
16
16
  const query = new URLSearchParams(params).toString()
17
17
  const validRoute = route.endsWith('/') ? route.slice(0, -1) : route
18
18
 
19
- return [validRoute, query].join('?') as ApiInstanceRoute
19
+ return [validRoute, query].filter(Boolean).join('?') as ApiInstanceRoute
20
20
  }
21
21
 
22
22
  export { formatURI, formatRoute }
@@ -1,18 +1,33 @@
1
1
  import { Platform } from '@mediacubeco/base-react-native'
2
2
  import * as SecureStore from 'expo-secure-store'
3
3
 
4
+ const localStorageFallback = {
5
+ state: {} as Record<string, string>,
6
+ getItem(key: string) {
7
+ return this.state[key]
8
+ },
9
+ setItem(key: string, value: string) {
10
+ this.state[key] = value
11
+ },
12
+ removeItem(key: string) {
13
+ delete this.state[key]
14
+ },
15
+ }
16
+
17
+ const webStorage = typeof localStorage !== 'undefined' ? localStorage : localStorageFallback
18
+
19
+ const storageModelWeb = {
20
+ getItem: (key: string) => Promise.resolve(webStorage.getItem(key)),
21
+ setItem: (key: string, value: string) => Promise.resolve(webStorage.setItem(key, value)),
22
+ removeItem: (key: string) => Promise.resolve(webStorage.removeItem(key)),
23
+ }
24
+
4
25
  const storageModelNative = {
5
26
  getItem: SecureStore.getItemAsync,
6
27
  setItem: SecureStore.setItemAsync,
7
28
  removeItem: SecureStore.deleteItemAsync,
8
29
  }
9
30
 
10
- const storageModelWeb = {
11
- getItem: (key: string) => Promise.resolve(localStorage.getItem(key)),
12
- setItem: (key: string, value: string) => Promise.resolve(localStorage.setItem(key, value)),
13
- removeItem: (key: string) => Promise.resolve(localStorage.removeItem(key)),
14
- }
15
-
16
31
  const storageAsync = Platform.by({
17
32
  web: storageModelWeb,
18
33
  default: storageModelNative,
@@ -1,3 +1,4 @@
1
+ import { Platform } from '@mediacubeco/base-react-native'
1
2
  import { useCallback, useEffect, useMemo, useRef, useState } from 'react'
2
3
  import { Appearance, StatusBar, useColorScheme } from 'react-native'
3
4
  import { themeStorage } from './utils'
@@ -21,15 +22,15 @@ const ThemeProvider = ({ children }: ThemeProviderProps) => {
21
22
  }, [currentThemeMode])
22
23
 
23
24
  const updateThemeModeSystem = useCallback((themeMode: ThemeMode) => {
24
- // if (Platform.isIos) {
25
- if (!hasDarkMode) {
26
- Appearance.setColorScheme('light')
27
- } else if (themeMode === ThemeMode.System) {
28
- Appearance.setColorScheme('unspecified')
29
- } else {
30
- Appearance.setColorScheme(themeMode)
25
+ if (Platform.isIos) {
26
+ if (!hasDarkMode) {
27
+ Appearance.setColorScheme('light')
28
+ } else if (themeMode === ThemeMode.System) {
29
+ Appearance.setColorScheme('unspecified')
30
+ } else {
31
+ Appearance.setColorScheme(themeMode)
32
+ }
31
33
  }
32
- // }
33
34
  }, [])
34
35
 
35
36
  useEffect(() => {