Remove the avi from the compose prompt

zio/stable
Paul Frazee 2023-01-16 17:37:18 -06:00
parent dac9bc24d1
commit 11c861d2d3
3 changed files with 12 additions and 26 deletions

View File

@ -1,46 +1,29 @@
import React from 'react'
import {StyleSheet, TouchableOpacity, View} from 'react-native'
import {colors} from '../../lib/styles'
import {useStores} from '../../../state'
import {UserAvatar} from '../util/UserAvatar'
import {Text} from '../util/text/Text'
import {usePalette} from '../../lib/hooks/usePalette'
export function ComposePrompt({
noAvi = false,
text = "What's up?",
btn = 'Post',
isReply = false,
onPressCompose,
}: {
noAvi?: boolean
text?: string
btn?: string
isReply?: boolean
onPressCompose: () => void
}) {
const pal = usePalette('default')
const store = useStores()
const onPressAvatar = () => {
store.nav.navigate(`/profile/${store.me.handle}`)
}
return (
<TouchableOpacity
style={[
pal.view,
pal.border,
styles.container,
noAvi ? styles.noAviContainer : undefined,
isReply ? styles.containerReply : undefined,
]}
onPress={onPressCompose}>
{!noAvi ? (
<TouchableOpacity style={styles.avatar} onPress={onPressAvatar}>
<UserAvatar
size={50}
handle={store.me.handle || ''}
displayName={store.me.displayName}
avatar={store.me.avatar}
/>
</TouchableOpacity>
) : undefined}
<View style={styles.textContainer}>
<Text type="h5" style={[pal.textLight, {fontWeight: 'normal'}]}>
{text}
@ -57,14 +40,15 @@ export function ComposePrompt({
const styles = StyleSheet.create({
container: {
paddingHorizontal: 10,
paddingVertical: 10,
paddingLeft: 4,
paddingRight: 10,
paddingVertical: 14,
flexDirection: 'row',
alignItems: 'center',
borderTopWidth: 1,
},
noAviContainer: {
paddingVertical: 14,
containerReply: {
paddingHorizontal: 10,
},
avatar: {
width: 50,

View File

@ -237,7 +237,7 @@ export const PostThreadItem = observer(function PostThreadItem({
</View>
</View>
<ComposePrompt
noAvi
isReply
text="Write your reply"
btn="Reply"
onPressCompose={onPressReply}

View File

@ -39,7 +39,9 @@ export const Feed = observer(function Feed({
// like PureComponent, shouldComponentUpdate, etc
const renderItem = ({item}: {item: any}) => {
if (item === COMPOSE_PROMPT_ITEM) {
return <ComposePrompt onPressCompose={onPressCompose} />
return (
<ComposePrompt onPressCompose={onPressCompose} text="New message" />
)
} else if (item === EMPTY_FEED_ITEM) {
return (
<EmptyState