A set of composer fixes (#1187)
* Don't insert a newline on cmd+entrl (close #1173) * Don't linkify selected text on url-paste (close #1149) * Disable the adult content controls if there is no media on the post (close #1169)
This commit is contained in:
parent
819340dd3c
commit
5e63d3164b
5 changed files with 66 additions and 42 deletions
|
@ -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,
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue