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