From da93a874403066825a8c369d01776232464dca74 Mon Sep 17 00:00:00 2001 From: DrMint Date: Sun, 20 Feb 2022 15:18:35 +0100 Subject: [PATCH] Simplified how NavOption are declared --- src/components/PanelComponents/NavOption.tsx | 53 +++++++------------- 1 file changed, 18 insertions(+), 35 deletions(-) diff --git a/src/components/PanelComponents/NavOption.tsx b/src/components/PanelComponents/NavOption.tsx index a6ce47a..7718023 100644 --- a/src/components/PanelComponents/NavOption.tsx +++ b/src/components/PanelComponents/NavOption.tsx @@ -22,42 +22,25 @@ export default function NavOption(props: NavOptionProps): JSX.Element { props.border ? border : "" } ${isActive ? divActive : ""}`; - if (props.icon) { - if (props.reduced) { - return ( - -
- - {props.icon} - -
- - ); - } else { - return ( - -
- {props.icon} + return ( + +
+ {props.icon && ( + {props.icon} + )} + + {!props.reduced && ( +

{props.title}

{props.subtitle &&

{props.subtitle}

}
- - ); - } - } else { - return ( - -
-

{props.title}

- {props.subtitle &&

{props.subtitle}

} -
- - ); - } + )} +
+ + ); }