diff --git a/app/soapbox/components/ui/text/text.tsx b/app/soapbox/components/ui/text/text.tsx index 221c070fc..973d0c8b2 100644 --- a/app/soapbox/components/ui/text/text.tsx +++ b/app/soapbox/components/ui/text/text.tsx @@ -51,7 +51,7 @@ const families = { }; export type Sizes = keyof typeof sizes -type Tags = 'abbr' | 'p' | 'span' | 'pre' | 'time' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' +type Tags = 'abbr' | 'p' | 'span' | 'pre' | 'time' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6' | 'label' | 'blockquote' type Directions = 'ltr' | 'rtl' interface IText extends Pick, 'dangerouslySetInnerHTML' | 'tabIndex' | 'lang'> { diff --git a/app/soapbox/features/admin/components/report-status.tsx b/app/soapbox/features/admin/components/report-status.tsx index f81deeab7..d990d8e81 100644 --- a/app/soapbox/features/admin/components/report-status.tsx +++ b/app/soapbox/features/admin/components/report-status.tsx @@ -1,16 +1,14 @@ -import noop from 'lodash/noop'; import React from 'react'; import { useIntl, defineMessages } from 'react-intl'; -import { openModal } from 'soapbox/actions/modals'; import { deleteStatusModal } from 'soapbox/actions/moderation'; import StatusContent from 'soapbox/components/status-content'; +import StatusMedia from 'soapbox/components/status-media'; +import { HStack, Stack } from 'soapbox/components/ui'; import DropdownMenu from 'soapbox/containers/dropdown-menu-container'; -import Bundle from 'soapbox/features/ui/components/bundle'; -import { MediaGallery, Video, Audio } from 'soapbox/features/ui/util/async-components'; import { useAppDispatch } from 'soapbox/hooks'; -import type { AdminReport, Attachment, Status } from 'soapbox/types/entities'; +import type { AdminReport, Status } from 'soapbox/types/entities'; const messages = defineMessages({ viewStatus: { id: 'admin.reports.actions.view_status', defaultMessage: 'View post' }, @@ -26,10 +24,6 @@ const ReportStatus: React.FC = ({ status }) => { const intl = useIntl(); const dispatch = useAppDispatch(); - const handleOpenMedia = (media: Attachment, index: number) => { - dispatch(openModal('MEDIA', { media, status, index })); - }; - const handleDeleteStatus = () => { dispatch(deleteStatusModal(intl, status.id)); }; @@ -49,84 +43,20 @@ const ReportStatus: React.FC = ({ status }) => { }]; }; - const getMedia = () => { - const firstAttachment = status.media_attachments.get(0); - - if (firstAttachment) { - if (status.media_attachments.some(item => item.type === 'unknown')) { - // Do nothing - } else if (firstAttachment.type === 'video') { - const video = firstAttachment; - - return ( - - {(Component: any) => ( - - )} - - ); - } else if (firstAttachment.type === 'audio') { - const audio = firstAttachment; - - return ( - - {(Component: any) => ( - - )} - - ); - } else { - return ( - - {(Component: any) => ( - - )} - - ); - } - } - - return null; - }; - - const media = getMedia(); const menu = makeMenu(); return ( -
-
+ + - {media} -
-
- -
-
+ + + + + ); }; diff --git a/app/soapbox/features/admin/components/report.tsx b/app/soapbox/features/admin/components/report.tsx index 4c37b7b61..605eea32c 100644 --- a/app/soapbox/features/admin/components/report.tsx +++ b/app/soapbox/features/admin/components/report.tsx @@ -7,7 +7,7 @@ import { deactivateUserModal, deleteUserModal } from 'soapbox/actions/moderation import snackbar from 'soapbox/actions/snackbar'; import Avatar from 'soapbox/components/avatar'; import HoverRefWrapper from 'soapbox/components/hover-ref-wrapper'; -import { Accordion, Button, HStack } from 'soapbox/components/ui'; +import { Accordion, Button, Stack, HStack, Text } from 'soapbox/components/ui'; import DropdownMenu from 'soapbox/containers/dropdown-menu-container'; import { useAppDispatch, useAppSelector } from 'soapbox/hooks'; import { makeGetReport } from 'soapbox/selectors'; @@ -82,49 +82,68 @@ const Report: React.FC = ({ id }) => { const reporterAcct = account.acct as string; return ( -
-
- - - - - -
-
-

+ + + + + + + + + + @{acct} ) }} /> -

-
- {statusCount > 0 && ( - - {statuses.map(status => )} - - )} -
-
+ + + {statusCount > 0 && ( + + + {statuses.map(status => ( + + ))} + + + )} + + {(report.comment || '').length > 0 && ( -
+ )} - - — - - @{reporterAcct} + + + + + + + @{reporterAcct} + - -
-
+ + + +
+ ); }; diff --git a/app/soapbox/features/admin/tabs/reports.tsx b/app/soapbox/features/admin/tabs/reports.tsx index 8975fff5c..d066f34e1 100644 --- a/app/soapbox/features/admin/tabs/reports.tsx +++ b/app/soapbox/features/admin/tabs/reports.tsx @@ -35,6 +35,7 @@ const Reports: React.FC = () => { showLoading={showLoading} scrollKey='admin-reports' emptyMessage={intl.formatMessage(messages.emptyMessage)} + className='divide-y divide-solid divide-gray-200 dark:divide-gray-800' > {reports.map(report => report && )} diff --git a/app/styles/components/admin.scss b/app/styles/components/admin.scss index 302baa4e1..bba02ffe8 100644 --- a/app/styles/components/admin.scss +++ b/app/styles/components/admin.scss @@ -56,86 +56,6 @@ } } -.admin-report { - padding: 15px; - display: flex; - border-bottom: 1px solid var(--brand-color--faint); - - &__content { - padding: 0 16px; - flex: 1; - overflow: hidden; - } - - &__title { - font-weight: bold; - text-overflow: ellipsis; - overflow: hidden; - } - - &__quote { - font-size: 14px; - - a { - color: var(--brand-color--hicontrast); - } - - .byline { - font-size: 12px; - - a { - text-decoration: none; - } - } - } - - &__actions { - display: flex; - align-items: center; - height: fit-content; - margin-left: auto; - - .icon-button { - padding-left: 10px; - - > div { - display: flex; - align-items: center; - justify-content: center; - - > .svg-icon { - height: 20px; - width: 20px; - } - } - } - } - - &__status-content { - overflow: hidden; - } - - &__status { - display: flex; - border-bottom: 1px solid var(--accent-color--med); - padding: 10px 0; - - &:last-child { - border: 0; - } - - .status__content { - flex: 1; - padding: 0; - } - - &-actions { - padding: 3px 10px; - margin-left: auto; - } - } -} - .logentry { padding: 15px;