ripal-ui 1.0.77 → 1.0.78
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/elements/SecureStorage.js +27 -0
- package/elements/Text.tsx +2 -2
- package/package.json +2 -2
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import * as SecureStore from 'expo-secure-store';
|
|
2
|
+
|
|
3
|
+
const SecureStorage = {
|
|
4
|
+
async getItem(key) {
|
|
5
|
+
return await SecureStore.getItemAsync(key);
|
|
6
|
+
},
|
|
7
|
+
|
|
8
|
+
async setItem(key, value) {
|
|
9
|
+
return await SecureStore.setItemAsync(key, value);
|
|
10
|
+
},
|
|
11
|
+
|
|
12
|
+
async removeItem(key) {
|
|
13
|
+
return await SecureStore.deleteItemAsync(key);
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
// optional: to match AsyncStorage signature
|
|
17
|
+
async clear() {
|
|
18
|
+
console.warn('SecureStorage.clear() is not supported – SecureStore has no clearAll.');
|
|
19
|
+
},
|
|
20
|
+
|
|
21
|
+
async getAllKeys() {
|
|
22
|
+
console.warn('SecureStorage.getAllKeys() is not supported – SecureStore cannot list keys.');
|
|
23
|
+
return [];
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export default SecureStorage;
|
package/elements/Text.tsx
CHANGED
|
@@ -2,7 +2,7 @@ import React, { FC, useEffect, useState } from "react";
|
|
|
2
2
|
import { Text as RNText, TextStyle } from "react-native";
|
|
3
3
|
import { useFonts, Poppins_300Light, Poppins_400Regular, Poppins_500Medium, Poppins_600SemiBold, Poppins_700Bold, Poppins_900Black } from "@expo-google-fonts/poppins";
|
|
4
4
|
import config from "../config";
|
|
5
|
-
import
|
|
5
|
+
import SecureStorage from "./SecureStorage";
|
|
6
6
|
|
|
7
7
|
interface TextProps {
|
|
8
8
|
children: React.ReactNode;
|
|
@@ -39,7 +39,7 @@ const Text: FC<TextProps> = ({
|
|
|
39
39
|
const [lang, setLang] = useState(config.appLangs.default);
|
|
40
40
|
|
|
41
41
|
useEffect(() => {
|
|
42
|
-
|
|
42
|
+
SecureStorage.getItem('app_lang').then(appLang => {
|
|
43
43
|
if (appLang != null) {
|
|
44
44
|
setLang(appLang);
|
|
45
45
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ripal-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.78",
|
|
4
4
|
"description": "A collection of React elements and components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -10,7 +10,7 @@
|
|
|
10
10
|
"dependencies": {
|
|
11
11
|
"react": "18.3.1",
|
|
12
12
|
"react-native": "0.76.7",
|
|
13
|
-
"
|
|
13
|
+
"expo-secure-store": "~13.0.2"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
16
|
"@babel/cli": "^7.25.6",
|