tangled
alpha
login
or
join now
bas.sh
/
witchsky.app
forked from
jollywhoppers.com/witchsky.app
0
fork
atom
Bluesky app fork with some witchin' additions 💫
0
fork
atom
overview
issues
pulls
pipelines
Remove the avi from the compose prompt
Paul Frazee
3 years ago
11c861d2
dac9bc24
+12
-26
3 changed files
expand all
collapse all
unified
split
src
view
com
composer
Prompt.tsx
post-thread
PostThreadItem.tsx
posts
Feed.tsx
+8
-24
src/view/com/composer/Prompt.tsx
···
1
1
import React from 'react'
2
2
import {StyleSheet, TouchableOpacity, View} from 'react-native'
3
3
-
import {colors} from '../../lib/styles'
4
4
-
import {useStores} from '../../../state'
5
5
-
import {UserAvatar} from '../util/UserAvatar'
6
3
import {Text} from '../util/text/Text'
7
4
import {usePalette} from '../../lib/hooks/usePalette'
8
5
9
6
export function ComposePrompt({
10
10
-
noAvi = false,
11
7
text = "What's up?",
12
8
btn = 'Post',
9
9
+
isReply = false,
13
10
onPressCompose,
14
11
}: {
15
15
-
noAvi?: boolean
16
12
text?: string
17
13
btn?: string
14
14
+
isReply?: boolean
18
15
onPressCompose: () => void
19
16
}) {
20
17
const pal = usePalette('default')
21
21
-
const store = useStores()
22
22
-
const onPressAvatar = () => {
23
23
-
store.nav.navigate(`/profile/${store.me.handle}`)
24
24
-
}
25
18
return (
26
19
<TouchableOpacity
27
20
style={[
28
21
pal.view,
29
22
pal.border,
30
23
styles.container,
31
31
-
noAvi ? styles.noAviContainer : undefined,
24
24
+
isReply ? styles.containerReply : undefined,
32
25
]}
33
26
onPress={onPressCompose}>
34
34
-
{!noAvi ? (
35
35
-
<TouchableOpacity style={styles.avatar} onPress={onPressAvatar}>
36
36
-
<UserAvatar
37
37
-
size={50}
38
38
-
handle={store.me.handle || ''}
39
39
-
displayName={store.me.displayName}
40
40
-
avatar={store.me.avatar}
41
41
-
/>
42
42
-
</TouchableOpacity>
43
43
-
) : undefined}
44
27
<View style={styles.textContainer}>
45
28
<Text type="h5" style={[pal.textLight, {fontWeight: 'normal'}]}>
46
29
{text}
···
57
40
58
41
const styles = StyleSheet.create({
59
42
container: {
60
60
-
paddingHorizontal: 10,
61
61
-
paddingVertical: 10,
43
43
+
paddingLeft: 4,
44
44
+
paddingRight: 10,
45
45
+
paddingVertical: 14,
62
46
flexDirection: 'row',
63
47
alignItems: 'center',
64
48
borderTopWidth: 1,
65
49
},
66
66
-
noAviContainer: {
67
67
-
paddingVertical: 14,
50
50
+
containerReply: {
51
51
+
paddingHorizontal: 10,
68
52
},
69
53
avatar: {
70
54
width: 50,
+1
-1
src/view/com/post-thread/PostThreadItem.tsx
···
237
237
</View>
238
238
</View>
239
239
<ComposePrompt
240
240
-
noAvi
240
240
+
isReply
241
241
text="Write your reply"
242
242
btn="Reply"
243
243
onPressCompose={onPressReply}
+3
-1
src/view/com/posts/Feed.tsx
···
39
39
// like PureComponent, shouldComponentUpdate, etc
40
40
const renderItem = ({item}: {item: any}) => {
41
41
if (item === COMPOSE_PROMPT_ITEM) {
42
42
-
return <ComposePrompt onPressCompose={onPressCompose} />
42
42
+
return (
43
43
+
<ComposePrompt onPressCompose={onPressCompose} text="New message" />
44
44
+
)
43
45
} else if (item === EMPTY_FEED_ITEM) {
44
46
return (
45
47
<EmptyState