From 826e288653c396accc810eb32ae268a6c44234a1 Mon Sep 17 00:00:00 2001 From: Timo Heddes Date: Fri, 11 Aug 2023 08:27:17 +0200 Subject: [PATCH] refactor: strict children --- .../libs/react-ui/src/components/NavFooter/NavFooter.tsx | 5 +++-- .../react-ui/src/components/NavFooter/NavFooterPanel.tsx | 8 ++++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/packages/libs/react-ui/src/components/NavFooter/NavFooter.tsx b/packages/libs/react-ui/src/components/NavFooter/NavFooter.tsx index dd331d2500e..f026a3e9ff7 100644 --- a/packages/libs/react-ui/src/components/NavFooter/NavFooter.tsx +++ b/packages/libs/react-ui/src/components/NavFooter/NavFooter.tsx @@ -1,10 +1,11 @@ import { containerClass } from './NavFooter.css'; +import { INavFooterPanelProps } from './NavFooterPanel'; import { darkThemeClass } from '@theme/vars.css'; -import React, { FC } from 'react'; +import React, { FC, FunctionComponentElement } from 'react'; export interface INavFooterContainerProps { - children: React.ReactNode; + children: FunctionComponentElement[]; darkMode?: boolean; } diff --git a/packages/libs/react-ui/src/components/NavFooter/NavFooterPanel.tsx b/packages/libs/react-ui/src/components/NavFooter/NavFooterPanel.tsx index 9fd9dd0e87c..77afb39fcad 100644 --- a/packages/libs/react-ui/src/components/NavFooter/NavFooterPanel.tsx +++ b/packages/libs/react-ui/src/components/NavFooter/NavFooterPanel.tsx @@ -1,9 +1,13 @@ import { footerPanel } from './NavFooter.css'; +import { INavFooterIconButtonProps } from './NavFooterIconButton'; +import { INavFooterLinkProps } from './NavFooterLink'; -import React, { FC } from 'react'; +import React, { FC, FunctionComponentElement } from 'react'; export interface INavFooterPanelProps { - children: React.ReactNode; + children: FunctionComponentElement< + INavFooterLinkProps | INavFooterIconButtonProps + >[]; } export const NavFooterPanel: FC = ({ children }) => {