2022-04-28 10:50:30 -07:00
|
|
|
import React from 'react';
|
|
|
|
|
2022-11-16 05:32:32 -08:00
|
|
|
import LinkFooter from 'soapbox/features/ui/components/link-footer';
|
2022-04-28 10:50:30 -07:00
|
|
|
import {
|
|
|
|
WhoToFollowPanel,
|
|
|
|
TrendsPanel,
|
|
|
|
SignUpPanel,
|
2022-05-10 03:17:14 -07:00
|
|
|
CtaBanner,
|
2022-04-28 10:50:30 -07:00
|
|
|
} from 'soapbox/features/ui/util/async-components';
|
|
|
|
import { useAppSelector, useFeatures } from 'soapbox/hooks';
|
|
|
|
|
|
|
|
import { Layout } from '../components/ui';
|
|
|
|
|
2024-08-24 06:01:17 -07:00
|
|
|
interface IDefaultLayout {
|
2023-10-02 11:54:02 -07:00
|
|
|
children: React.ReactNode;
|
2023-01-10 15:03:15 -08:00
|
|
|
}
|
|
|
|
|
2024-08-24 06:01:17 -07:00
|
|
|
const DefaultLayout: React.FC<IDefaultLayout> = ({ children }) => {
|
2022-04-28 10:50:30 -07:00
|
|
|
const me = useAppSelector(state => state.me);
|
|
|
|
const features = useFeatures();
|
|
|
|
|
|
|
|
return (
|
2022-04-28 16:18:55 -07:00
|
|
|
<>
|
2022-04-28 10:50:30 -07:00
|
|
|
<Layout.Main>
|
|
|
|
{children}
|
2022-05-10 03:17:14 -07:00
|
|
|
|
|
|
|
{!me && (
|
2023-10-07 15:14:45 -07:00
|
|
|
<CtaBanner />
|
2022-05-10 03:17:14 -07:00
|
|
|
)}
|
2022-04-28 10:50:30 -07:00
|
|
|
</Layout.Main>
|
|
|
|
|
|
|
|
<Layout.Aside>
|
2022-05-07 09:52:56 -07:00
|
|
|
{!me && (
|
2023-10-07 15:14:45 -07:00
|
|
|
<SignUpPanel />
|
2022-04-28 10:50:30 -07:00
|
|
|
)}
|
|
|
|
{features.trends && (
|
2023-10-07 15:14:45 -07:00
|
|
|
<TrendsPanel limit={5} />
|
2022-04-28 10:50:30 -07:00
|
|
|
)}
|
2022-10-09 15:32:09 -07:00
|
|
|
{me && features.suggestions && (
|
2023-10-07 15:14:45 -07:00
|
|
|
<WhoToFollowPanel limit={3} />
|
2022-04-28 10:50:30 -07:00
|
|
|
)}
|
|
|
|
<LinkFooter key='link-footer' />
|
|
|
|
</Layout.Aside>
|
2022-04-28 16:18:55 -07:00
|
|
|
</>
|
2022-04-28 10:50:30 -07:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
2024-08-24 06:01:17 -07:00
|
|
|
export { DefaultLayout as default };
|