ripal-ui 1.1.394 → 1.1.395
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/Text.tsx +0 -22
- package/package.json +5 -1
package/elements/Text.tsx
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import React, { FC, useEffect, useState } from "react";
|
|
2
2
|
import { Text as RNText, TextStyle } from "react-native";
|
|
3
|
-
import { useFonts, Poppins_300Light, Poppins_400Regular, Poppins_500Medium, Poppins_600SemiBold, Poppins_700Bold, Poppins_900Black } from "@expo-google-fonts/poppins";
|
|
4
3
|
import config from "../config";
|
|
5
4
|
import SecureStorage from "./SecureStorage";
|
|
6
|
-
import * as Font from "expo-font";
|
|
7
5
|
|
|
8
6
|
interface TextProps {
|
|
9
7
|
children: React.ReactNode;
|
|
@@ -29,20 +27,6 @@ const Text: FC<TextProps> = ({
|
|
|
29
27
|
style
|
|
30
28
|
}) => {
|
|
31
29
|
const fontName = "Poppins";
|
|
32
|
-
const [fontsLoaded, setFontsLoaded] = useState(false);
|
|
33
|
-
|
|
34
|
-
useEffect(() => {
|
|
35
|
-
Font.loadAsync({
|
|
36
|
-
Poppins_300Light: require("@expo-google-fonts/poppins/300Light/Poppins_300Light.ttf"),
|
|
37
|
-
Poppins_400Regular: require("@expo-google-fonts/poppins/400Regular/Poppins_400Regular.ttf"),
|
|
38
|
-
Poppins_500Medium: require("@expo-google-fonts/poppins/500Medium/Poppins_500Medium.ttf"),
|
|
39
|
-
Poppins_600SemiBold: require("@expo-google-fonts/poppins/600SemiBold/Poppins_600SemiBold.ttf"),
|
|
40
|
-
Poppins_700Bold: require("@expo-google-fonts/poppins/700Bold/Poppins_700Bold.ttf"),
|
|
41
|
-
Poppins_900Black: require("@expo-google-fonts/poppins/900Black/Poppins_900Black.ttf"),
|
|
42
|
-
})
|
|
43
|
-
.then(() => setFontsLoaded(true))
|
|
44
|
-
.catch((err) => console.error("Font loading error:", err));
|
|
45
|
-
}, []);
|
|
46
30
|
|
|
47
31
|
const [lang, setLang] = useState(config.appLangs.default);
|
|
48
32
|
|
|
@@ -63,12 +47,6 @@ const Text: FC<TextProps> = ({
|
|
|
63
47
|
}
|
|
64
48
|
}
|
|
65
49
|
|
|
66
|
-
if (!fontsLoaded) {
|
|
67
|
-
console.error('Failed to load font');
|
|
68
|
-
|
|
69
|
-
return <RNText>{children}</RNText>; // Return statement added to properly handle loading state
|
|
70
|
-
}
|
|
71
|
-
|
|
72
50
|
if (limit > 0 && typeof children === "string" && children.length > limit) {
|
|
73
51
|
children = children.substr(0, limit) + '...';
|
|
74
52
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ripal-ui",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.395",
|
|
4
4
|
"description": "A collection of React elements and components",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -13,6 +13,10 @@
|
|
|
13
13
|
"react": "^19.1.0",
|
|
14
14
|
"react-native": "^0.81.5"
|
|
15
15
|
},
|
|
16
|
+
"peerDependencies": {
|
|
17
|
+
"@expo-google-fonts/poppins": ">=0.3.0",
|
|
18
|
+
"expo-font": ">=11.0.0"
|
|
19
|
+
},
|
|
16
20
|
"devDependencies": {
|
|
17
21
|
"@babel/cli": "^7.25.6",
|
|
18
22
|
"@babel/core": "^7.25.2",
|