about summary refs log tree commit diff
path: root/src/view/com/composer/Prompt.tsx
blob: 682a9990bccad350ef62a127a196fbe2f3be1da5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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 ComposePrompt({
  text = "What's up?",
  btn = 'Post',
  isReply = false,
  onPressCompose,
}: {
  text?: string
  btn?: string
  isReply?: boolean
  onPressCompose: () => void
}) {
  const pal = usePalette('default')
  return (
    <TouchableOpacity
      style={[
        pal.view,
        pal.border,
        styles.container,
        isReply ? styles.containerReply : undefined,
      ]}
      onPress={onPressCompose}>
      <View style={styles.textContainer}>
        <Text type="h5" style={[pal.textLight, {fontWeight: 'normal'}]}>
          {text}
        </Text>
      </View>
      <View style={[styles.btn, {backgroundColor: pal.colors.backgroundLight}]}>
        <Text type="button" style={pal.textLight}>
          {btn}
        </Text>
      </View>
    </TouchableOpacity>
  )
}

const styles = StyleSheet.create({
  container: {
    paddingLeft: 4,
    paddingRight: 10,
    paddingVertical: 14,
    flexDirection: 'row',
    alignItems: 'center',
    borderTopWidth: 1,
  },
  containerReply: {
    paddingHorizontal: 10,
  },
  avatar: {
    width: 50,
  },
  textContainer: {
    marginLeft: 10,
    flex: 1,
  },
  btn: {
    paddingVertical: 6,
    paddingHorizontal: 14,
    borderRadius: 30,
  },
})