Add NewEventPanel to events list page
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
This commit is contained in:
47
app/soapbox/pages/events-page.tsx
Normal file
47
app/soapbox/pages/events-page.tsx
Normal file
@ -0,0 +1,47 @@
|
||||
import React from 'react';
|
||||
|
||||
import { Layout } from 'soapbox/components/ui';
|
||||
import LinkFooter from 'soapbox/features/ui/components/link-footer';
|
||||
import BundleContainer from 'soapbox/features/ui/containers/bundle-container';
|
||||
import {
|
||||
WhoToFollowPanel,
|
||||
TrendsPanel,
|
||||
NewEventPanel,
|
||||
} from 'soapbox/features/ui/util/async-components';
|
||||
import { useFeatures } from 'soapbox/hooks';
|
||||
|
||||
interface IEventsPage {
|
||||
children: React.ReactNode
|
||||
}
|
||||
|
||||
/** Page to display events list. */
|
||||
const EventsPage: React.FC<IEventsPage> = ({ children }) => {
|
||||
const features = useFeatures();
|
||||
|
||||
return (
|
||||
<>
|
||||
<Layout.Main>
|
||||
{children}
|
||||
</Layout.Main>
|
||||
|
||||
<Layout.Aside>
|
||||
<BundleContainer fetchComponent={NewEventPanel}>
|
||||
{Component => <Component key='new-event-panel' />}
|
||||
</BundleContainer>
|
||||
{features.trends && (
|
||||
<BundleContainer fetchComponent={TrendsPanel}>
|
||||
{Component => <Component limit={5} key='trends-panel' />}
|
||||
</BundleContainer>
|
||||
)}
|
||||
{features.suggestions && (
|
||||
<BundleContainer fetchComponent={WhoToFollowPanel}>
|
||||
{Component => <Component limit={3} key='wtf-panel' />}
|
||||
</BundleContainer>
|
||||
)}
|
||||
<LinkFooter key='link-footer' />
|
||||
</Layout.Aside>
|
||||
</>
|
||||
);
|
||||
};
|
||||
|
||||
export default EventsPage;
|
||||
@ -3,45 +3,30 @@ import React from 'react';
|
||||
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';
|
||||
import {
|
||||
NewGroupPanel,
|
||||
CtaBanner,
|
||||
} from 'soapbox/features/ui/util/async-components';
|
||||
import { useAppSelector } from 'soapbox/hooks';
|
||||
import { NewGroupPanel } from 'soapbox/features/ui/util/async-components';
|
||||
|
||||
interface IGroupsPage {
|
||||
children: React.ReactNode
|
||||
}
|
||||
|
||||
/** Page to display groups. */
|
||||
const GroupsPage: React.FC<IGroupsPage> = ({ children }) => {
|
||||
const me = useAppSelector(state => state.me);
|
||||
// const match = useRouteMatch();
|
||||
const GroupsPage: React.FC<IGroupsPage> = ({ children }) => (
|
||||
<>
|
||||
<Layout.Main>
|
||||
<Column withHeader={false}>
|
||||
<div className='space-y-4'>
|
||||
{children}
|
||||
</div>
|
||||
</Column>
|
||||
</Layout.Main>
|
||||
|
||||
return (
|
||||
<>
|
||||
<Layout.Main>
|
||||
<Column withHeader={false}>
|
||||
<div className='space-y-4'>
|
||||
{children}
|
||||
</div>
|
||||
</Column>
|
||||
|
||||
{!me && (
|
||||
<BundleContainer fetchComponent={CtaBanner}>
|
||||
{Component => <Component key='cta-banner' />}
|
||||
</BundleContainer>
|
||||
)}
|
||||
</Layout.Main>
|
||||
|
||||
<Layout.Aside>
|
||||
<BundleContainer fetchComponent={NewGroupPanel}>
|
||||
{Component => <Component key='new-group-panel' />}
|
||||
</BundleContainer>
|
||||
<LinkFooter key='link-footer' />
|
||||
</Layout.Aside>
|
||||
</>
|
||||
);
|
||||
};
|
||||
<Layout.Aside>
|
||||
<BundleContainer fetchComponent={NewGroupPanel}>
|
||||
{Component => <Component key='new-group-panel' />}
|
||||
</BundleContainer>
|
||||
<LinkFooter key='link-footer' />
|
||||
</Layout.Aside>
|
||||
</>
|
||||
);
|
||||
|
||||
export default GroupsPage;
|
||||
|
||||
Reference in New Issue
Block a user