Refactor to use 'defaultMediaVisibility' function
This commit is contained in:
@ -50,7 +50,7 @@ const DetailedStatus: React.FC<IDetailedStatus> = ({
|
||||
const { account } = actualStatus;
|
||||
if (!account || typeof account !== 'object') return null;
|
||||
|
||||
const inReview = actualStatus.visibility === 'self';
|
||||
const isUnderReview = actualStatus.visibility === 'self';
|
||||
const isSensitive = actualStatus.sensitive;
|
||||
|
||||
let statusTypeIcon = null;
|
||||
@ -94,11 +94,11 @@ const DetailedStatus: React.FC<IDetailedStatus> = ({
|
||||
justifyContent='end'
|
||||
className={
|
||||
classNames('relative', {
|
||||
'min-h-[220px]': inReview || isSensitive,
|
||||
'min-h-[220px]': isUnderReview || isSensitive,
|
||||
})
|
||||
}
|
||||
>
|
||||
{(inReview || isSensitive) ? (
|
||||
{(isUnderReview || isSensitive) ? (
|
||||
<SensitiveContentOverlay
|
||||
status={status}
|
||||
visible={showMedia}
|
||||
|
||||
@ -135,7 +135,7 @@ const Thread: React.FC<IThread> = (props) => {
|
||||
const me = useAppSelector(state => state.me);
|
||||
const status = useAppSelector(state => getStatus(state, { id: props.params.statusId }));
|
||||
const displayMedia = settings.get('displayMedia') as DisplayMedia;
|
||||
const inReview = status?.visibility === 'self';
|
||||
const isUnderReview = status?.visibility === 'self';
|
||||
|
||||
const { ancestorsIds, descendantsIds } = useAppSelector(state => {
|
||||
let ancestorsIds = ImmutableOrderedSet<string>();
|
||||
@ -463,14 +463,14 @@ const Thread: React.FC<IThread> = (props) => {
|
||||
ref={statusRef}
|
||||
className={
|
||||
classNames('detailed-status__wrapper focusable relative', {
|
||||
'min-h-[220px]': inReview,
|
||||
'min-h-[220px]': isUnderReview,
|
||||
})
|
||||
}
|
||||
tabIndex={0}
|
||||
// FIXME: no "reblogged by" text is added for the screen reader
|
||||
aria-label={textForScreenReader(intl, status)}
|
||||
>
|
||||
{inReview ? (
|
||||
{isUnderReview ? (
|
||||
<SensitiveContentOverlay
|
||||
status={status}
|
||||
visible={showMedia}
|
||||
|
||||
Reference in New Issue
Block a user