Reposition to handle scene creation keyboard view
parent
51c9a51f8c
commit
482ddc9c0d
|
@ -9,13 +9,14 @@ import {
|
|||
View,
|
||||
} from 'react-native'
|
||||
import LinearGradient from 'react-native-linear-gradient'
|
||||
import {BottomSheetScrollView, BottomSheetTextInput} from '@gorhom/bottom-sheet'
|
||||
import {ErrorMessage} from '../util/ErrorMessage'
|
||||
import {useStores} from '../../../state'
|
||||
import {s, colors, gradients} from '../../lib/styles'
|
||||
import {makeValidHandle, createFullHandle} from '../../lib/strings'
|
||||
import {AppBskyActorCreateScene} from '../../../third-party/api/index'
|
||||
|
||||
export const snapPoints = ['70%']
|
||||
export const snapPoints = ['60%']
|
||||
|
||||
export function Component({}: {}) {
|
||||
const store = useStores()
|
||||
|
@ -88,16 +89,17 @@ export function Component({}: {}) {
|
|||
}
|
||||
|
||||
return (
|
||||
<View style={s.flex1}>
|
||||
<View style={styles.outer}>
|
||||
<Text style={styles.title}>Create a scene</Text>
|
||||
<Text style={styles.description}>
|
||||
Scenes are invite-only groups which aggregate what's popular with
|
||||
members.
|
||||
</Text>
|
||||
<View style={styles.inner}>
|
||||
<BottomSheetScrollView style={styles.inner}>
|
||||
<View style={{paddingBottom: 50}}>
|
||||
<View style={styles.group}>
|
||||
<Text style={styles.label}>Scene Handle</Text>
|
||||
<TextInput
|
||||
<BottomSheetTextInput
|
||||
style={styles.textInput}
|
||||
placeholder="e.g. alices-friends"
|
||||
value={handle}
|
||||
|
@ -106,7 +108,7 @@ export function Component({}: {}) {
|
|||
</View>
|
||||
<View style={styles.group}>
|
||||
<Text style={styles.label}>Scene Display Name</Text>
|
||||
<TextInput
|
||||
<BottomSheetTextInput
|
||||
style={styles.textInput}
|
||||
placeholder="e.g. Alice's Friends"
|
||||
value={displayName}
|
||||
|
@ -115,7 +117,7 @@ export function Component({}: {}) {
|
|||
</View>
|
||||
<View style={styles.group}>
|
||||
<Text style={styles.label}>Scene Description</Text>
|
||||
<TextInput
|
||||
<BottomSheetTextInput
|
||||
style={[styles.textArea]}
|
||||
placeholder="e.g. Artists, dog-lovers, and memelords."
|
||||
multiline
|
||||
|
@ -123,13 +125,13 @@ export function Component({}: {}) {
|
|||
onChangeText={setDescription}
|
||||
/>
|
||||
</View>
|
||||
<View style={styles.errorContainer}>
|
||||
{error !== '' && (
|
||||
<View style={styles.errorContainer}>
|
||||
<View style={s.mb10}>
|
||||
<ErrorMessage message={error} numberOfLines={3} />
|
||||
</View>
|
||||
)}
|
||||
</View>
|
||||
)}
|
||||
{handle.length >= 2 && !isProcessing ? (
|
||||
<TouchableOpacity style={s.mt10} onPress={onPressSave}>
|
||||
<LinearGradient
|
||||
|
@ -152,11 +154,17 @@ export function Component({}: {}) {
|
|||
</View>
|
||||
)}
|
||||
</View>
|
||||
</BottomSheetScrollView>
|
||||
</View>
|
||||
)
|
||||
}
|
||||
|
||||
const styles = StyleSheet.create({
|
||||
outer: {
|
||||
flex: 1,
|
||||
paddingTop: 20,
|
||||
paddingBottom: 20,
|
||||
},
|
||||
title: {
|
||||
textAlign: 'center',
|
||||
fontWeight: 'bold',
|
||||
|
@ -172,6 +180,7 @@ const styles = StyleSheet.create({
|
|||
},
|
||||
inner: {
|
||||
padding: 14,
|
||||
height: 350,
|
||||
},
|
||||
group: {
|
||||
marginBottom: 10,
|
||||
|
@ -197,7 +206,7 @@ const styles = StyleSheet.create({
|
|||
paddingHorizontal: 12,
|
||||
paddingTop: 10,
|
||||
fontSize: 16,
|
||||
height: 100,
|
||||
height: 70,
|
||||
textAlignVertical: 'top',
|
||||
},
|
||||
errorContainer: {
|
||||
|
|
Loading…
Reference in New Issue