Hide DMs send options in menu
This commit is contained in:
@@ -11,6 +11,7 @@ import {shareText, shareUrl} from '#/lib/sharing'
|
|||||||
import {toShareUrl} from '#/lib/strings/url-helpers'
|
import {toShareUrl} from '#/lib/strings/url-helpers'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {isIOS} from '#/platform/detection'
|
import {isIOS} from '#/platform/detection'
|
||||||
|
import {useAgeAssurance} from '#/state/ageAssurance/useAgeAssurance'
|
||||||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import * as Toast from '#/view/com/util/Toast'
|
import * as Toast from '#/view/com/util/Toast'
|
||||||
@@ -36,6 +37,7 @@ let ShareMenuItems = ({
|
|||||||
const navigation = useNavigation<NavigationProp>()
|
const navigation = useNavigation<NavigationProp>()
|
||||||
const sendViaChatControl = useDialogControl()
|
const sendViaChatControl = useDialogControl()
|
||||||
const [devModeEnabled] = useDevMode()
|
const [devModeEnabled] = useDevMode()
|
||||||
|
const {isAgeRestricted} = useAgeAssurance()
|
||||||
|
|
||||||
const postUri = post.uri
|
const postUri = post.uri
|
||||||
const postAuthor = useProfileShadow(post.author)
|
const postAuthor = useProfileShadow(post.author)
|
||||||
@@ -89,7 +91,7 @@ let ShareMenuItems = ({
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<Menu.Outer>
|
<Menu.Outer>
|
||||||
{hasSession && (
|
{hasSession && !isAgeRestricted && (
|
||||||
<Menu.Group>
|
<Menu.Group>
|
||||||
<Menu.ContainerItem>
|
<Menu.ContainerItem>
|
||||||
<RecentChats postUri={postUri} />
|
<RecentChats postUri={postUri} />
|
||||||
|
|||||||
@@ -11,6 +11,7 @@ import {shareText, shareUrl} from '#/lib/sharing'
|
|||||||
import {toShareUrl} from '#/lib/strings/url-helpers'
|
import {toShareUrl} from '#/lib/strings/url-helpers'
|
||||||
import {logger} from '#/logger'
|
import {logger} from '#/logger'
|
||||||
import {isWeb} from '#/platform/detection'
|
import {isWeb} from '#/platform/detection'
|
||||||
|
import {useAgeAssurance} from '#/state/ageAssurance/useAgeAssurance'
|
||||||
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
import {useProfileShadow} from '#/state/cache/profile-shadow'
|
||||||
import {useSession} from '#/state/session'
|
import {useSession} from '#/state/session'
|
||||||
import {useBreakpoints} from '#/alf'
|
import {useBreakpoints} from '#/alf'
|
||||||
@@ -38,6 +39,7 @@ let ShareMenuItems = ({
|
|||||||
const embedPostControl = useDialogControl()
|
const embedPostControl = useDialogControl()
|
||||||
const sendViaChatControl = useDialogControl()
|
const sendViaChatControl = useDialogControl()
|
||||||
const [devModeEnabled] = useDevMode()
|
const [devModeEnabled] = useDevMode()
|
||||||
|
const {isAgeRestricted} = useAgeAssurance()
|
||||||
|
|
||||||
const postUri = post.uri
|
const postUri = post.uri
|
||||||
const postCid = post.cid
|
const postCid = post.cid
|
||||||
@@ -96,7 +98,7 @@ let ShareMenuItems = ({
|
|||||||
<Menu.Outer>
|
<Menu.Outer>
|
||||||
{!hideInPWI && copyLinkItem}
|
{!hideInPWI && copyLinkItem}
|
||||||
|
|
||||||
{hasSession && (
|
{hasSession && !isAgeRestricted && (
|
||||||
<Menu.Item
|
<Menu.Item
|
||||||
testID="postDropdownSendViaDMBtn"
|
testID="postDropdownSendViaDMBtn"
|
||||||
label={_(msg`Send via direct message`)}
|
label={_(msg`Send via direct message`)}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ export function AgeAssuranceDismissibleNotice({style}: ViewStyleProp & {}) {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={style}>
|
<View style={style}>
|
||||||
|
<View>
|
||||||
<AgeAssuranceAdmonition>{copy.notice}</AgeAssuranceAdmonition>
|
<AgeAssuranceAdmonition>{copy.notice}</AgeAssuranceAdmonition>
|
||||||
|
|
||||||
<Button
|
<Button
|
||||||
@@ -53,5 +54,6 @@ export function AgeAssuranceDismissibleNotice({style}: ViewStyleProp & {}) {
|
|||||||
<ButtonIcon icon={X} />
|
<ButtonIcon icon={X} />
|
||||||
</Button>
|
</Button>
|
||||||
</View>
|
</View>
|
||||||
|
</View>
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user