dhre-ui-kit 0.0.93 → 0.0.95

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dhre-ui-kit",
3
- "version": "0.0.93",
3
+ "version": "0.0.95",
4
4
  "main": "src/index.ts",
5
5
  "files": [
6
6
  "src",
@@ -10,3 +10,10 @@ export interface DayType {
10
10
  year: number;
11
11
  timestamp: number;
12
12
  }
13
+
14
+ export interface MarkedDate {
15
+ startingDay?: boolean;
16
+ endingDay?: boolean;
17
+ color: string;
18
+ textColor: string;
19
+ }
@@ -2,7 +2,11 @@ import React, {useState} from 'react';
2
2
  import {View} from 'react-native';
3
3
  import {Calendar} from 'react-native-calendars';
4
4
  import Button from '../button';
5
- import {DateRangePickerProps, DayType} from './DateRangePicker.interface';
5
+ import {
6
+ DateRangePickerProps,
7
+ DayType,
8
+ MarkedDate,
9
+ } from './DateRangePicker.interface';
6
10
  import styles from './DateRangePicker.styles';
7
11
 
8
12
  const DateRangePicker = (props: DateRangePickerProps) => {
@@ -32,7 +36,8 @@ const DateRangePicker = (props: DateRangePickerProps) => {
32
36
 
33
37
  const getMarkedDates = () => {
34
38
  const {startDate, endDate} = selectedRange;
35
- const markedDates = {};
39
+
40
+ const markedDates: {[key: string]: MarkedDate} = {};
36
41
 
37
42
  if (startDate) {
38
43
  markedDates[startDate] = {
@@ -65,6 +70,8 @@ const DateRangePicker = (props: DateRangePickerProps) => {
65
70
  return markedDates;
66
71
  };
67
72
 
73
+ const isButtonDisabled = !selectedRange.startDate || !selectedRange.endDate;
74
+
68
75
  return (
69
76
  <View>
70
77
  <Calendar
@@ -92,6 +99,7 @@ const DateRangePicker = (props: DateRangePickerProps) => {
92
99
  }}
93
100
  containerStyle={styles.applyButton}
94
101
  textStyle={styles.applyButtonText}
102
+ disabled={isButtonDisabled}
95
103
  />
96
104
  </View>
97
105
  );
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import {Pressable, StyleSheet, View, ViewStyle} from 'react-native';
2
+ import {Pressable, StyleSheet, ViewStyle} from 'react-native';
3
3
  import {TextInput} from 'react-native-paper';
4
4
  import {DHRE_COLORS_TEXT, DHRE_DEFAULT} from '../../theme/colors';
5
5
  import {verticalScale, moderateScale} from '../../utils/stylehelper';
@@ -45,8 +45,7 @@ const CommonTextInput: React.FC<CommonTextInputProps> = ({
45
45
  pointerEvents,
46
46
  }) => {
47
47
  return (
48
- <View style={styles.container}>
49
- <Pressable onPress={handlePress} style={styles.touchable}>
48
+ <Pressable onPress={handlePress} style={styles.container}>
50
49
  <TextInput
51
50
  mode="outlined"
52
51
  outlineStyle={{
@@ -82,19 +81,16 @@ const CommonTextInput: React.FC<CommonTextInputProps> = ({
82
81
  }}
83
82
  />
84
83
  ) : null}
85
- </Pressable>
86
- </View>
84
+ </Pressable>
87
85
  );
88
86
  };
89
87
 
90
88
  const styles = StyleSheet.create({
91
89
  container: {
92
- flex: 1,
93
90
  justifyContent: 'center',
94
- alignItems: 'center',
95
91
  },
96
92
  touchable: {
97
- width: '100%', // Adjust width as needed
93
+ width: '100%',
98
94
  },
99
95
 
100
96
  input: {