Skip to content

Commit 252a33e

Browse files
committed
Add LinearGradient overlays to TimeRange component for improved visual depth
1 parent ef77638 commit 252a33e

File tree

2 files changed

+38
-13
lines changed

2 files changed

+38
-13
lines changed

src/components/circle-time/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export const CircularDraggableSlider = forwardRef<
219219
}}
220220
style={{
221221
position: 'absolute',
222-
height: radius * 2 + 30,
222+
height: radius * 2 + 40,
223223
width: radius,
224224
top: -(WindowHeight / 2 - radius - 16)
225225
}}

src/components/time-range/index.tsx

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { FontAwesome } from '@expo/vector-icons';
2+
import { LinearGradient } from 'expo-linear-gradient';
23
import { useCallback } from 'react';
34
import { StyleSheet, Text, View } from 'react-native';
45
import Animated, {
@@ -68,18 +69,42 @@ export const TimeRange: React.FC<TimeRangeProps> = ({
6869
<View style={styles.arrowWrapper}>
6970
<FontAwesome name="chevron-up" size={ArrowIconSize} color="#ffffff" />
7071
</View>
71-
<Animated.FlatList
72-
onScroll={onScroll}
73-
decelerationRate="fast"
74-
snapToAlignment="center"
75-
snapToOffsets={DurationSnapOffsets}
76-
contentContainerStyle={styles.scrollViewContent}
77-
showsVerticalScrollIndicator={false}
78-
style={styles.list}
79-
data={DurationLabels}
80-
renderItem={renderItem}
81-
disableIntervalMomentum
82-
/>
72+
<View>
73+
74+
<Animated.FlatList
75+
onScroll={onScroll}
76+
decelerationRate="fast"
77+
snapToAlignment="center"
78+
snapToOffsets={DurationSnapOffsets}
79+
contentContainerStyle={styles.scrollViewContent}
80+
showsVerticalScrollIndicator={false}
81+
style={styles.list}
82+
data={DurationLabels}
83+
renderItem={renderItem}
84+
disableIntervalMomentum
85+
/>
86+
<LinearGradient
87+
colors={['#000000', 'transparent']}
88+
style={{
89+
position: 'absolute',
90+
top: 0,
91+
left: 0,
92+
right: 0,
93+
height: 16,
94+
}}
95+
/>
96+
<LinearGradient
97+
colors={['transparent', '#000000']}
98+
style={{
99+
position: 'absolute',
100+
bottom: 0,
101+
left: 0,
102+
right: 0,
103+
height: 16,
104+
}}
105+
/>
106+
107+
</View>
83108
<View style={styles.arrowWrapper}>
84109
<FontAwesome name="chevron-down" size={ArrowIconSize} color="#ffffff" />
85110
</View>

0 commit comments

Comments
 (0)