Hide quote post button if disabled
This commit is contained in:
@@ -255,6 +255,7 @@ let PostCtrls = ({
|
||||
onRepost={onRepost}
|
||||
onQuote={onQuote}
|
||||
big={big}
|
||||
quotepostDisabled={Boolean(post.viewer?.quotepostDisabled)}
|
||||
/>
|
||||
</View>
|
||||
<View style={big ? a.align_center : [a.flex_1, a.align_start]}>
|
||||
|
||||
@@ -20,6 +20,7 @@ interface Props {
|
||||
onRepost: () => void
|
||||
onQuote: () => void
|
||||
big?: boolean
|
||||
quotepostDisabled: boolean
|
||||
}
|
||||
|
||||
let RepostButton = ({
|
||||
@@ -28,6 +29,7 @@ let RepostButton = ({
|
||||
onRepost,
|
||||
onQuote,
|
||||
big,
|
||||
quotepostDisabled,
|
||||
}: Props): React.ReactNode => {
|
||||
const t = useTheme()
|
||||
const {_} = useLingui()
|
||||
@@ -110,6 +112,7 @@ let RepostButton = ({
|
||||
: _(msg({message: `Repost`, context: 'action'}))}
|
||||
</Text>
|
||||
</Button>
|
||||
{quotepostDisabled ? null : (
|
||||
<Button
|
||||
testID="quoteBtn"
|
||||
style={[a.justify_start, a.px_md]}
|
||||
@@ -128,6 +131,7 @@ let RepostButton = ({
|
||||
{_(msg`Quote post`)}
|
||||
</Text>
|
||||
</Button>
|
||||
)}
|
||||
</View>
|
||||
<Button
|
||||
label={_(msg`Cancel quote post`)}
|
||||
|
||||
@@ -20,6 +20,7 @@ interface Props {
|
||||
onRepost: () => void
|
||||
onQuote: () => void
|
||||
big?: boolean
|
||||
quotepostDisabled: boolean
|
||||
}
|
||||
|
||||
export const RepostButton = ({
|
||||
@@ -28,6 +29,7 @@ export const RepostButton = ({
|
||||
onRepost,
|
||||
onQuote,
|
||||
big,
|
||||
quotepostDisabled,
|
||||
}: Props) => {
|
||||
const t = useTheme()
|
||||
const {_} = useLingui()
|
||||
@@ -75,6 +77,7 @@ export const RepostButton = ({
|
||||
</Menu.ItemText>
|
||||
<Menu.ItemIcon icon={Repost} position="right" />
|
||||
</Menu.Item>
|
||||
{quotepostDisabled ? null : (
|
||||
<Menu.Item
|
||||
label={_(msg`Quote post`)}
|
||||
testID="repostDropdownQuoteBtn"
|
||||
@@ -82,6 +85,7 @@ export const RepostButton = ({
|
||||
<Menu.ItemText>{_(msg`Quote post`)}</Menu.ItemText>
|
||||
<Menu.ItemIcon icon={Quote} position="right" />
|
||||
</Menu.Item>
|
||||
)}
|
||||
</Menu.Outer>
|
||||
</Menu.Root>
|
||||
</EventStopper>
|
||||
|
||||
Reference in New Issue
Block a user