Skip to content

Commit ddcfed7

Browse files
Try with README with logo
1 parent 84539c1 commit ddcfed7

File tree

3 files changed

+82
-11
lines changed

3 files changed

+82
-11
lines changed

README.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
## react-native-paper-dates
1+
2+
<img align="left" width="56" height="56" src="https://user-images.githubusercontent.com/6492229/98982291-70b42480-251f-11eb-8d67-4b0b1b6e917b.png"> react-native-paper-dates
3+
---
24

35
- Smooth and fast cross platform Material Design **date** picker and **time** picker for React Native Paper
46
- Tested on Android, iOS and the web platform!

example/src/App.tsx

Lines changed: 79 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
import * as React from 'react';
2-
import { Platform, StyleSheet, ScrollView, View } from 'react-native';
2+
import {
3+
Platform,
4+
StyleSheet,
5+
ScrollView,
6+
View,
7+
Linking,
8+
Image,
9+
} from 'react-native';
310
import {
411
Title,
512
Button,
@@ -10,6 +17,7 @@ import {
1017
DarkTheme,
1118
useTheme,
1219
overlay,
20+
Paragraph,
1321
} from 'react-native-paper';
1422
import { DatePickerModal, TimePickerModal } from '../../src';
1523

@@ -95,9 +103,27 @@ function App({
95103
},
96104
]}
97105
>
106+
<View style={styles.content}>
107+
<View style={styles.titleContainer}>
108+
<Image source={require('./schedule.png')} style={styles.logo} />
109+
<Title>react-native-paper-dates</Title>
110+
</View>
111+
112+
<Paragraph>
113+
Smooth and fast cross platform Material Design date picker for React
114+
Native Paper brought to you by{' '}
115+
<Text
116+
onPress={() => Linking.openURL('https://webridge.nl')}
117+
style={styles.underline}
118+
>
119+
webRidge
120+
</Text>
121+
</Paragraph>
122+
</View>
98123
<View
99124
style={[
100125
styles.content,
126+
styles.contentShadow,
101127
{
102128
backgroundColor:
103129
theme.dark && theme.mode === 'adaptive'
@@ -106,9 +132,10 @@ function App({
106132
},
107133
]}
108134
>
109-
<Title>Examples</Title>
110135
<View style={styles.switchContainer}>
111-
<Text style={styles.switchLabel}>Dark mode</Text>
136+
<Text style={[styles.switchLabel, { ...theme.fonts.medium }]}>
137+
Dark mode
138+
</Text>
112139
<View style={styles.switchSpace} />
113140
<Switch value={dark} onValueChange={onToggleDarkMode} />
114141
</View>
@@ -167,10 +194,28 @@ function App({
167194
</Button>
168195
</View>
169196
<Enter />
197+
170198
{/*<DatePickerInput />*/}
171199
{/*<Enter />*/}
172200
{/*<DateRangeInput />*/}
173201
</View>
202+
<View style={styles.content}>
203+
<Button
204+
uppercase={false}
205+
mode="contained"
206+
icon="github"
207+
style={styles.twitterButton}
208+
onPress={() =>
209+
Linking.openURL(
210+
'https://github.com/web-ridge/react-native-paper-dates'
211+
)
212+
}
213+
>
214+
GitHub
215+
</Button>
216+
<TwitterFollowButton userName={'RichardLindhout'} />
217+
<TwitterFollowButton userName={'web_ridge'} />
218+
</View>
174219
</ScrollView>
175220
<DatePickerModal
176221
mode="range"
@@ -183,7 +228,7 @@ function App({
183228
label="Select period" // optional
184229
startLabel="From" // optional
185230
endLabel="To" // optional
186-
animationType="slide" // optional, default is slide on ios/android and none on web
231+
// animationType="slide" // optional, default is slide on ios/android and none on web
187232
/>
188233
<DatePickerModal
189234
mode="single"
@@ -193,7 +238,7 @@ function App({
193238
onConfirm={onChangeSingle}
194239
saveLabel="Save" // optional
195240
label="Select date" // optional
196-
animationType="slide" // optional, default is 'slide' on ios/android and 'none' on web
241+
// animationType="slide" // optional, default is 'slide' on ios/android and 'none' on web
197242
/>
198243

199244
<TimePickerModal
@@ -205,7 +250,7 @@ function App({
205250
label="Select time" // optional, default 'Select time'
206251
cancelLabel="Cancel" // optional, default: 'Cancel'
207252
confirmLabel="Ok" // optional, default: 'Ok'
208-
animationType="fade" // optional, default is 'none'
253+
// animationType="fade" // optional, default is 'none'
209254
/>
210255
</>
211256
);
@@ -255,12 +300,39 @@ export default function AppWithProviders() {
255300
);
256301
}
257302

303+
function TwitterFollowButton({ userName }: { userName: string }) {
304+
return (
305+
<Button
306+
uppercase={false}
307+
mode="outlined"
308+
icon="twitter"
309+
style={styles.twitterButton}
310+
onPress={() => Linking.openURL(`https://twitter.com/${userName}`)}
311+
>
312+
@{userName}
313+
</Button>
314+
);
315+
}
316+
258317
const styles = StyleSheet.create({
318+
underline: { textDecorationLine: 'underline' },
319+
logo: { width: 56, height: 56, marginRight: 24 },
320+
titleContainer: {
321+
flexDirection: 'row',
322+
alignItems: 'center',
323+
marginBottom: 12,
324+
},
325+
twitterButton: { marginBottom: 16 },
259326
root: { flex: 1 },
260327
content: {
261328
width: '100%',
262329
maxWidth: 450,
263-
marginTop: 56,
330+
marginTop: 24,
331+
padding: 24,
332+
alignSelf: 'center',
333+
flex: 1,
334+
},
335+
contentShadow: {
264336
shadowColor: '#000',
265337
shadowOffset: {
266338
width: 0,
@@ -269,9 +341,6 @@ const styles = StyleSheet.create({
269341
shadowOpacity: 0.15,
270342
shadowRadius: 3.84,
271343
elevation: 3,
272-
padding: 24,
273-
alignSelf: 'center',
274-
flex: 1,
275344
},
276345
switchContainer: {
277346
flexDirection: 'row',

example/src/schedule.png

42.3 KB
Loading

0 commit comments

Comments
 (0)