react-native-nepali-picker 1.0.5 → 1.0.7
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/commonjs/CalendarPicker.js +13 -6
- package/lib/commonjs/CalendarPicker.js.map +1 -1
- package/lib/commonjs/assets/DateSync.js +6 -7
- package/lib/commonjs/assets/Triangle.js +3 -3
- package/lib/commonjs/calendar/functions.js +1 -3
- package/lib/commonjs/calendar/functions.js.map +1 -1
- package/lib/commonjs/calendar/settings.js +1 -1
- package/lib/commonjs/calendar/settings.js.map +1 -1
- package/lib/commonjs/index.js.map +2 -1
- package/lib/module/CalendarPicker.js +80 -50
- package/lib/module/CalendarPicker.js.map +2 -1
- package/lib/module/assets/DateSync.js +6 -7
- package/lib/module/assets/DateSync.js.map +1 -0
- package/lib/module/assets/Icons.js +18 -12
- package/lib/module/assets/Icons.js.map +1 -0
- package/lib/module/assets/Triangle.js +3 -3
- package/lib/module/assets/Triangle.js.map +1 -0
- package/lib/module/assets/cIcon.js.map +1 -0
- package/lib/module/calendar/functions.js +1 -3
- package/lib/module/calendar/functions.js.map +1 -1
- package/lib/module/calendar/settings.js +1 -1
- package/lib/module/calendar/settings.js.map +1 -1
- package/lib/module/types.js.map +1 -0
- package/lib/typescript/commonjs/src/CalendarPicker.d.ts.map +1 -1
- package/lib/typescript/commonjs/src/calendar/functions.d.ts.map +1 -1
- package/lib/typescript/module/src/CalendarPicker.d.ts.map +1 -1
- package/lib/typescript/module/src/calendar/functions.d.ts.map +1 -1
- package/package.json +2 -1
- package/src/CalendarPicker.js +283 -0
- package/src/CalendarPicker.tsx +15 -7
- package/src/assets/DateSync.js +66 -0
- package/src/assets/Icons.js +109 -0
- package/src/assets/Triangle.js +25 -0
- package/src/assets/cIcon.js +45 -0
- package/src/calendar/config.js +149 -0
- package/src/calendar/functions.js +121 -0
- package/src/calendar/functions.ts +2 -0
- package/src/calendar/settings.js +35 -0
- package/src/calendar/settings.ts +1 -1
- package/src/index.js +2 -0
- package/src/types.js +1 -0
|
@@ -0,0 +1,283 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { useEffect, useState } from 'react';
|
|
3
|
+
import { View, Text, Modal, Pressable, StyleSheet, TouchableOpacity, ScrollView, } from 'react-native';
|
|
4
|
+
import { bs, daysInEnglish, daysInNepali, getNepaliNumber, monthsInEnglish, monthsInNepali, } from './calendar/config';
|
|
5
|
+
import { calcFirstDay, isToday } from './calendar/settings';
|
|
6
|
+
import { NepaliToday, validateDate } from './calendar/functions';
|
|
7
|
+
import { ChevronIcon } from './assets/Icons';
|
|
8
|
+
import DateSyncLogo from './assets/DateSync';
|
|
9
|
+
import Triangle from './assets/Triangle';
|
|
10
|
+
const CalendarPicker = ({ visible, onClose, theme = 'light', onDateSelect, language = 'np', initialDate = NepaliToday(), brandColor = '#2081b9', titleTextStyle = {
|
|
11
|
+
fontSize: 20,
|
|
12
|
+
fontWeight: 'bold',
|
|
13
|
+
}, weekTextStyle = {
|
|
14
|
+
fontSize: 15,
|
|
15
|
+
fontWeight: 'bold',
|
|
16
|
+
}, dayTextStyle = {
|
|
17
|
+
fontSize: 15,
|
|
18
|
+
fontWeight: '600',
|
|
19
|
+
}, }) => {
|
|
20
|
+
const value = validateDate(initialDate);
|
|
21
|
+
console.log('the initial date is ', initialDate);
|
|
22
|
+
const [TodayNepaliDate, setTodayNepaliDate] = useState(initialDate);
|
|
23
|
+
const cYear = parseInt(TodayNepaliDate.split('-')[0], 10);
|
|
24
|
+
const cMonth = parseInt(TodayNepaliDate.split('-')[1], 10);
|
|
25
|
+
const cDay = parseInt(TodayNepaliDate.split('-')[2], 10);
|
|
26
|
+
const [firstDayOfMonth, setFirstDayOfMonth] = useState(0);
|
|
27
|
+
const [month, setMonth] = useState(cMonth);
|
|
28
|
+
const [year, setYear] = useState(cYear);
|
|
29
|
+
const [calendarDate, setCalendarDate] = useState([]);
|
|
30
|
+
const [yearModal, setYearModal] = useState(false);
|
|
31
|
+
const syncToday = () => {
|
|
32
|
+
setMonth(cMonth);
|
|
33
|
+
setYear(cYear);
|
|
34
|
+
};
|
|
35
|
+
const handleDateClick = (day) => {
|
|
36
|
+
const date = `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
|
|
37
|
+
setTodayNepaliDate(date);
|
|
38
|
+
onDateSelect(date);
|
|
39
|
+
onClose();
|
|
40
|
+
};
|
|
41
|
+
useEffect(() => {
|
|
42
|
+
setTodayNepaliDate(initialDate);
|
|
43
|
+
}, [initialDate]);
|
|
44
|
+
//Handle Next Month Click
|
|
45
|
+
const handleNextClick = () => {
|
|
46
|
+
if (month === 12) {
|
|
47
|
+
if (year < 2099) {
|
|
48
|
+
setYear((prev) => prev + 1);
|
|
49
|
+
setMonth(1);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
setMonth((prev) => prev + 1);
|
|
54
|
+
}
|
|
55
|
+
};
|
|
56
|
+
//Handle Previous Month Click
|
|
57
|
+
const handlePreviousClick = () => {
|
|
58
|
+
if (month === 1) {
|
|
59
|
+
if (year > 2000) {
|
|
60
|
+
setYear((prev) => prev - 1);
|
|
61
|
+
setMonth(12);
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
setMonth((prev) => prev - 1);
|
|
66
|
+
}
|
|
67
|
+
};
|
|
68
|
+
const openYearView = () => {
|
|
69
|
+
setYearModal(true);
|
|
70
|
+
};
|
|
71
|
+
const closeYearView = () => {
|
|
72
|
+
setYearModal(false);
|
|
73
|
+
};
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
// calculate First Day Of Month (FDOM) and Days In Month(DIM)
|
|
76
|
+
const FDOM = calcFirstDay(year, month);
|
|
77
|
+
const DIM = bs[year][month];
|
|
78
|
+
setFirstDayOfMonth(FDOM);
|
|
79
|
+
// array which contain 42 cells and it only fill the date with number if the date is present otherwise it fill cells with null.
|
|
80
|
+
const calendarCells = Array.from({ length: 42 }, (_, index) => {
|
|
81
|
+
const dayNumber = index - FDOM + 1;
|
|
82
|
+
if (dayNumber > 0 && dayNumber <= DIM) {
|
|
83
|
+
return dayNumber;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
return null;
|
|
87
|
+
}
|
|
88
|
+
});
|
|
89
|
+
setCalendarDate(calendarCells);
|
|
90
|
+
}, [year, month, initialDate]);
|
|
91
|
+
const handleYearClick = (y) => {
|
|
92
|
+
setYear(y);
|
|
93
|
+
closeYearView();
|
|
94
|
+
};
|
|
95
|
+
const dark = theme === 'dark';
|
|
96
|
+
const weekDays = language === 'en' ? daysInEnglish : daysInNepali;
|
|
97
|
+
if (value !== true) {
|
|
98
|
+
return (_jsx(Modal, { visible: visible, onRequestClose: onClose, transparent: true, children: _jsx(Pressable, { style: styles.outerPressable, onPress: onClose, children: _jsx(Pressable, { onPress: () => { }, style: styles.innerPressable, children: _jsxs(View, { style: {
|
|
99
|
+
...styles.innerView,
|
|
100
|
+
minHeight: '40%',
|
|
101
|
+
minWidth: '90%',
|
|
102
|
+
justifyContent: 'center',
|
|
103
|
+
alignItems: 'center',
|
|
104
|
+
backgroundColor: dark ? '#383838' : '#ffffff',
|
|
105
|
+
}, children: [_jsx(Text, { style: {
|
|
106
|
+
color: dark ? 'white' : 'black',
|
|
107
|
+
fontWeight: '600',
|
|
108
|
+
paddingHorizontal: 10,
|
|
109
|
+
paddingVertical: 10,
|
|
110
|
+
}, children: "Unsupported date range on initialDate" }), _jsx(Text, { style: {
|
|
111
|
+
color: dark ? 'white' : 'black',
|
|
112
|
+
paddingHorizontal: 10,
|
|
113
|
+
}, children: value })] }) }) }) }));
|
|
114
|
+
}
|
|
115
|
+
return (_jsxs(Modal, { visible: visible, onRequestClose: onClose, transparent: true, children: [_jsx(Pressable, { style: styles.outerPressable, onPress: onClose, children: _jsx(Pressable, { onPress: () => { }, style: styles.innerPressable, children: _jsxs(View, { style: {
|
|
116
|
+
...styles.innerView,
|
|
117
|
+
backgroundColor: dark ? '#383838' : '#ffffff',
|
|
118
|
+
}, children: [_jsx(Text, { style: {
|
|
119
|
+
color: dark ? 'white' : 'black',
|
|
120
|
+
paddingHorizontal: 10,
|
|
121
|
+
}, children: language === 'np' ? 'आजको मिति ' : "Today's Date" }), _jsxs(View, { style: {
|
|
122
|
+
display: 'flex',
|
|
123
|
+
flexDirection: 'row',
|
|
124
|
+
justifyContent: 'space-between',
|
|
125
|
+
paddingHorizontal: 10,
|
|
126
|
+
marginBottom: 20,
|
|
127
|
+
alignItems: 'center',
|
|
128
|
+
}, children: [_jsx(View, { children: _jsx(TouchableOpacity, { onPress: syncToday, children: language == 'np' ? (_jsxs(Text, { style: {
|
|
129
|
+
...titleTextStyle,
|
|
130
|
+
color: dark ? '#fff' : '#000',
|
|
131
|
+
}, children: [getNepaliNumber(cYear), " ", monthsInNepali[cMonth - 1], ' ', " ", getNepaliNumber(cDay)] })) : (_jsxs(Text, { style: {
|
|
132
|
+
...titleTextStyle,
|
|
133
|
+
color: dark ? '#fff' : '#000',
|
|
134
|
+
}, children: [cYear, " ", monthsInEnglish[cMonth - 1], ' ', " ", cDay] })) }) }), _jsx(TouchableOpacity, { onPress: syncToday, children: _jsx(DateSyncLogo, { day: cDay, color: dark ? '#ffff' : '#000' }) })] }), _jsxs(View, { style: styles.ButtonContainer, children: [_jsx(TouchableOpacity, { style: styles.CButton, onPress: handlePreviousClick, children: _jsx(ChevronIcon, { direction: "right", color: dark ? 'white' : 'black' }) }), _jsxs(TouchableOpacity, { style: { flexDirection: 'row', alignItems: 'center' }, onPress: openYearView, children: [_jsx(Text, { style: {
|
|
135
|
+
...titleTextStyle,
|
|
136
|
+
marginRight: 6,
|
|
137
|
+
color: dark ? 'white' : 'black',
|
|
138
|
+
}, children: language === 'np'
|
|
139
|
+
? monthsInNepali[month - 1]
|
|
140
|
+
: monthsInEnglish[month - 1] }), _jsx(Text, { style: {
|
|
141
|
+
...titleTextStyle,
|
|
142
|
+
marginRight: 10,
|
|
143
|
+
color: dark ? 'white' : 'black',
|
|
144
|
+
}, children: language === 'np' ? getNepaliNumber(year) : year }), _jsx(Triangle, { height: 10, width: 13, color: dark ? 'white' : 'black' })] }), _jsx(TouchableOpacity, { style: styles.CButton, onPress: handleNextClick, children: _jsx(ChevronIcon, { direction: "left", color: dark ? 'white' : 'black' }) })] }), _jsxs(View, { style: styles.outerDateConainer, children: [_jsx(View, { style: styles.weekContainer, children: weekDays.map((item, index) => {
|
|
145
|
+
return (_jsx(View, { style: styles.WeekItem, children: _jsx(Text, { style: {
|
|
146
|
+
...weekTextStyle,
|
|
147
|
+
color: dark ? 'white' : 'black',
|
|
148
|
+
}, children: item }) }, index));
|
|
149
|
+
}) }), _jsx(View, { style: styles.datesContainer, children: calendarDate.map((dayItem, index) => {
|
|
150
|
+
return (_jsx(TouchableOpacity, { style: styles.dateItem, onPress:
|
|
151
|
+
//execute on day item press, Only execute when dayItem is not null
|
|
152
|
+
dayItem ? () => handleDateClick(dayItem) : () => { }, children: dayItem ? (_jsx(View, { style: {
|
|
153
|
+
paddingHorizontal: 6,
|
|
154
|
+
paddingVertical: 3,
|
|
155
|
+
borderRadius: 999,
|
|
156
|
+
//check if the date is today or not and apply conditional styling.
|
|
157
|
+
backgroundColor: isToday(TodayNepaliDate, index, year, month, firstDayOfMonth)
|
|
158
|
+
? brandColor
|
|
159
|
+
: dark
|
|
160
|
+
? '#383838'
|
|
161
|
+
: '#fff',
|
|
162
|
+
}, children: _jsx(Text, { style: {
|
|
163
|
+
...dayTextStyle,
|
|
164
|
+
color: isToday(TodayNepaliDate, index, year, month, firstDayOfMonth)
|
|
165
|
+
? '#fff'
|
|
166
|
+
: dark
|
|
167
|
+
? 'white'
|
|
168
|
+
: 'black',
|
|
169
|
+
}, children: language === 'np'
|
|
170
|
+
? getNepaliNumber(dayItem)
|
|
171
|
+
: dayItem }) })) : null }, index));
|
|
172
|
+
}) })] })] }) }) }), _jsx(Modal, { visible: yearModal, onRequestClose: closeYearView, transparent: true, children: _jsx(Pressable, { style: styles.outerPressable, onPress: () => closeYearView(), children: _jsx(Pressable, { style: styles.YearInnerPressable, onPress: () => { }, children: _jsx(View, { style: {
|
|
173
|
+
...styles.InnerYearView,
|
|
174
|
+
backgroundColor: dark ? '#383838' : '#f2f2f2',
|
|
175
|
+
}, children: _jsx(ScrollView, { showsVerticalScrollIndicator: false, contentContainerStyle: {
|
|
176
|
+
display: 'flex',
|
|
177
|
+
paddingVertical: 10,
|
|
178
|
+
flexDirection: 'row',
|
|
179
|
+
justifyContent: 'center',
|
|
180
|
+
flexWrap: 'wrap',
|
|
181
|
+
}, children: Array(100)
|
|
182
|
+
.fill(0)
|
|
183
|
+
.map((_, index) => {
|
|
184
|
+
return (_jsx(TouchableOpacity, { onPress: () => handleYearClick(index + 2000), style: {
|
|
185
|
+
paddingHorizontal: 20,
|
|
186
|
+
paddingVertical: 6,
|
|
187
|
+
marginHorizontal: 4,
|
|
188
|
+
marginVertical: 4,
|
|
189
|
+
borderColor: dark ? 'white' : 'black',
|
|
190
|
+
borderRadius: 20,
|
|
191
|
+
backgroundColor: index + 2000 === year ? brandColor : '',
|
|
192
|
+
borderWidth: 0.4,
|
|
193
|
+
}, children: _jsx(Text, { style: {
|
|
194
|
+
fontWeight: '500',
|
|
195
|
+
color: index + 2000 === year
|
|
196
|
+
? 'white'
|
|
197
|
+
: dark
|
|
198
|
+
? 'white'
|
|
199
|
+
: 'black',
|
|
200
|
+
}, children: language === 'np'
|
|
201
|
+
? getNepaliNumber(index + 2000)
|
|
202
|
+
: index + 2000 }) }, index));
|
|
203
|
+
}) }) }) }) }) })] }));
|
|
204
|
+
};
|
|
205
|
+
const styles = StyleSheet.create({
|
|
206
|
+
outerPressable: {
|
|
207
|
+
height: '100%',
|
|
208
|
+
justifyContent: 'center',
|
|
209
|
+
width: '100%',
|
|
210
|
+
alignItems: 'center',
|
|
211
|
+
backgroundColor: 'rgba(0,0,0,0.54)',
|
|
212
|
+
},
|
|
213
|
+
innerPressable: {
|
|
214
|
+
minHeight: '20%',
|
|
215
|
+
maxWidth: 500,
|
|
216
|
+
marginHorizontal: 30,
|
|
217
|
+
},
|
|
218
|
+
innerView: {
|
|
219
|
+
borderRadius: 20,
|
|
220
|
+
backgroundColor: '#f2f2f2',
|
|
221
|
+
padding: 10,
|
|
222
|
+
},
|
|
223
|
+
weekContainer: {
|
|
224
|
+
flexDirection: 'row',
|
|
225
|
+
width: '100%',
|
|
226
|
+
},
|
|
227
|
+
WeekItem: {
|
|
228
|
+
width: '14.28%',
|
|
229
|
+
alignItems: 'center',
|
|
230
|
+
paddingVertical: 18,
|
|
231
|
+
},
|
|
232
|
+
//WeekText: {
|
|
233
|
+
// fontWeight: 'bold',
|
|
234
|
+
// fontSize: 14,
|
|
235
|
+
// color: 'black',
|
|
236
|
+
//},
|
|
237
|
+
datesContainer: {
|
|
238
|
+
flexDirection: 'row',
|
|
239
|
+
flexWrap: 'wrap',
|
|
240
|
+
},
|
|
241
|
+
dateItem: {
|
|
242
|
+
overflow: 'hidden',
|
|
243
|
+
width: '14.28%',
|
|
244
|
+
justifyContent: 'center',
|
|
245
|
+
alignItems: 'center',
|
|
246
|
+
paddingVertical: 10,
|
|
247
|
+
},
|
|
248
|
+
//DayText: {
|
|
249
|
+
// fontSize: 14,
|
|
250
|
+
// fontWeight: '600',
|
|
251
|
+
//},
|
|
252
|
+
CButton: {
|
|
253
|
+
paddingHorizontal: 20,
|
|
254
|
+
paddingVertical: 10,
|
|
255
|
+
},
|
|
256
|
+
ButtonContainer: {
|
|
257
|
+
alignItems: 'center',
|
|
258
|
+
flexDirection: 'row',
|
|
259
|
+
marginBottom: 10,
|
|
260
|
+
justifyContent: 'space-between',
|
|
261
|
+
},
|
|
262
|
+
outerDateConainer: {
|
|
263
|
+
paddingHorizontal: 3,
|
|
264
|
+
},
|
|
265
|
+
//TitleText: {
|
|
266
|
+
// fontSize: 20,
|
|
267
|
+
// fontWeight: 'bold',
|
|
268
|
+
//},
|
|
269
|
+
// for year view modal
|
|
270
|
+
YearInnerPressable: {
|
|
271
|
+
justifyContent: 'center',
|
|
272
|
+
maxWidth: 500,
|
|
273
|
+
maxHeight: '70%',
|
|
274
|
+
marginHorizontal: 30,
|
|
275
|
+
},
|
|
276
|
+
InnerYearView: {
|
|
277
|
+
borderRadius: 20,
|
|
278
|
+
backgroundColor: '#f2f2f2',
|
|
279
|
+
minHeight: 50,
|
|
280
|
+
maxHeight: '100%',
|
|
281
|
+
},
|
|
282
|
+
});
|
|
283
|
+
export default CalendarPicker;
|
package/src/CalendarPicker.tsx
CHANGED
|
@@ -45,7 +45,7 @@ const CalendarPicker = ({
|
|
|
45
45
|
},
|
|
46
46
|
}: CalendarPickerProps) => {
|
|
47
47
|
const value = validateDate(initialDate);
|
|
48
|
-
console.log('
|
|
48
|
+
console.log('the initial date is ', initialDate);
|
|
49
49
|
const [TodayNepaliDate, setTodayNepaliDate] = useState(initialDate);
|
|
50
50
|
const cYear = parseInt(TodayNepaliDate.split('-')[0], 10);
|
|
51
51
|
const cMonth = parseInt(TodayNepaliDate.split('-')[1], 10);
|
|
@@ -57,6 +57,12 @@ const CalendarPicker = ({
|
|
|
57
57
|
const [calendarDate, setCalendarDate] = useState<(number | null)[]>([]);
|
|
58
58
|
|
|
59
59
|
const [yearModal, setYearModal] = useState<boolean>(false);
|
|
60
|
+
|
|
61
|
+
const syncToday = () => {
|
|
62
|
+
setMonth(cMonth);
|
|
63
|
+
setYear(cYear);
|
|
64
|
+
};
|
|
65
|
+
|
|
60
66
|
const handleDateClick = (day: number) => {
|
|
61
67
|
const date = `${year}-${month.toString().padStart(2, '0')}-${day.toString().padStart(2, '0')}`;
|
|
62
68
|
setTodayNepaliDate(date);
|
|
@@ -64,6 +70,11 @@ const CalendarPicker = ({
|
|
|
64
70
|
onClose();
|
|
65
71
|
};
|
|
66
72
|
|
|
73
|
+
useEffect(() => {
|
|
74
|
+
setTodayNepaliDate(initialDate);
|
|
75
|
+
}, [initialDate]);
|
|
76
|
+
|
|
77
|
+
//Handle Next Month Click
|
|
67
78
|
const handleNextClick = () => {
|
|
68
79
|
if (month === 12) {
|
|
69
80
|
if (year < 2099) {
|
|
@@ -74,6 +85,8 @@ const CalendarPicker = ({
|
|
|
74
85
|
setMonth((prev) => prev + 1);
|
|
75
86
|
}
|
|
76
87
|
};
|
|
88
|
+
|
|
89
|
+
//Handle Previous Month Click
|
|
77
90
|
const handlePreviousClick = () => {
|
|
78
91
|
if (month === 1) {
|
|
79
92
|
if (year > 2000) {
|
|
@@ -109,12 +122,7 @@ const CalendarPicker = ({
|
|
|
109
122
|
}
|
|
110
123
|
});
|
|
111
124
|
setCalendarDate(calendarCells);
|
|
112
|
-
}, [year, month]);
|
|
113
|
-
|
|
114
|
-
const syncToday = () => {
|
|
115
|
-
setMonth(cMonth);
|
|
116
|
-
setYear(cYear);
|
|
117
|
-
};
|
|
125
|
+
}, [year, month, initialDate]);
|
|
118
126
|
|
|
119
127
|
const handleYearClick = (y: number) => {
|
|
120
128
|
setYear(y);
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { View, Text, StyleSheet } from 'react-native';
|
|
3
|
+
const DateSyncLogo = ({ size = 28, color = '#003a05', day = 0 }) => {
|
|
4
|
+
const scale = size / 24;
|
|
5
|
+
// Format the date as DD
|
|
6
|
+
return (_jsxs(View, { style: [styles.container, { width: size, height: size }], children: [_jsx(View, { style: [styles.calendarBase, { borderColor: color }], children: _jsx(Text, { style: [styles.dateText, { color: color, fontSize: 9 * scale }], children: day }) }), _jsx(View, { style: [styles.calendarTop, { borderColor: color, top: 2 * scale }] })] }));
|
|
7
|
+
};
|
|
8
|
+
const styles = StyleSheet.create({
|
|
9
|
+
container: {
|
|
10
|
+
aspectRatio: 1,
|
|
11
|
+
position: 'relative',
|
|
12
|
+
},
|
|
13
|
+
calendarBase: {
|
|
14
|
+
position: 'absolute',
|
|
15
|
+
left: '12.5%',
|
|
16
|
+
top: '12.5%',
|
|
17
|
+
width: '75%',
|
|
18
|
+
height: '75%',
|
|
19
|
+
borderWidth: 2,
|
|
20
|
+
borderRadius: 3,
|
|
21
|
+
justifyContent: 'center',
|
|
22
|
+
alignItems: 'center',
|
|
23
|
+
},
|
|
24
|
+
dateText: {
|
|
25
|
+
fontWeight: '800',
|
|
26
|
+
},
|
|
27
|
+
calendarTop: {
|
|
28
|
+
position: 'absolute',
|
|
29
|
+
left: '12.5%',
|
|
30
|
+
width: '75%',
|
|
31
|
+
height: '20%',
|
|
32
|
+
borderTopWidth: 4,
|
|
33
|
+
borderLeftWidth: 2,
|
|
34
|
+
borderRightWidth: 2,
|
|
35
|
+
borderTopLeftRadius: 10,
|
|
36
|
+
borderTopRightRadius: 0,
|
|
37
|
+
},
|
|
38
|
+
syncCircle: {
|
|
39
|
+
position: 'absolute',
|
|
40
|
+
width: '50%',
|
|
41
|
+
height: '50%',
|
|
42
|
+
borderWidth: 2,
|
|
43
|
+
borderRadius: 100,
|
|
44
|
+
justifyContent: 'center',
|
|
45
|
+
alignItems: 'center',
|
|
46
|
+
},
|
|
47
|
+
syncArrow: {
|
|
48
|
+
position: 'absolute',
|
|
49
|
+
width: '40%',
|
|
50
|
+
height: '40%',
|
|
51
|
+
borderWidth: 2,
|
|
52
|
+
borderTopWidth: 0,
|
|
53
|
+
borderRightWidth: 0,
|
|
54
|
+
transform: [{ rotate: '45deg' }],
|
|
55
|
+
},
|
|
56
|
+
syncArrowLeft: {
|
|
57
|
+
left: '15%',
|
|
58
|
+
top: '10%',
|
|
59
|
+
},
|
|
60
|
+
syncArrowRight: {
|
|
61
|
+
right: '15%',
|
|
62
|
+
bottom: '10%',
|
|
63
|
+
transform: [{ rotate: '225deg' }],
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
export default DateSyncLogo;
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
const ChevronIcon = ({ direction = 'right', size = 15, color = '#000' }) => {
|
|
4
|
+
const isLeft = direction === 'left';
|
|
5
|
+
return (_jsxs(View, { style: [styles.container, { width: size, height: size }], children: [_jsx(View, { style: [
|
|
6
|
+
styles.line,
|
|
7
|
+
isLeft ? styles.leftTop : styles.rightTop,
|
|
8
|
+
{ backgroundColor: color },
|
|
9
|
+
] }), _jsx(View, { style: [
|
|
10
|
+
styles.line,
|
|
11
|
+
isLeft ? styles.leftBottom : styles.rightBottom,
|
|
12
|
+
{ backgroundColor: color },
|
|
13
|
+
] })] }));
|
|
14
|
+
};
|
|
15
|
+
const EditPencilIcon = ({ size = 24, color = '#000' }) => {
|
|
16
|
+
return (_jsxs(View, { style: [styles.container, { width: size, height: size }], children: [_jsx(View, { style: [styles.pencilBody, { backgroundColor: color }] }), _jsx(View, { style: [styles.pencilTip, { borderBottomColor: color }] }), _jsx(View, { style: [styles.pencilEraser, { backgroundColor: '#FFA07A' }] })] }));
|
|
17
|
+
};
|
|
18
|
+
const Triangle = ({ width = 10, height = 20, color = 'white' }) => {
|
|
19
|
+
return (_jsx(View, { style: [
|
|
20
|
+
styles.triangle,
|
|
21
|
+
{
|
|
22
|
+
borderLeftWidth: width / 2,
|
|
23
|
+
borderRightWidth: width / 2,
|
|
24
|
+
borderBottomWidth: height,
|
|
25
|
+
borderBottomColor: color,
|
|
26
|
+
},
|
|
27
|
+
] }));
|
|
28
|
+
};
|
|
29
|
+
const ChevronDown = ({ size = 10, color = '#000' }) => {
|
|
30
|
+
return (_jsxs(View, { style: [
|
|
31
|
+
styles.container,
|
|
32
|
+
{ width: size, height: size, transform: [{ rotate: '-90deg' }] },
|
|
33
|
+
], children: [_jsx(View, { style: [styles.line, styles.rightTop, { backgroundColor: color }] }), _jsx(View, { style: [styles.line, styles.rightBottom, { backgroundColor: color }] })] }));
|
|
34
|
+
};
|
|
35
|
+
const styles = StyleSheet.create({
|
|
36
|
+
container: {
|
|
37
|
+
justifyContent: 'center',
|
|
38
|
+
alignItems: 'center',
|
|
39
|
+
},
|
|
40
|
+
line: {
|
|
41
|
+
position: 'absolute',
|
|
42
|
+
width: '90%',
|
|
43
|
+
height: 2,
|
|
44
|
+
},
|
|
45
|
+
leftTop: {
|
|
46
|
+
top: '15%',
|
|
47
|
+
left: '20%',
|
|
48
|
+
transform: [{ rotate: '45deg' }],
|
|
49
|
+
},
|
|
50
|
+
leftBottom: {
|
|
51
|
+
bottom: '15%',
|
|
52
|
+
left: '20%',
|
|
53
|
+
transform: [{ rotate: '-45deg' }],
|
|
54
|
+
},
|
|
55
|
+
rightTop: {
|
|
56
|
+
top: '15%',
|
|
57
|
+
right: '20%',
|
|
58
|
+
transform: [{ rotate: '-45deg' }],
|
|
59
|
+
},
|
|
60
|
+
rightBottom: {
|
|
61
|
+
bottom: '15%',
|
|
62
|
+
right: '20%',
|
|
63
|
+
transform: [{ rotate: '45deg' }],
|
|
64
|
+
},
|
|
65
|
+
triangle: {
|
|
66
|
+
width: 0,
|
|
67
|
+
height: 0,
|
|
68
|
+
backgroundColor: 'transparent',
|
|
69
|
+
borderStyle: 'solid',
|
|
70
|
+
borderLeftWidth: 6,
|
|
71
|
+
borderRightWidth: 6,
|
|
72
|
+
borderBottomWidth: 0,
|
|
73
|
+
borderLeftColor: 'transparent',
|
|
74
|
+
borderRightColor: 'transparent',
|
|
75
|
+
borderTopWidth: 8,
|
|
76
|
+
},
|
|
77
|
+
pencilBody: {
|
|
78
|
+
width: '60%',
|
|
79
|
+
height: '75%',
|
|
80
|
+
position: 'absolute',
|
|
81
|
+
bottom: '12.5%',
|
|
82
|
+
left: '20%',
|
|
83
|
+
transform: [{ skewX: '5deg' }],
|
|
84
|
+
},
|
|
85
|
+
pencilTip: {
|
|
86
|
+
width: 0,
|
|
87
|
+
height: 0,
|
|
88
|
+
backgroundColor: 'transparent',
|
|
89
|
+
borderStyle: 'solid',
|
|
90
|
+
borderLeftWidth: 7,
|
|
91
|
+
borderRightWidth: 7,
|
|
92
|
+
borderTopWidth: 0,
|
|
93
|
+
borderLeftColor: 'transparent',
|
|
94
|
+
borderRightColor: 'transparent',
|
|
95
|
+
borderBottomWidth: 10,
|
|
96
|
+
position: 'absolute',
|
|
97
|
+
bottom: '12.5%',
|
|
98
|
+
left: '20%',
|
|
99
|
+
},
|
|
100
|
+
pencilEraser: {
|
|
101
|
+
width: '60%',
|
|
102
|
+
height: '10%',
|
|
103
|
+
position: 'absolute',
|
|
104
|
+
top: '12.5%',
|
|
105
|
+
left: '20%',
|
|
106
|
+
transform: [{ skewX: '5deg' }],
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
export { ChevronIcon, ChevronDown, EditPencilIcon, Triangle };
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
const Triangle = ({ width = 10, height = 20, color = 'black' }) => {
|
|
4
|
+
return (_jsx(View, { style: [
|
|
5
|
+
styles.triangle,
|
|
6
|
+
{
|
|
7
|
+
borderLeftWidth: width / 2,
|
|
8
|
+
borderRightWidth: width / 2,
|
|
9
|
+
borderBottomWidth: height,
|
|
10
|
+
borderBottomColor: color,
|
|
11
|
+
},
|
|
12
|
+
] }));
|
|
13
|
+
};
|
|
14
|
+
const styles = StyleSheet.create({
|
|
15
|
+
triangle: {
|
|
16
|
+
width: 0,
|
|
17
|
+
height: 0,
|
|
18
|
+
transform: [{ rotate: '180deg' }],
|
|
19
|
+
backgroundColor: 'transparent',
|
|
20
|
+
borderStyle: 'solid',
|
|
21
|
+
borderLeftColor: 'transparent',
|
|
22
|
+
borderRightColor: 'transparent',
|
|
23
|
+
},
|
|
24
|
+
});
|
|
25
|
+
export default Triangle;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { View, StyleSheet } from 'react-native';
|
|
3
|
+
const PencilIcon = ({ height = 20, width = 10 }) => {
|
|
4
|
+
return (_jsxs(View, { style: { ...styles.container, height: height, width: width }, children: [_jsx(View, { style: {
|
|
5
|
+
height: '40%',
|
|
6
|
+
width: '100%',
|
|
7
|
+
borderTopStartRadius: 3,
|
|
8
|
+
borderTopEndRadius: 3,
|
|
9
|
+
borderWidth: 0.7,
|
|
10
|
+
}, children: _jsx(View, { style: {
|
|
11
|
+
top: '50%',
|
|
12
|
+
width: '100%',
|
|
13
|
+
borderWidth: 0.7,
|
|
14
|
+
} }) }), _jsx(View, { style: {
|
|
15
|
+
height: '90%',
|
|
16
|
+
width: '100%',
|
|
17
|
+
borderWidth: 0.7,
|
|
18
|
+
}, children: _jsx(View, { style: {
|
|
19
|
+
left: '50%',
|
|
20
|
+
height: '100%',
|
|
21
|
+
width: 0,
|
|
22
|
+
borderWidth: 0.2,
|
|
23
|
+
} }) }), _jsx(View, { style: {
|
|
24
|
+
width: 0,
|
|
25
|
+
height: 0,
|
|
26
|
+
borderLeftWidth: 4,
|
|
27
|
+
borderRightWidth: 4,
|
|
28
|
+
borderBottomWidth: 0,
|
|
29
|
+
borderStyle: 'solid',
|
|
30
|
+
backgroundColor: 'transparent',
|
|
31
|
+
borderLeftColor: 'transparent',
|
|
32
|
+
borderRightColor: 'transparent',
|
|
33
|
+
borderBottomColor: 'transparent',
|
|
34
|
+
borderTopWidth: 8,
|
|
35
|
+
} })] }));
|
|
36
|
+
};
|
|
37
|
+
const styles = StyleSheet.create({
|
|
38
|
+
container: {
|
|
39
|
+
transform: [{ rotate: '45deg' }],
|
|
40
|
+
alignItems: 'center',
|
|
41
|
+
marginHorizontal: 'auto',
|
|
42
|
+
justifyContent: 'center',
|
|
43
|
+
},
|
|
44
|
+
});
|
|
45
|
+
export default PencilIcon;
|