Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions frontend/components/Carousel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,22 +20,26 @@ export default function MyCarousel({ components, width, height }: CarouselProps)
const carouselHeight = (height / 100) * screenHeight;

return (
<View style={[styles.carouselContainer, { width: carouselWidth, height: carouselHeight }]}>
<View style={[styles.carouselContainer, { width: carouselWidth, height: carouselHeight }]}>
<ScrollView
horizontal
pagingEnabled
nestedScrollEnabled
directionalLockEnabled
decelerationRate="fast"
showsHorizontalScrollIndicator={false}
nestedScrollEnabled={true}
onMomentumScrollEnd={(event) => {
const newIndex = Math.round(
event.nativeEvent.contentOffset.x / carouselWidth
);
setCurrentIndex(newIndex);
}}
scrollEventThrottle={16}
contentContainerStyle={{ height: carouselHeight }}
style={{ width: carouselWidth, height: carouselHeight }}
>
{components.map((component, index) => (
<View key={index} style={[styles.carouselItem, { width: carouselWidth }]}>
<View key={index} style={[styles.carouselItem, { width: carouselWidth }]}>
{component}
</View>
))}
Expand Down Expand Up @@ -68,6 +72,7 @@ const styles = StyleSheet.create({
carouselItem: {
justifyContent: "center",
alignItems: "center",
height: "100%",
},
pagination: {
flexDirection: "row",
Expand Down
2 changes: 1 addition & 1 deletion frontend/components/TabToggle.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ const styles = StyleSheet.create({
borderBottomColor: 'transparent',
},
tabText: {
fontSize: width * 0.04,
fontSize: width * 0.036,
fontWeight: '500',
color: '#666',
},
Expand Down
Loading