dhre-ui-kit 0.0.87 → 0.0.89
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 +2 -1
- package/src/App.tsx +31 -4
- package/src/components/customDocumentPicker/CustomDocumentPicker.interface.ts +1 -1
- package/src/components/customDocumentPicker/CustomDocumentPicker.tsx +3 -1
- package/src/components/customSlideButton/index.tsx +3 -3
- package/src/theme/ThemeContext.tsx +2 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dhre-ui-kit",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.89",
|
|
4
4
|
"main": "src/index.ts",
|
|
5
5
|
"files": [
|
|
6
6
|
"src",
|
|
@@ -34,6 +34,7 @@
|
|
|
34
34
|
"react-native-country-picker-modal": "^2.0.0",
|
|
35
35
|
"react-native-document-picker": "^9.3.1",
|
|
36
36
|
"react-native-element-dropdown": "^2.12.1",
|
|
37
|
+
"react-native-fs": "^2.20.0",
|
|
37
38
|
"react-native-gesture-handler": "2.17.0",
|
|
38
39
|
"react-native-otp-verify": "^1.1.8",
|
|
39
40
|
"react-native-paper": "^5.12.5",
|
package/src/App.tsx
CHANGED
|
@@ -1,13 +1,40 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {ThemeProvider} from './theme/ThemeContext';
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
3
|
+
import {Badge, Line} from './index';
|
|
4
|
+
import {ArrowLeft, CalenderDots} from './assets';
|
|
5
|
+
import {View} from 'react-native';
|
|
6
|
+
import CustomButton from './components/button/Button';
|
|
5
7
|
|
|
6
8
|
const App = () => {
|
|
7
9
|
return (
|
|
8
10
|
<ThemeProvider>
|
|
9
|
-
<View style={{
|
|
10
|
-
|
|
11
|
+
<View style={{marginTop: 50}}>
|
|
12
|
+
<Badge
|
|
13
|
+
handleIconPress={function (): void {}}
|
|
14
|
+
text="gggsdfghjhgf"
|
|
15
|
+
style={{margin: 20}}
|
|
16
|
+
iconName={<CalenderDots width={20} height={20} />}
|
|
17
|
+
textStyle={{color: 'black'}}
|
|
18
|
+
iconStyle={{}}
|
|
19
|
+
/>
|
|
20
|
+
<Line />
|
|
21
|
+
<CustomButton
|
|
22
|
+
title="Yes"
|
|
23
|
+
onPress={() => console.log('Yes Button Pressed')}
|
|
24
|
+
leftIcon={<ArrowLeft />}
|
|
25
|
+
// titleColor={color.CONTENT_SECONDRY[currentTheme]}
|
|
26
|
+
titleVariant="L2_REGULAR"
|
|
27
|
+
containerStyle={[
|
|
28
|
+
{
|
|
29
|
+
borderWidth: 1,
|
|
30
|
+
borderRadius: 20,
|
|
31
|
+
|
|
32
|
+
height: 40,
|
|
33
|
+
},
|
|
34
|
+
]}
|
|
35
|
+
// iconStyle={styles.iconStyle}
|
|
36
|
+
imagePosition="left"
|
|
37
|
+
/>
|
|
11
38
|
</View>
|
|
12
39
|
</ThemeProvider>
|
|
13
40
|
);
|
|
@@ -2,7 +2,7 @@ import {TextStyle, ViewStyle} from 'react-native';
|
|
|
2
2
|
import {DocumentPickerResponse} from 'react-native-document-picker';
|
|
3
3
|
|
|
4
4
|
export interface CustomDocumentPickerProps {
|
|
5
|
-
onDocumentUpload: (
|
|
5
|
+
onDocumentUpload: (base64: string, document?: DocumentPickerResponse) => void;
|
|
6
6
|
title?: string;
|
|
7
7
|
hint?: string;
|
|
8
8
|
maxFileSize?: number;
|
|
@@ -3,6 +3,7 @@ import {View, Pressable, Alert} from 'react-native';
|
|
|
3
3
|
import DocumentPicker, {
|
|
4
4
|
DocumentPickerResponse,
|
|
5
5
|
} from 'react-native-document-picker';
|
|
6
|
+
import RNFS from 'react-native-fs';
|
|
6
7
|
import {FileIcon, Trash, UploadFile} from '../../assets';
|
|
7
8
|
import {FontStyle} from '../../utils/appEnum';
|
|
8
9
|
import CustomTypography from '../customTypography';
|
|
@@ -40,7 +41,8 @@ const CustomDocumentPicker = ({
|
|
|
40
41
|
|
|
41
42
|
setError(''); // Clear error on successful upload
|
|
42
43
|
setDocDetails(res);
|
|
43
|
-
|
|
44
|
+
const base64Data = await RNFS.readFile(res.uri, 'base64');
|
|
45
|
+
onDocumentUpload(base64Data, res); // Pass base64 data to onDocumentUpload
|
|
44
46
|
} catch (err) {
|
|
45
47
|
if (DocumentPicker.isCancel(err)) {
|
|
46
48
|
Alert.alert('User canceled the picker');
|
|
@@ -48,14 +48,14 @@ const CustomSlideButton = ({label, onComplete}: CustomSlideButtonProps) => {
|
|
|
48
48
|
<View
|
|
49
49
|
style={{
|
|
50
50
|
...styles.sliderContainer,
|
|
51
|
-
backgroundColor: theme.
|
|
51
|
+
backgroundColor: theme.SURFACE_INVERTED,
|
|
52
52
|
}}>
|
|
53
53
|
<View style={styles.buttonTextCOntainer}>
|
|
54
54
|
<CustomTypography
|
|
55
55
|
text={label}
|
|
56
56
|
variant={FontStyle.L1_REGULAR}
|
|
57
57
|
style={{
|
|
58
|
-
color: theme.
|
|
58
|
+
color: theme.CONTENT_INVERTED,
|
|
59
59
|
}}
|
|
60
60
|
/>
|
|
61
61
|
</View>
|
|
@@ -65,7 +65,7 @@ const CustomSlideButton = ({label, onComplete}: CustomSlideButtonProps) => {
|
|
|
65
65
|
<View
|
|
66
66
|
style={{
|
|
67
67
|
...styles.button,
|
|
68
|
-
backgroundColor: theme.
|
|
68
|
+
backgroundColor: theme.SURFACE_PRIMARY,
|
|
69
69
|
width: BUTTON_WIDTH,
|
|
70
70
|
}}>
|
|
71
71
|
<CaretRight />
|
|
@@ -14,8 +14,8 @@ interface ThemeProviderProps {
|
|
|
14
14
|
|
|
15
15
|
export const ThemeProvider: React.FC<ThemeProviderProps> = ({children}) => {
|
|
16
16
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
17
|
-
|
|
18
|
-
const mode = 'light'
|
|
17
|
+
const mode = useSelector((state: any) => state.theme.currentTheme);
|
|
18
|
+
// const mode = 'light'
|
|
19
19
|
// Filter the theme based on the mode (light or dark)
|
|
20
20
|
const filteredTheme = Object.keys(theme).reduce((acc, key) => {
|
|
21
21
|
acc[key] = theme[key][mode];
|