moving placeholder condition

This commit is contained in:
João Ferreiro
2022-11-29 18:32:07 +00:00
parent 91a06f2390
commit d0c9f95c7e
+7 -7
View File
@@ -128,10 +128,16 @@ export const ComposePost = observer(function ComposePost({
const canPost = text.length <= MAX_TEXT_LENGTH
const progressColor = text.length > DANGER_TEXT_LENGTH ? '#e60000' : undefined
const selectTextInputLayout =
selectedPhotos.length !== 0
? styles.textInputLayoutWithPhoto
: styles.textInputLayoutWithoutPhoto
const selectTextInputPlaceholder = replyTo
? 'Write your reply'
: selectedPhotos.length !== 0
? 'Write a comment'
: "What's up?"
const textDecorated = useMemo(() => {
let i = 0
@@ -220,13 +226,7 @@ export const ComposePost = observer(function ComposePost({
multiline
scrollEnabled
onChangeText={(text: string) => onChangeText(text)}
placeholder={
replyTo
? 'Write your reply'
: selectedPhotos.length !== 0
? 'Write a comment'
: "What's up?"
}
placeholder={selectTextInputPlaceholder}
style={styles.textInput}>
{textDecorated}
</TextInput>