dhre-ui-kit 0.0.376 → 0.0.377
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/lib/index.js +1 -20
- package/lib/index.js.map +1 -1
- package/lib/index.mjs +1 -19
- package/lib/index.mjs.map +1 -1
- package/package.json +1 -2
package/lib/index.mjs
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import React, { createContext, useContext, useState, useEffect, useRef, memo, useCallback } from 'react';
|
|
2
2
|
import { useSelector } from 'react-redux';
|
|
3
3
|
import { Dimensions, StyleSheet, Text, Pressable, View, Platform, KeyboardAvoidingView, TextInput, ScrollView, Animated, FlatList, TouchableOpacity, Modal as Modal$1, Alert, Linking, PanResponder } from 'react-native';
|
|
4
|
-
import translate from 'google-translate-api-x';
|
|
5
4
|
import Modal from 'react-native-modal';
|
|
6
5
|
import Clipboard from '@react-native-clipboard/clipboard';
|
|
7
6
|
import LottieView from 'lottie-react-native';
|
|
@@ -346,24 +345,7 @@ const CustomTypography = ({
|
|
|
346
345
|
testID = "CUSTOM_TYPOGRAPHY",
|
|
347
346
|
...props
|
|
348
347
|
}) => {
|
|
349
|
-
const [translatedText, setTranslatedText] = useState(text || "");
|
|
350
348
|
const textStyle = FONT_STYLES[variant];
|
|
351
|
-
useEffect(() => {
|
|
352
|
-
const translateText = async () => {
|
|
353
|
-
if (!text || text.trim() === "") {
|
|
354
|
-
setTranslatedText(text || "");
|
|
355
|
-
return;
|
|
356
|
-
}
|
|
357
|
-
try {
|
|
358
|
-
const res = await translate(text, { to: "ar" });
|
|
359
|
-
setTranslatedText(res.text);
|
|
360
|
-
} catch (error) {
|
|
361
|
-
console.error("Translation error:", error);
|
|
362
|
-
setTranslatedText(text);
|
|
363
|
-
}
|
|
364
|
-
};
|
|
365
|
-
translateText();
|
|
366
|
-
}, [text]);
|
|
367
349
|
return /* @__PURE__ */ React.createElement(
|
|
368
350
|
Text,
|
|
369
351
|
{
|
|
@@ -371,7 +353,7 @@ const CustomTypography = ({
|
|
|
371
353
|
style: [textStyle, styles$B.container, style],
|
|
372
354
|
...props
|
|
373
355
|
},
|
|
374
|
-
|
|
356
|
+
text
|
|
375
357
|
);
|
|
376
358
|
};
|
|
377
359
|
const styles$B = StyleSheet.create({
|