Просмотр исходного кода

refactor: remove props from SearchPage component to simplify usage

Shun Miyazawa 2 месяцев назад
Родитель
Сommit
56cb2ab789

+ 1 - 7
apps/app/src/features/search/client/components/SearchPage/SearchPage.tsx

@@ -47,11 +47,6 @@ type SearchResultListHeadProps = {
   onPagingSizeChanged: (size: number) => void;
 };
 
-type SearchPageProps = {
-  serverConfig: ServerConfigurationProps['serverConfig'];
-  rendererConfig: RendererConfig;
-};
-
 const SearchResultListHead = React.memo(
   (props: SearchResultListHeadProps): JSX.Element => {
     const { t } = useTranslation();
@@ -110,10 +105,9 @@ const SearchResultListHead = React.memo(
 
 SearchResultListHead.displayName = 'SearchResultListHead';
 
-export const SearchPage = (props: SearchPageProps): JSX.Element => {
+export const SearchPage = (): JSX.Element => {
   const { t } = useTranslation();
   const showPageLimitationL = useAtomValue(showPageLimitationLAtom);
-  useHydrateServerConfigurationAtoms(props.serverConfig, props.rendererConfig);
 
   const keyword = useSearchKeyword();
   const setSearchKeyword = useSetSearchKeyword();

+ 1 - 4
apps/app/src/pages/_search/index.page.tsx

@@ -71,10 +71,7 @@ const SearchResultPage: NextPageWithLayout<Props> = (props: Props) => {
       <DrawioViewerScript drawioUri={props.rendererConfig.drawioUri} />
 
       <SearchResultLayout>
-        <SearchPage
-          serverConfig={props.serverConfig}
-          rendererConfig={props.rendererConfig}
-        />
+        <SearchPage />
       </SearchResultLayout>
     </>
   );