Change post prompt to a set of buttons (#55)

This commit is contained in:
Paul Frazee 2023-01-19 14:08:53 -06:00 committed by GitHub
parent f10a8308d9
commit 3f95f98ef9
3 changed files with 59 additions and 4 deletions

View file

@ -0,0 +1,48 @@
import React from 'react'
import {StyleSheet, TouchableOpacity, View} from 'react-native'
import {Text} from '../util/text/Text'
import {usePalette} from '../../lib/hooks/usePalette'
export function PromptButtons({
onPressCompose,
}: {
onPressCompose: (imagesOpen?: boolean) => void
}) {
const pal = usePalette('default')
return (
<View style={[pal.view, pal.border, styles.container]}>
<TouchableOpacity
testID="composePromptButton"
style={[styles.btn, {backgroundColor: pal.colors.backgroundLight}]}
onPress={() => onPressCompose(false)}>
<Text type="button" style={pal.textLight}>
New post
</Text>
</TouchableOpacity>
<TouchableOpacity
style={[styles.btn, {backgroundColor: pal.colors.backgroundLight}]}
onPress={() => onPressCompose(true)}>
<Text type="button" style={pal.textLight}>
Share photo
</Text>
</TouchableOpacity>
</View>
)
}
const styles = StyleSheet.create({
container: {
paddingVertical: 12,
paddingBottom: 10,
paddingHorizontal: 16,
flexDirection: 'row',
alignItems: 'center',
borderTopWidth: 1,
},
btn: {
paddingVertical: 6,
paddingHorizontal: 14,
borderRadius: 30,
marginRight: 10,
},
})