feat: scrollable styles pochette

This commit is contained in:
2026-02-26 15:37:53 +01:00
parent 98efb55611
commit f58292ce5c
+23 -1
View File
@@ -5,9 +5,11 @@ import {
ActivityIndicator, ActivityIndicator,
Image, Image,
Pressable, Pressable,
ScrollView,
StyleSheet, StyleSheet,
Text, Text,
TextInput, TextInput,
useWindowDimensions,
View, View,
KeyboardAvoidingView, KeyboardAvoidingView,
Platform, Platform,
@@ -86,6 +88,10 @@ const PouchReady = () => {
const [coverProgress, setCoverProgress] = useState(0) const [coverProgress, setCoverProgress] = useState(0)
const coverProgressIntervalRef = useRef(null) const coverProgressIntervalRef = useRef(null)
const coverProgressStartRef = useRef(null) const coverProgressStartRef = useRef(null)
const { height: windowHeight } = useWindowDimensions()
const dropdownMaxHeight = !isWeb
? Math.max(220, Math.min(340, Math.round(windowHeight * 0.45)))
: null
const showGenerationLoading = useCallback(async () => { const showGenerationLoading = useCallback(async () => {
setIsAwaitingGenerationStart(true) setIsAwaitingGenerationStart(true)
@@ -497,7 +503,19 @@ const PouchReady = () => {
/> />
</Pressable> </Pressable>
{isPresetDropdownOpen && ( {isPresetDropdownOpen && (
<View style={styles.dropdownList}> <View
style={[
styles.dropdownList,
!isWeb && dropdownMaxHeight ? { maxHeight: dropdownMaxHeight } : null,
]}
>
<ScrollView
bounces={false}
showsVerticalScrollIndicator={false}
nestedScrollEnabled
keyboardShouldPersistTaps="handled"
contentContainerStyle={styles.dropdownListContent}
>
{COVER_STYLE_PRESETS.map((styleOption, index) => { {COVER_STYLE_PRESETS.map((styleOption, index) => {
const isActive = selectedPresetStyle === styleOption const isActive = selectedPresetStyle === styleOption
const isLast = index === COVER_STYLE_PRESETS.length - 1 const isLast = index === COVER_STYLE_PRESETS.length - 1
@@ -532,6 +550,7 @@ const PouchReady = () => {
</Pressable> </Pressable>
) )
})} })}
</ScrollView>
</View> </View>
)} )}
</View> </View>
@@ -798,6 +817,9 @@ const styles = StyleSheet.create({
backgroundColor: 'rgba(12,10,18,0.95)', backgroundColor: 'rgba(12,10,18,0.95)',
overflow: 'hidden', overflow: 'hidden',
}, },
dropdownListContent: {
paddingVertical: 2,
},
dropdownOption: { dropdownOption: {
flexDirection: 'row', flexDirection: 'row',
alignItems: 'center', alignItems: 'center',