|
|
@ -15,26 +15,6 @@ import TabBar, { TabItems } from './components/tab-bar';
|
|
|
|
|
|
|
|
|
|
|
|
import type { Group as GroupEntity } from 'soapbox/types/entities';
|
|
|
|
import type { Group as GroupEntity } from 'soapbox/types/entities';
|
|
|
|
|
|
|
|
|
|
|
|
const EmptyMessage = () => (
|
|
|
|
|
|
|
|
<Stack space={6} alignItems='center' justifyContent='center' className='h-full p-6'>
|
|
|
|
|
|
|
|
<Stack space={2} className='max-w-sm'>
|
|
|
|
|
|
|
|
<Text size='2xl' weight='bold' tag='h2' align='center'>
|
|
|
|
|
|
|
|
<FormattedMessage
|
|
|
|
|
|
|
|
id='groups.empty.title'
|
|
|
|
|
|
|
|
defaultMessage='No Groups yet'
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</Text>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Text size='sm' theme='muted' align='center'>
|
|
|
|
|
|
|
|
<FormattedMessage
|
|
|
|
|
|
|
|
id='groups.empty.subtitle'
|
|
|
|
|
|
|
|
defaultMessage='Start discovering groups to join or create your own.'
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</Text>
|
|
|
|
|
|
|
|
</Stack>
|
|
|
|
|
|
|
|
</Stack>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const Groups: React.FC = () => {
|
|
|
|
const Groups: React.FC = () => {
|
|
|
|
const dispatch = useAppDispatch();
|
|
|
|
const dispatch = useAppDispatch();
|
|
|
|
const features = useFeatures();
|
|
|
|
const features = useFeatures();
|
|
|
@ -47,6 +27,37 @@ const Groups: React.FC = () => {
|
|
|
|
dispatch(openModal('MANAGE_GROUP'));
|
|
|
|
dispatch(openModal('MANAGE_GROUP'));
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const renderBlankslate = () => (
|
|
|
|
|
|
|
|
<Stack space={4} alignItems='center' justifyContent='center' className='py-6'>
|
|
|
|
|
|
|
|
<Stack space={2} className='max-w-sm'>
|
|
|
|
|
|
|
|
<Text size='2xl' weight='bold' tag='h2' align='center'>
|
|
|
|
|
|
|
|
<FormattedMessage
|
|
|
|
|
|
|
|
id='groups.empty.title'
|
|
|
|
|
|
|
|
defaultMessage='No Groups yet'
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</Text>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
<Text size='sm' theme='muted' align='center'>
|
|
|
|
|
|
|
|
<FormattedMessage
|
|
|
|
|
|
|
|
id='groups.empty.subtitle'
|
|
|
|
|
|
|
|
defaultMessage='Start discovering groups to join or create your own.'
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</Text>
|
|
|
|
|
|
|
|
</Stack>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{canCreateGroup && (
|
|
|
|
|
|
|
|
<Button
|
|
|
|
|
|
|
|
className='self-center'
|
|
|
|
|
|
|
|
onClick={createGroup}
|
|
|
|
|
|
|
|
theme='secondary'
|
|
|
|
|
|
|
|
>
|
|
|
|
|
|
|
|
<FormattedMessage id='new_group_panel.action' defaultMessage='Create Group' />
|
|
|
|
|
|
|
|
</Button>
|
|
|
|
|
|
|
|
)}
|
|
|
|
|
|
|
|
</Stack>
|
|
|
|
|
|
|
|
);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<Stack space={4}>
|
|
|
|
<Stack space={4}>
|
|
|
|
{canCreateGroup && (
|
|
|
|
{canCreateGroup && (
|
|
|
@ -67,7 +78,8 @@ const Groups: React.FC = () => {
|
|
|
|
|
|
|
|
|
|
|
|
<ScrollableList
|
|
|
|
<ScrollableList
|
|
|
|
scrollKey='groups'
|
|
|
|
scrollKey='groups'
|
|
|
|
emptyMessage={<EmptyMessage />}
|
|
|
|
emptyMessage={renderBlankslate()}
|
|
|
|
|
|
|
|
emptyMessageCard={false}
|
|
|
|
itemClassName='py-3 first:pt-0 last:pb-0'
|
|
|
|
itemClassName='py-3 first:pt-0 last:pb-0'
|
|
|
|
isLoading={isLoading}
|
|
|
|
isLoading={isLoading}
|
|
|
|
showLoading={isLoading && groups.length === 0}
|
|
|
|
showLoading={isLoading && groups.length === 0}
|
|
|
|