dhre-ui-kit 0.0.73 → 0.0.75
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
package/src/App.tsx
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import {ThemeProvider} from './theme/ThemeContext';
|
|
3
|
-
import {Badge,
|
|
3
|
+
import {Badge, Line} from './index';
|
|
4
4
|
import {ArrowLeft, CalenderDots} from './assets';
|
|
5
5
|
import {View} from 'react-native';
|
|
6
6
|
import CustomButton from './components/button/Button';
|
|
@@ -8,7 +8,34 @@ import CustomButton from './components/button/Button';
|
|
|
8
8
|
const App = () => {
|
|
9
9
|
return (
|
|
10
10
|
<ThemeProvider>
|
|
11
|
-
<
|
|
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
|
+
/>
|
|
38
|
+
</View>
|
|
12
39
|
</ThemeProvider>
|
|
13
40
|
);
|
|
14
41
|
};
|
|
@@ -6,13 +6,14 @@ import {withThemeProvider} from '../../theme/withThemeProvider';
|
|
|
6
6
|
|
|
7
7
|
interface ScrollableListProps {
|
|
8
8
|
data: {name: string; value: string; isError?: boolean}[] | undefined;
|
|
9
|
-
handleSelectCategory: (value: string) => void;
|
|
9
|
+
handleSelectCategory: (name: string, value: string) => void;
|
|
10
10
|
containerStyle?: object;
|
|
11
11
|
scrollViewContentStyle?: object;
|
|
12
12
|
itemStyle?: object;
|
|
13
13
|
selectedItemStyle?: object;
|
|
14
14
|
selectedItemTextColor?: string;
|
|
15
15
|
defaultItemTextColor?: string;
|
|
16
|
+
activeTab?: string;
|
|
16
17
|
}
|
|
17
18
|
|
|
18
19
|
const ScrollableList = ({
|
|
@@ -24,6 +25,7 @@ const ScrollableList = ({
|
|
|
24
25
|
selectedItemStyle,
|
|
25
26
|
selectedItemTextColor = 'CONTENT_PRIMARY',
|
|
26
27
|
defaultItemTextColor = 'CONTENT_SECONDRY',
|
|
28
|
+
activeTab,
|
|
27
29
|
}: ScrollableListProps) => {
|
|
28
30
|
const [selectedItem, setSelectedItem] = useState<string | null>(
|
|
29
31
|
data && data.length > 0 ? data[0].name : null,
|
|
@@ -44,20 +46,20 @@ const ScrollableList = ({
|
|
|
44
46
|
style={[
|
|
45
47
|
styles.item,
|
|
46
48
|
itemStyle,
|
|
47
|
-
selectedItem === item.name && [
|
|
49
|
+
(activeTab ?? selectedItem) === item.name && [
|
|
48
50
|
styles.selectedItem,
|
|
49
51
|
selectedItemStyle,
|
|
50
52
|
],
|
|
51
53
|
]}
|
|
52
54
|
onPress={() => {
|
|
53
55
|
setSelectedItem(item.name);
|
|
54
|
-
handleSelectCategory(item.name);
|
|
56
|
+
handleSelectCategory(item.name, item.value);
|
|
55
57
|
}}>
|
|
56
58
|
<CustomText
|
|
57
59
|
text={item.name}
|
|
58
60
|
variant="L1_REGULAR"
|
|
59
61
|
textColor={
|
|
60
|
-
selectedItem === item.name
|
|
62
|
+
(activeTab ?? selectedItem) === item.name
|
|
61
63
|
? selectedItemTextColor
|
|
62
64
|
: defaultItemTextColor
|
|
63
65
|
}
|
|
@@ -19,6 +19,7 @@ interface CommonTextInputProps {
|
|
|
19
19
|
keyboardType?: 'default' | 'numeric' | 'email-address' | 'phone-pad';
|
|
20
20
|
maxLength?: number;
|
|
21
21
|
errorMessage?: string;
|
|
22
|
+
editable?: boolean;
|
|
22
23
|
}
|
|
23
24
|
|
|
24
25
|
const CommonTextInput: React.FC<CommonTextInputProps> = ({
|
|
@@ -33,6 +34,7 @@ const CommonTextInput: React.FC<CommonTextInputProps> = ({
|
|
|
33
34
|
inputStyle,
|
|
34
35
|
maxLength,
|
|
35
36
|
errorMessage,
|
|
37
|
+
editable = true,
|
|
36
38
|
}) => {
|
|
37
39
|
return (
|
|
38
40
|
<>
|
|
@@ -51,6 +53,7 @@ const CommonTextInput: React.FC<CommonTextInputProps> = ({
|
|
|
51
53
|
style={[errorMessage ? styles.errorInput : styles.input, inputStyle]}
|
|
52
54
|
maxLength={maxLength}
|
|
53
55
|
placeholder={placeholderText}
|
|
56
|
+
editable={editable}
|
|
54
57
|
/>
|
|
55
58
|
{errorMessage ? (
|
|
56
59
|
<CustomTypography
|
|
@@ -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];
|