From 4ea240f7dc4e1d2f97e94e1ff4a3e9e8c61a4745 Mon Sep 17 00:00:00 2001 From: Brandon Fitzwater Date: Tue, 16 Jul 2024 08:10:03 -0400 Subject: [PATCH] refactor: fixed layout for tablet views --- example/src/App.tsx | 560 ++++++++++++++++++++++---------------------- 1 file changed, 282 insertions(+), 278 deletions(-) diff --git a/example/src/App.tsx b/example/src/App.tsx index 9e41d1d6..d44fa454 100644 --- a/example/src/App.tsx +++ b/example/src/App.tsx @@ -202,326 +202,331 @@ function App({ - - - - - - Linking.openURL( - 'https://github.com/web-ridge/react-native-paper-dates' - ) - } - style={{ color: theme.colors.primary }} - variant="titleLarge" - > - react-native-paper-dates - - - Authors:{' '} + + + + + - Linking.openURL('https://twitter.com/RichardLindhout') + Linking.openURL( + 'https://github.com/web-ridge/react-native-paper-dates' + ) } - style={{ color: theme.colors.secondary }} - variant="bodySmall" + style={{ color: theme.colors.primary }} + variant="titleLarge" > - Richard Lindhout + react-native-paper-dates - ,{' '} Linking.openURL('https://github.com/iM-GeeKy')} - style={{ color: theme.colors.secondary }} variant="bodySmall" > - Brandon Fitzwater + Authors:{' '} + + Linking.openURL('https://twitter.com/RichardLindhout') + } + style={{ color: theme.colors.secondary }} + variant="bodySmall" + > + Richard Lindhout + + ,{' '} + + Linking.openURL('https://github.com/iM-GeeKy') + } + style={{ color: theme.colors.secondary }} + variant="bodySmall" + > + Brandon Fitzwater + - + - - - Smooth and fast cross platform Material Design date picker for React - Native Paper. - - - - - - - - - Material theme - - - setMaterialYouEnabled(true)} - style={styles.chip} - > - Material You - - setMaterialYouEnabled(false)} - style={styles.chip} + - Material Design 2 - - + Smooth and fast cross platform Material Design date picker for + React Native Paper. + - - - Presentation Style (iOS only) - - - {presentationStyles.map((option) => { - return ( - - setPresentationStyle( - option as (typeof presentationStyles)[number] - ) - } - style={styles.chip} - > - {option} - - ) - })} - - - - Locale - - - {locales.map(([option]) => { - return ( - setLocale(option)} - style={styles.chip} - > - {option} - - ) - })} - - - - - - - Time Picker - - - {time && - time.hours !== undefined && - time.minutes !== undefined - ? timeFormatter.format(timeDate) - : 'No time selected.'} - - + + - Date Picker + Material theme + + setMaterialYouEnabled(true)} + style={styles.chip} + > + Material You + + setMaterialYouEnabled(false)} + style={styles.chip} + > + Material Design 2 + + + + - Input + Presentation Style (iOS only) - - - - - Single Date - - + {presentationStyles.map((option) => { + return ( + + setPresentationStyle( + option as (typeof presentationStyles)[number] + ) + } + style={styles.chip} + > + {option} + + ) + })} + + + + Locale + + + {locales.map(([option]) => { + return ( + setLocale(option)} + style={styles.chip} + > + {option} + + ) + })} + + + + + + + Time Picker + + + {time && + time.hours !== undefined && + time.minutes !== undefined + ? timeFormatter.format(timeDate) + : 'No time selected.'} + + + - - - - - - Multiple Dates - - + + Input + + + + + + + + Single Date + + + {date ? dateFormatter.format(date) : 'No date selected.'} + + + + + + + + Multiple Dates + + + {dates + ?.map((d) => dateFormatter.format(d)) + .filter(Boolean) + .join(', ') || 'No dates selected.'} + + + - - - - - - Date Range + + + + Date Range + + + {!range.startDate && !range.endDate + ? 'No dates selected.' + : [ + range.startDate + ? dateFormatter.format(range.startDate) + : '', + range.endDate + ? dateFormatter.format(range.endDate) + : '', + ].join(' - ')} + + + + + + + + + + Other great libraries - {!range.startDate && !range.endDate - ? 'No dates selected.' - : [ - range.startDate - ? dateFormatter.format(range.startDate) - : '', - range.endDate - ? dateFormatter.format(range.endDate) - : '', - ].join(' - ')} + We have made performant, type-safe libraries to help you build + great apps, they also always work great on the web too! - - - - - - - - Other great libraries - - - We have made performant, type-safe libraries to help you build - great apps, they also always work great on the web too! - - - - - - - + + + + + +