add header group

This commit is contained in:
Simon Larsen 2024-10-04 11:40:38 -07:00
parent 30db4e58ff
commit 09955a5ba9
No known key found for this signature in database
GPG Key ID: 96C5DCA24769DBCA
2 changed files with 20 additions and 11 deletions

View File

@ -9,18 +9,24 @@ const HeaderAlertGroup: (props: ComponentProps) => ReactElement = (
): ReactElement => {
return (
<div className="rounded-lg m-2 flex border-2 border-gray-200">
{props.children.map((child: ReactElement, index: number) => {
const isLastElement: boolean = index === props.children.length - 1;
{props.children &&
props.children
.filter((child: ReactElement) => {
// does this child has children?;
return true;
})
.map((child: ReactElement, index: number) => {
const isLastElement: boolean = index === props.children.length - 1;
return (
<div key={index} className="p-4 flex">
{child}
{!isLastElement && (
<div className="border-r-2 border-gray-200"></div>
)}
</div>
);
})}
return (
<div key={index} className="p-4 flex">
{child}
{!isLastElement && (
<div className="border-r-2 border-gray-200"></div>
)}
</div>
);
})}
</div>
);
};

View File

@ -276,6 +276,9 @@ const DashboardHeader: FunctionComponent<ComponentProps> = (
icon={IconProp.Clock}
tooltip="Your trial ends soon"
alertType={HeaderAlertType.INFO}
onClick={() => {
Navigation.navigate(RouteMap[PageMap.SETTINGS_BILLING]!);
}}
title={`${OneUptimeDate.getNumberOfDaysBetweenDatesInclusive(
OneUptimeDate.getCurrentDate(),
props.selectedProject!.trialEndsAt!,