pleroma/packages/pl-fe/src/layouts/search-layout.tsx
marcin mikołajczak 966b04fdf0 Call it pl-fe internally
Signed-off-by: marcin mikołajczak <git@mkljczk.pl>
2024-08-28 13:41:08 +02:00

51 lines
1,008 B
TypeScript

import React from 'react';
import LinkFooter from 'pl-fe/features/ui/components/link-footer';
import {
WhoToFollowPanel,
TrendsPanel,
SignUpPanel,
CtaBanner,
} from 'pl-fe/features/ui/util/async-components';
import { useAppSelector, useFeatures } from 'pl-fe/hooks';
import { Layout } from '../components/ui';
interface ISearchLayout {
children: React.ReactNode;
}
const SearchLayout: React.FC<ISearchLayout> = ({ children }) => {
const me = useAppSelector(state => state.me);
const features = useFeatures();
return (
<>
<Layout.Main>
{children}
{!me && (
<CtaBanner />
)}
</Layout.Main>
<Layout.Aside>
{!me && (
<SignUpPanel />
)}
{features.trends && (
<TrendsPanel limit={5} />
)}
{me && features.suggestions && (
<WhoToFollowPanel limit={3} />
)}
<LinkFooter />
</Layout.Aside>
</>
);
};
export { SearchLayout as default };