Skip to content

Commit a294fab

Browse files
committed
chore: tweaking examples
1 parent e0df970 commit a294fab

File tree

5 files changed

+13
-16
lines changed

5 files changed

+13
-16
lines changed

example/components/Carousel.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ const Carousel: React.FC<{ index: number }> = React.memo(
1212
<View style={[styles.row, { borderTopWidth: index === 0 ? 0 : 1 }]}>
1313
<Text style={styles.title}>{`Popular in ${Faker.address.city()}`}</Text>
1414
<FlatList
15+
contentContainerStyle={{ paddingHorizontal: 8 }}
1516
showsHorizontalScrollIndicator={false}
16-
pagingEnabled
17-
initialNumToRender={2}
17+
initialNumToRender={5}
1818
data={Array.from({ length: 10 }).map((_, i) => String(i))}
1919
horizontal
2020
keyExtractor={j => `row-${index}-item-${j}`}

example/components/CarouselItem.tsx

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,6 @@ const CarouselItem: React.FC = React.memo(
2626
}
2727
}
2828
/>
29-
<Card.Content>
30-
<Title style={{ marginTop: 8 }}>{Faker.address.streetName()}</Title>
31-
<Paragraph>{Faker.address.streetSuffix()}</Paragraph>
32-
</Card.Content>
3329
</Card>
3430
</View>
3531
);
@@ -41,11 +37,12 @@ export default CarouselItem;
4137

4238
const styles = StyleSheet.create({
4339
item: {
44-
paddingHorizontal: 16,
40+
paddingHorizontal: 4,
4541
paddingVertical: 8,
4642
},
4743
imageStyle: {
48-
width: windowWidth - 32,
44+
width: (windowWidth - 32) / 1.5,
45+
height: 150,
4946
resizeMode: 'cover',
5047
},
5148
});

example/components/Handle.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ const styles = StyleSheet.create({
1717
header: {
1818
alignItems: 'center',
1919
backgroundColor: 'white',
20-
paddingTop: 20,
20+
paddingVertical: 20,
2121
borderTopLeftRadius: 20,
2222
borderTopRightRadius: 20,
2323
shadowColor: '#000',

example/screens/HorizontalFlatListExample.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,15 +28,15 @@ const initialRegion = {
2828
longitude: -0.1255756,
2929
};
3030
const { height: windowHeight } = Dimensions.get('window');
31-
const snapPointsFromTop = [128, '50%', windowHeight - 128];
31+
const snapPointsFromTop = [96, '50%', windowHeight - 128];
3232

3333
const HorizontalFlatListExample: React.FC<Props> = ({ navigation }) => {
3434
const bottomSheetRef = React.useRef<ScrollBottomSheet<any> | null>(null);
3535

3636
const animatedPosition = React.useRef(new Value(0));
3737
const opacity = interpolate(animatedPosition.current, {
3838
inputRange: [0, 1],
39-
outputRange: [0, 0.5],
39+
outputRange: [0, 0.75],
4040
extrapolate: Extrapolate.CLAMP,
4141
});
4242

@@ -84,7 +84,7 @@ const HorizontalFlatListExample: React.FC<Props> = ({ navigation }) => {
8484
<Ionicons
8585
name="ios-arrow-back"
8686
size={32}
87-
color="#3F51B5"
87+
color="white"
8888
style={styles.icon}
8989
/>
9090
</TouchableRipple>
@@ -101,7 +101,7 @@ const HorizontalFlatListExample: React.FC<Props> = ({ navigation }) => {
101101
keyExtractor={i => `row-${i}`}
102102
initialNumToRender={5}
103103
contentContainerStyle={styles.contentContainerStyle}
104-
data={Array.from({ length: 20 }).map((_, i) => String(i))}
104+
data={Array.from({ length: 100 }).map((_, i) => String(i))}
105105
renderItem={renderRow}
106106
/>
107107
</View>

example/screens/SectionListExample.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ const navBarHeight = 56;
2828
const sections = createMockData();
2929

3030
const SectionListExample: React.FC<Props> = () => {
31-
const snapPointsFromTop = [0, '40%', windowHeight - 264];
31+
const snapPointsFromTop = [96, '45%', windowHeight - 264];
3232
const animatedPosition = React.useRef(new Value(0.5));
3333
const handleLeftRotate = concat(
3434
interpolate(animatedPosition.current, {
@@ -48,7 +48,7 @@ const SectionListExample: React.FC<Props> = () => {
4848
);
4949
const cardScale = interpolate(animatedPosition.current, {
5050
inputRange: [0, 0.6, 1],
51-
outputRange: [1, 1, 0.8],
51+
outputRange: [1, 1, 0.9],
5252
extrapolate: Extrapolate.CLAMP,
5353
});
5454

@@ -118,7 +118,7 @@ const SectionListExample: React.FC<Props> = () => {
118118
easing: Easing.inOut(Easing.linear),
119119
}}
120120
renderHandle={() => (
121-
<Handle style={{ paddingVertical: 20 }}>
121+
<Handle style={{ paddingVertical: 20, backgroundColor: '#F3F4F9' }}>
122122
<Animated.View
123123
style={[
124124
styles.handle,

0 commit comments

Comments
 (0)