Skip to content

Commit 220a46c

Browse files
committed
chore: update example
1 parent 6b76463 commit 220a46c

4 files changed

Lines changed: 46 additions & 13 deletions

File tree

example/bare/ios/Podfile.lock

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2649,7 +2649,7 @@ PODS:
26492649
- ReactCommon/turbomodule/core
26502650
- SocketRocket
26512651
- Yoga
2652-
- RNTrueSheet (3.10.0-beta.1):
2652+
- RNTrueSheet (3.10.0-beta.3):
26532653
- boost
26542654
- DoubleConversion
26552655
- fast_float
@@ -3104,7 +3104,7 @@ SPEC CHECKSUMS:
31043104
RNGestureHandler: e1cf8ef3f11045536eed6bd4f132b003ef5f9a5f
31053105
RNReanimated: f1868b36f4b2b52a0ed00062cfda69506f75eaee
31063106
RNScreens: d821082c6dd1cb397cc0c98b026eeafaa68be479
3107-
RNTrueSheet: cda20577e6b3553643620281ee9143f0ae6c8371
3107+
RNTrueSheet: ee7a6a91d4de8b2c39715e7cc70bb36d57ecbee0
31083108
RNWorklets: d9c050940f140af5d8b611d937eab1cbfce5e9a5
31093109
SocketRocket: d4aabe649be1e368d1318fdf28a022d714d65748
31103110
Yoga: 689c8e04277f3ad631e60fe2a08e41d411daf8eb

example/shared/src/components/Footer.tsx

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,36 @@
1-
import { Platform, StyleSheet, Text, View, type PressableProps, Pressable } from 'react-native';
1+
import {
2+
Platform,
3+
StyleSheet,
4+
Text,
5+
View,
6+
type PressableProps,
7+
Pressable,
8+
type ViewStyle,
9+
type StyleProp,
10+
} from 'react-native';
211
import { useSafeAreaInsets } from 'react-native-safe-area-context';
312

413
import { DARK_GRAY, FOOTER_HEIGHT, SPACING } from '../utils';
514

615
const isIPad = Platform.OS === 'ios' && Platform.isPad;
716

817
interface FooterProps extends PressableProps {
18+
wrapperStyle?: StyleProp<ViewStyle>;
919
text?: string;
1020
}
1121

12-
export const Footer = ({ children, text = 'FOOTER', onPress, ...rest }: FooterProps) => {
22+
export const Footer = ({
23+
children,
24+
text = 'FOOTER',
25+
onPress,
26+
wrapperStyle,
27+
...rest
28+
}: FooterProps) => {
1329
const insets = useSafeAreaInsets();
1430
const bottomInset = isIPad ? 0 : insets.bottom;
1531

1632
return (
17-
<View style={[styles.wrapper, { paddingBottom: bottomInset }]}>
33+
<View style={[styles.wrapper, { paddingBottom: bottomInset }, wrapperStyle]}>
1834
<Pressable
1935
style={({ pressed }) => [styles.container, onPress && pressed && styles.pressed]}
2036
onPress={onPress}
@@ -28,10 +44,7 @@ export const Footer = ({ children, text = 'FOOTER', onPress, ...rest }: FooterPr
2844

2945
const styles = StyleSheet.create({
3046
wrapper: {
31-
backgroundColor: Platform.select({
32-
default: DARK_GRAY,
33-
ios: undefined,
34-
}),
47+
backgroundColor: DARK_GRAY,
3548
},
3649
container: {
3750
height: FOOTER_HEIGHT,

example/shared/src/components/sheets/FlatListSheet.tsx

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { forwardRef, useRef } from 'react';
2-
import { StyleSheet, FlatList, View } from 'react-native';
2+
import { StyleSheet, FlatList, View, Platform } from 'react-native';
33
import { TrueSheet, type TrueSheetProps } from '@lodev09/react-native-true-sheet';
44

55
import { DARK, DARK_GRAY, FOOTER_HEIGHT, HEADER_HEIGHT, SPACING, times } from '../../utils';
@@ -25,10 +25,17 @@ export const FlatListSheet = forwardRef<TrueSheet, FlatListSheetProps>((props, r
2525
bottomScrollEdgeEffect: 'soft',
2626
topScrollEdgeEffect: 'soft',
2727
}}
28-
header={<Header style={styles.header} />}
28+
header={<Header />}
29+
headerStyle={styles.header}
2930
onDidDismiss={() => console.log('Sheet FlatList dismissed!')}
3031
onDidPresent={() => console.log(`Sheet FlatList presented!`)}
31-
footer={<Footer text="OPEN BLANK SHEET" onPress={() => testRef.current?.present()} />}
32+
footer={
33+
<Footer
34+
text="OPEN BLANK SHEET"
35+
wrapperStyle={styles.footer}
36+
onPress={() => testRef.current?.present()}
37+
/>
38+
}
3239
{...props}
3340
>
3441
<View style={styles.wrapper}>
@@ -55,6 +62,12 @@ const styles = StyleSheet.create({
5562
wrapper: {
5663
flex: 1,
5764
},
65+
footer: {
66+
backgroundColor: Platform.select({
67+
default: DARK_GRAY,
68+
ios: undefined,
69+
}),
70+
},
5871
header: {
5972
position: 'absolute',
6073
left: 0,

example/shared/src/components/sheets/ScrollViewSheet.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import { TrueSheet, type TrueSheetProps } from '@lodev09/react-native-true-sheet
1414
import {
1515
BORDER_RADIUS,
1616
DARK,
17+
DARK_GRAY,
1718
FOOTER_HEIGHT,
1819
GAP,
1920
HEADER_HEIGHT,
@@ -74,7 +75,7 @@ export const ScrollViewSheet = forwardRef<TrueSheet, ScrollViewSheetProps>((prop
7475
header={<Header />}
7576
headerStyle={styles.header}
7677
footer={
77-
<Footer>
78+
<Footer wrapperStyle={styles.footer}>
7879
<Button text="Toggle ListView" onPress={() => setShowList(!showList)} />
7980
</Footer>
8081
}
@@ -118,6 +119,12 @@ const styles = StyleSheet.create({
118119
right: 0,
119120
zIndex: 1,
120121
},
122+
footer: {
123+
backgroundColor: Platform.select({
124+
default: DARK_GRAY,
125+
ios: undefined,
126+
}),
127+
},
121128
item: {
122129
backgroundColor: 'rgba(0, 0, 0, 0.3)',
123130
borderRadius: BORDER_RADIUS,

0 commit comments

Comments
 (0)