Props switcheroo
This commit is contained in:
@@ -117,7 +117,10 @@ export function TitleAndByline({
|
||||
<View style={[a.flex_1]}>
|
||||
<Hider.Outer
|
||||
modui={modUi}
|
||||
override={creator && currentAccount?.did === creator.did}>
|
||||
isContentVisibleInitialState={
|
||||
creator && currentAccount?.did === creator.did
|
||||
}
|
||||
allowOverride={creator && currentAccount?.did === creator.did}>
|
||||
<Hider.Mask>
|
||||
<Text
|
||||
style={[a.text_md, a.font_bold, a.leading_snug, a.italic]}
|
||||
|
||||
@@ -16,8 +16,8 @@ type Context = {
|
||||
info: ModerationCauseDescription
|
||||
showInfoDialog: () => void
|
||||
meta: {
|
||||
isNoPwi?: boolean
|
||||
noOverride?: boolean
|
||||
isNoPwi: boolean
|
||||
allowOverride: boolean
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,16 +27,18 @@ export const useHider = () => React.useContext(Context)
|
||||
|
||||
export function Outer({
|
||||
modui,
|
||||
override,
|
||||
isContentVisibleInitialState,
|
||||
allowOverride,
|
||||
children,
|
||||
}: React.PropsWithChildren<{
|
||||
override?: boolean
|
||||
isContentVisibleInitialState?: boolean
|
||||
allowOverride?: boolean
|
||||
modui: ModerationUI | undefined
|
||||
}>) {
|
||||
const control = useModerationDetailsDialogControl()
|
||||
const blur = modui?.blurs[0]
|
||||
const [isContentVisible, setIsContentVisible] = React.useState(
|
||||
override || !blur,
|
||||
isContentVisibleInitialState || !blur,
|
||||
)
|
||||
const info = useModerationCauseDescription(blur)
|
||||
|
||||
@@ -48,7 +50,7 @@ export function Outer({
|
||||
cause.labelDef.identifier === '!no-unauthenticated',
|
||||
),
|
||||
),
|
||||
noOverride: modui?.noOverride,
|
||||
allowOverride: allowOverride || !modui?.noOverride,
|
||||
}
|
||||
|
||||
const showInfoDialog = () => {
|
||||
@@ -56,7 +58,7 @@ export function Outer({
|
||||
}
|
||||
|
||||
const onSetContentVisible = (show: boolean) => {
|
||||
if (meta.noOverride) return
|
||||
if (meta.allowOverride) return
|
||||
setIsContentVisible(show)
|
||||
}
|
||||
|
||||
|
||||
@@ -142,6 +142,7 @@ function ProfileListScreenLoaded({
|
||||
const queryClient = useQueryClient()
|
||||
const {openComposer} = useComposerControls()
|
||||
const setMinimalShellMode = useSetMinimalShellMode()
|
||||
const {currentAccount} = useSession()
|
||||
const {rkey} = route.params
|
||||
const feedSectionRef = React.useRef<SectionRef>(null)
|
||||
const aboutSectionRef = React.useRef<SectionRef>(null)
|
||||
@@ -149,6 +150,7 @@ function ProfileListScreenLoaded({
|
||||
const isCurateList = list.purpose === 'app.bsky.graph.defs#curatelist'
|
||||
const isScreenFocused = useIsFocused()
|
||||
const isHidden = list.labels?.findIndex(l => l.val === '!hide') !== -1
|
||||
const isOwner = currentAccount?.did === list.creator.did
|
||||
|
||||
const moderation = React.useMemo(() => {
|
||||
return moderateUserList(list, moderationOpts)
|
||||
@@ -191,7 +193,7 @@ function ProfileListScreenLoaded({
|
||||
|
||||
if (isCurateList) {
|
||||
return (
|
||||
<Hider.Outer modui={moderation.ui('contentView')}>
|
||||
<Hider.Outer modui={moderation.ui('contentView')} allowOverride={isOwner}>
|
||||
<Hider.Mask>
|
||||
<ListHiddenScreen list={list} preferences={preferences} />
|
||||
</Hider.Mask>
|
||||
@@ -241,7 +243,7 @@ function ProfileListScreenLoaded({
|
||||
)
|
||||
}
|
||||
return (
|
||||
<Hider.Outer modui={moderation.ui('contentView')}>
|
||||
<Hider.Outer modui={moderation.ui('contentView')} allowOverride={isOwner}>
|
||||
<Hider.Mask>
|
||||
<ListHiddenScreen list={list} preferences={preferences} />
|
||||
</Hider.Mask>
|
||||
|
||||
Reference in New Issue
Block a user