From 1d9130f7acee0ba697088f09d5e05e7015386022 Mon Sep 17 00:00:00 2001 From: Chewbacca Date: Wed, 14 Jun 2023 08:11:39 -0400 Subject: [PATCH] Add Suggested Groups panel to Search page --- app/soapbox/features/ui/index.tsx | 3 +- app/soapbox/pages/search-page.tsx | 67 +++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 app/soapbox/pages/search-page.tsx diff --git a/app/soapbox/features/ui/index.tsx b/app/soapbox/features/ui/index.tsx index dcdd7fecb..6cd41dde5 100644 --- a/app/soapbox/features/ui/index.tsx +++ b/app/soapbox/features/ui/index.tsx @@ -38,6 +38,7 @@ import HomePage from 'soapbox/pages/home-page'; import ManageGroupsPage from 'soapbox/pages/manage-groups-page'; import ProfilePage from 'soapbox/pages/profile-page'; import RemoteInstancePage from 'soapbox/pages/remote-instance-page'; +import SearchPage from 'soapbox/pages/search-page'; import StatusPage from 'soapbox/pages/status-page'; import { usePendingPolicy } from 'soapbox/queries/policies'; import { getAccessToken, getVapidKey } from 'soapbox/utils/auth'; @@ -275,7 +276,7 @@ const SwitchingColumnsArea: React.FC = ({ children }) => - + {features.suggestions && } {features.profileDirectory && } {features.events && } diff --git a/app/soapbox/pages/search-page.tsx b/app/soapbox/pages/search-page.tsx new file mode 100644 index 000000000..c032fbd26 --- /dev/null +++ b/app/soapbox/pages/search-page.tsx @@ -0,0 +1,67 @@ +import React from 'react'; + +import LinkFooter from 'soapbox/features/ui/components/link-footer'; +import BundleContainer from 'soapbox/features/ui/containers/bundle-container'; +import { + WhoToFollowPanel, + TrendsPanel, + SignUpPanel, + CtaBanner, + SuggestedGroupsPanel, +} from 'soapbox/features/ui/util/async-components'; +import { useAppSelector, useFeatures } from 'soapbox/hooks'; + +import { Layout } from '../components/ui'; + +interface ISearchPage { + children: React.ReactNode +} + +const SearchPage: React.FC = ({ children }) => { + const me = useAppSelector(state => state.me); + const features = useFeatures(); + + return ( + <> + + {children} + + {!me && ( + + {Component => } + + )} + + + + {!me && ( + + {Component => } + + )} + + {features.trends && ( + + {Component => } + + )} + + {me && features.suggestions && ( + + {Component => } + + )} + + {features.groups && ( + + {Component => } + + )} + + + + + ); +}; + +export default SearchPage;