moving placeholder condition
parent
6ba5d15cb6
commit
90942ae146
|
@ -128,10 +128,16 @@ export const ComposePost = observer(function ComposePost({
|
||||||
|
|
||||||
const canPost = text.length <= MAX_TEXT_LENGTH
|
const canPost = text.length <= MAX_TEXT_LENGTH
|
||||||
const progressColor = text.length > DANGER_TEXT_LENGTH ? '#e60000' : undefined
|
const progressColor = text.length > DANGER_TEXT_LENGTH ? '#e60000' : undefined
|
||||||
|
|
||||||
const selectTextInputLayout =
|
const selectTextInputLayout =
|
||||||
selectedPhotos.length !== 0
|
selectedPhotos.length !== 0
|
||||||
? styles.textInputLayoutWithPhoto
|
? styles.textInputLayoutWithPhoto
|
||||||
: styles.textInputLayoutWithoutPhoto
|
: styles.textInputLayoutWithoutPhoto
|
||||||
|
const selectTextInputPlaceholder = replyTo
|
||||||
|
? 'Write your reply'
|
||||||
|
: selectedPhotos.length !== 0
|
||||||
|
? 'Write a comment'
|
||||||
|
: "What's up?"
|
||||||
|
|
||||||
const textDecorated = useMemo(() => {
|
const textDecorated = useMemo(() => {
|
||||||
let i = 0
|
let i = 0
|
||||||
|
@ -220,13 +226,7 @@ export const ComposePost = observer(function ComposePost({
|
||||||
multiline
|
multiline
|
||||||
scrollEnabled
|
scrollEnabled
|
||||||
onChangeText={(text: string) => onChangeText(text)}
|
onChangeText={(text: string) => onChangeText(text)}
|
||||||
placeholder={
|
placeholder={selectTextInputPlaceholder}
|
||||||
replyTo
|
|
||||||
? 'Write your reply'
|
|
||||||
: selectedPhotos.length !== 0
|
|
||||||
? 'Write a comment'
|
|
||||||
: "What's up?"
|
|
||||||
}
|
|
||||||
style={styles.textInput}>
|
style={styles.textInput}>
|
||||||
{textDecorated}
|
{textDecorated}
|
||||||
</TextInput>
|
</TextInput>
|
||||||
|
|
Loading…
Reference in New Issue