2022-12-15 14:51:30 -08:00
|
|
|
import React from 'react';
|
2023-03-21 14:34:15 -07:00
|
|
|
import { Route, Routes } from 'react-router-dom-v5-compat';
|
2022-12-15 14:51:30 -08:00
|
|
|
|
|
|
|
import { Column, Layout } from 'soapbox/components/ui';
|
|
|
|
import LinkFooter from 'soapbox/features/ui/components/link-footer';
|
|
|
|
import BundleContainer from 'soapbox/features/ui/containers/bundle-container';
|
2023-03-21 14:34:15 -07:00
|
|
|
import { MyGroupsPanel, NewGroupPanel, SuggestedGroupsPanel } from 'soapbox/features/ui/util/async-components';
|
2022-12-15 14:51:30 -08:00
|
|
|
|
2023-01-27 14:04:42 -08:00
|
|
|
interface IGroupsPage {
|
|
|
|
children: React.ReactNode
|
|
|
|
}
|
2022-12-15 14:51:30 -08:00
|
|
|
|
|
|
|
/** Page to display groups. */
|
2023-02-05 14:14:21 -08:00
|
|
|
const GroupsPage: React.FC<IGroupsPage> = ({ children }) => (
|
|
|
|
<>
|
|
|
|
<Layout.Main>
|
|
|
|
<Column withHeader={false}>
|
|
|
|
<div className='space-y-4'>
|
|
|
|
{children}
|
|
|
|
</div>
|
|
|
|
</Column>
|
|
|
|
</Layout.Main>
|
2022-12-15 14:51:30 -08:00
|
|
|
|
2023-02-05 14:14:21 -08:00
|
|
|
<Layout.Aside>
|
|
|
|
<BundleContainer fetchComponent={NewGroupPanel}>
|
2023-03-21 14:34:15 -07:00
|
|
|
{Component => <Component />}
|
2023-02-05 14:14:21 -08:00
|
|
|
</BundleContainer>
|
2023-03-21 14:34:15 -07:00
|
|
|
<Routes>
|
|
|
|
<Route
|
|
|
|
path='/groups'
|
|
|
|
element={(
|
|
|
|
<BundleContainer fetchComponent={SuggestedGroupsPanel}>
|
|
|
|
{Component => <Component />}
|
|
|
|
</BundleContainer>
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
<Route
|
|
|
|
path='/groups/discover'
|
|
|
|
element={(
|
|
|
|
<BundleContainer fetchComponent={MyGroupsPanel}>
|
|
|
|
{Component => <Component />}
|
|
|
|
</BundleContainer>
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
</Routes>
|
2023-03-08 10:22:10 -08:00
|
|
|
|
2023-03-21 14:34:15 -07:00
|
|
|
<LinkFooter />
|
2023-02-05 14:14:21 -08:00
|
|
|
</Layout.Aside>
|
|
|
|
</>
|
|
|
|
);
|
2022-12-15 14:51:30 -08:00
|
|
|
|
|
|
|
export default GroupsPage;
|