about summary refs log tree commit diff
path: root/src/view/com/composer
diff options
context:
space:
mode:
Diffstat (limited to 'src/view/com/composer')
-rw-r--r--src/view/com/composer/Composer.tsx3
-rw-r--r--src/view/com/composer/labels/LabelsBtn.tsx9
-rw-r--r--src/view/com/composer/text-input/TextInput.web.tsx2
3 files changed, 11 insertions, 3 deletions
diff --git a/src/view/com/composer/Composer.tsx b/src/view/com/composer/Composer.tsx
index f9629797a..fe9cc834f 100644
--- a/src/view/com/composer/Composer.tsx
+++ b/src/view/com/composer/Composer.tsx
@@ -218,6 +218,7 @@ export const ComposePost = observer(function ComposePost({
   const selectTextInputPlaceholder = replyTo ? 'Write your reply' : `What's up?`
 
   const canSelectImages = useMemo(() => gallery.size < 4, [gallery.size])
+  const hasMedia = gallery.size > 0 || Boolean(extLink)
 
   return (
     <KeyboardAvoidingView
@@ -236,7 +237,7 @@ export const ComposePost = observer(function ComposePost({
             <Text style={[pal.link, s.f18]}>Cancel</Text>
           </TouchableOpacity>
           <View style={s.flex1} />
-          <LabelsBtn labels={labels} onChange={setLabels} />
+          <LabelsBtn labels={labels} onChange={setLabels} hasMedia={hasMedia} />
           {isProcessing ? (
             <View style={styles.postBtn}>
               <ActivityIndicator />
diff --git a/src/view/com/composer/labels/LabelsBtn.tsx b/src/view/com/composer/labels/LabelsBtn.tsx
index 1abcbe036..96908d47f 100644
--- a/src/view/com/composer/labels/LabelsBtn.tsx
+++ b/src/view/com/composer/labels/LabelsBtn.tsx
@@ -11,9 +11,11 @@ import {isNative} from 'platform/detection'
 
 export const LabelsBtn = observer(function LabelsBtn({
   labels,
+  hasMedia,
   onChange,
 }: {
   labels: string[]
+  hasMedia: boolean
   onChange: (v: string[]) => void
 }) {
   const pal = usePalette('default')
@@ -23,7 +25,7 @@ export const LabelsBtn = observer(function LabelsBtn({
     <Button
       type="default-light"
       testID="labelsBtn"
-      style={styles.button}
+      style={[styles.button, !hasMedia && styles.dimmed]}
       accessibilityLabel="Content warnings"
       accessibilityHint=""
       onPress={() => {
@@ -32,7 +34,7 @@ export const LabelsBtn = observer(function LabelsBtn({
             Keyboard.dismiss()
           }
         }
-        store.shell.openModal({name: 'self-label', labels, onChange})
+        store.shell.openModal({name: 'self-label', labels, hasMedia, onChange})
       }}>
       <ShieldExclamation style={pal.link} size={26} />
       {labels.length > 0 ? (
@@ -53,6 +55,9 @@ const styles = StyleSheet.create({
     paddingHorizontal: 14,
     marginRight: 4,
   },
+  dimmed: {
+    opacity: 0.4,
+  },
   label: {
     maxWidth: 100,
   },
diff --git a/src/view/com/composer/text-input/TextInput.web.tsx b/src/view/com/composer/text-input/TextInput.web.tsx
index da34a5b9a..152bb50ea 100644
--- a/src/view/com/composer/text-input/TextInput.web.tsx
+++ b/src/view/com/composer/text-input/TextInput.web.tsx
@@ -60,6 +60,7 @@ export const TextInput = React.forwardRef(
           Link.configure({
             protocols: ['http', 'https'],
             autolink: true,
+            linkOnPaste: false,
           }),
           Mention.configure({
             HTMLAttributes: {
@@ -96,6 +97,7 @@ export const TextInput = React.forwardRef(
                 onPressPublish(state)
                 return state
               })
+              return true
             }
           },
         },