diff --git a/src/components/Prompt.tsx b/src/components/Prompt.tsx index b81b2070..37d1b700 100644 --- a/src/components/Prompt.tsx +++ b/src/components/Prompt.tsx @@ -3,11 +3,10 @@ import {View} from 'react-native' import {msg} from '@lingui/macro' import {useLingui} from '@lingui/react' -import {useTheme, atoms as a, useBreakpoints} from '#/alf' -import {Text} from '#/components/Typography' +import {atoms as a, useBreakpoints, useTheme} from '#/alf' import {Button, ButtonColor, ButtonText} from '#/components/Button' - import * as Dialog from '#/components/Dialog' +import {Text} from '#/components/Typography' export {useDialogControl as usePromptControl} from '#/components/Dialog' @@ -80,7 +79,7 @@ export function Actions({children}: React.PropsWithChildren<{}>) { { + return !!post.author.labels?.find( + label => label.val === '!no-unauthenticated', + ) + }, [post]) const defaultCtrlColor = React.useMemo( () => ({ @@ -209,18 +219,38 @@ let PostCtrls = ({ {big && ( - - - - - + <> + + { + if (shouldShowLoggedOutWarning) { + loggedOutWarningPromptControl.open() + } else { + onShare() + } + }} + accessibilityRole="button" + accessibilityLabel={`${_(msg`Share`)}`} + accessibilityHint="" + hitSlop={big ? HITSLOP_20 : HITSLOP_10}> + + + + + )}