diff options
author | Paul Frazee <pfrazee@gmail.com> | 2022-11-21 18:55:08 -0600 |
---|---|---|
committer | Paul Frazee <pfrazee@gmail.com> | 2022-11-21 18:55:08 -0600 |
commit | e858bb52de180645bba4f5ffa2f8bc0cfe8ad1fe (patch) | |
tree | 120b5be2ed657b7f8d30d56016d1a0857bb98086 /src/view/com/composer/Prompt.tsx | |
parent | b2dba9a15b0b27c9221808ff037090c2b4c2d500 (diff) | |
parent | 7e487fd5ae053ebb4373b85f1b3d7aa66f8a0241 (diff) | |
download | voidsky-e858bb52de180645bba4f5ffa2f8bc0cfe8ad1fe.tar.zst |
Merge branch 'simplify' into main
Diffstat (limited to 'src/view/com/composer/Prompt.tsx')
-rw-r--r-- | src/view/com/composer/Prompt.tsx | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/src/view/com/composer/Prompt.tsx b/src/view/com/composer/Prompt.tsx new file mode 100644 index 000000000..4a84c7160 --- /dev/null +++ b/src/view/com/composer/Prompt.tsx @@ -0,0 +1,63 @@ +import React from 'react' +import {StyleSheet, Text, TouchableOpacity, View} from 'react-native' +import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' +import {colors} from '../../lib/styles' +import {useStores} from '../../../state' +import {UserAvatar} from '../util/UserAvatar' + +export function ComposePrompt({onPressCompose}: {onPressCompose: () => void}) { + const store = useStores() + const onPressAvatar = () => { + store.nav.navigate(`/profile/${store.me.handle}`) + } + return ( + <TouchableOpacity style={styles.container} onPress={onPressCompose}> + <TouchableOpacity style={styles.avatar} onPress={onPressAvatar}> + <UserAvatar + size={50} + handle={store.me.handle || ''} + displayName={store.me.displayName} + /> + </TouchableOpacity> + <View style={styles.textContainer}> + <Text style={styles.text}>What's happening?</Text> + </View> + <View style={styles.btn}> + <Text style={styles.btnText}>Post</Text> + </View> + </TouchableOpacity> + ) +} + +const styles = StyleSheet.create({ + container: { + borderRadius: 6, + margin: 2, + marginBottom: 0, + paddingHorizontal: 10, + paddingVertical: 10, + flexDirection: 'row', + alignItems: 'center', + backgroundColor: colors.white, + }, + avatar: { + width: 50, + }, + textContainer: { + marginLeft: 10, + flex: 1, + }, + text: { + color: colors.gray4, + fontSize: 17, + }, + btn: { + backgroundColor: colors.gray1, + paddingVertical: 6, + paddingHorizontal: 14, + borderRadius: 30, + }, + btnText: { + color: colors.gray5, + }, +}) |