diff --git a/app/soapbox/features/group/components/group-header.tsx b/app/soapbox/features/group/components/group-header.tsx index f3180037b..9626906d5 100644 --- a/app/soapbox/features/group/components/group-header.tsx +++ b/app/soapbox/features/group/components/group-header.tsx @@ -52,6 +52,8 @@ const GroupHeader: React.FC = ({ group }) => { ); } + const isDeleted = !!group.deleted_at; + const onAvatarClick = () => { const avatar = normalizeAttachment({ type: 'image', @@ -136,24 +138,28 @@ const GroupHeader: React.FC = ({ group }) => { dangerouslySetInnerHTML={{ __html: group.display_name_html }} /> - - - - - - + {!isDeleted && ( + <> + + + + + + - - + + - - - - + + + + + + )} ); diff --git a/app/soapbox/locales/en.json b/app/soapbox/locales/en.json index 3f6c24526..b9c54f32c 100644 --- a/app/soapbox/locales/en.json +++ b/app/soapbox/locales/en.json @@ -768,8 +768,10 @@ "gdpr.message": "{siteTitle} uses session cookies, which are essential to the website's functioning.", "gdpr.title": "{siteTitle} uses cookies", "getting_started.open_source_notice": "{code_name} is open source software. You can contribute or report issues at {code_link} (v{code_version}).", + "group.banned.message": "You are banned from", "group.cancel_request": "Cancel Request", "group.delete.success": "Group successfully deleted", + "group.deleted.message": "This group has been deleted.", "group.demote.user.success": "@{name} is now a member", "group.group_mod_authorize.fail": "Failed to approve @{name}", "group.group_mod_block": "Ban from group", @@ -801,6 +803,7 @@ "group.privacy.public": "Public", "group.privacy.public.full": "Public Group", "group.privacy.public.info": "Discoverable. Anyone can join.", + "group.private.message": "Content is only visible to group members", "group.promote.admin.confirmation.message": "Are you sure you want to assign the admin role to @{name}?", "group.promote.admin.confirmation.title": "Assign Admin Role", "group.promote.admin.success": "@{name} is now an admin", diff --git a/app/soapbox/normalizers/group.ts b/app/soapbox/normalizers/group.ts index 127bca29f..152a6c3c4 100644 --- a/app/soapbox/normalizers/group.ts +++ b/app/soapbox/normalizers/group.ts @@ -21,6 +21,7 @@ export const GroupRecord = ImmutableRecord({ avatar: '', avatar_static: '', created_at: '', + deleted_at: null, display_name: '', domain: '', emojis: [] as Emoji[], diff --git a/app/soapbox/pages/group-page.tsx b/app/soapbox/pages/group-page.tsx index 79076a16a..9e11c34a9 100644 --- a/app/soapbox/pages/group-page.tsx +++ b/app/soapbox/pages/group-page.tsx @@ -1,5 +1,5 @@ import React, { useMemo } from 'react'; -import { defineMessages, useIntl } from 'react-intl'; +import { FormattedMessage, defineMessages, useIntl } from 'react-intl'; import { useRouteMatch } from 'react-router-dom'; import GroupLookupHoc from 'soapbox/components/hoc/group-lookup-hoc'; @@ -34,26 +34,56 @@ interface IGroupPage { children: React.ReactNode } -const PrivacyBlankslate = () => ( +const DeletedBlankslate = () => ( -
- +
+
- Content is only visible to group members + + + +); + +const PrivacyBlankslate = () => ( + +
+ +
+ + +
); const BlockedBlankslate = ({ group }: { group: Group }) => ( -
- +
+
- You are banned from + {' '} @@ -75,6 +105,7 @@ const GroupPage: React.FC = ({ params, children }) => { const isMember = !!group?.relationship?.member; const isBlocked = group?.relationship?.blocked_by; const isPrivate = group?.locked; + const isDeleted = !!group?.deleted_at; const tabItems = useMemo(() => { const items = []; @@ -108,7 +139,9 @@ const GroupPage: React.FC = ({ params, children }) => { }, [features.groupsTags, pending.length]); const renderChildren = () => { - if (!isMember && isPrivate) { + if (isDeleted) { + return ; + } else if (!isMember && isPrivate) { return ; } else if (isBlocked) { return ; diff --git a/app/soapbox/schemas/group.ts b/app/soapbox/schemas/group.ts index 746ae9d33..752846b42 100644 --- a/app/soapbox/schemas/group.ts +++ b/app/soapbox/schemas/group.ts @@ -16,6 +16,7 @@ const groupSchema = z.object({ avatar: z.string().catch(avatarMissing), avatar_static: z.string().catch(''), created_at: z.string().datetime().catch(new Date().toUTCString()), + deleted_at: z.string().datetime().or(z.null()).catch(null), display_name: z.string().catch(''), domain: z.string().catch(''), emojis: filteredArray(customEmojiSchema).catch([]),