change(ui): hide vitals when there is none added
This commit is contained in:
parent
0e89885e5e
commit
42fec5c19f
1 changed files with 23 additions and 24 deletions
|
|
@ -32,11 +32,6 @@ function DashboardWidgetGrid(props: Props) {
|
||||||
|
|
||||||
const smallWidgetsLen = smallWidgets.length
|
const smallWidgetsLen = smallWidgets.length
|
||||||
|
|
||||||
// legacy
|
|
||||||
// smallWidgets.forEach((i, index) => {
|
|
||||||
|
|
||||||
// })
|
|
||||||
|
|
||||||
return useObserver(() => (
|
return useObserver(() => (
|
||||||
// @ts-ignore
|
// @ts-ignore
|
||||||
<Loader loading={loading}>
|
<Loader loading={loading}>
|
||||||
|
|
@ -48,25 +43,29 @@ function DashboardWidgetGrid(props: Props) {
|
||||||
<div className="w-4/5 m-auto mt-4"><AddMetricContainer siteId={siteId} /></div>
|
<div className="w-4/5 m-auto mt-4"><AddMetricContainer siteId={siteId} /></div>
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
<div className="font-semibold text-xl py-4 flex items-center gap-2">
|
{smallWidgets.length && (
|
||||||
<Icon name="grid-horizontal" size={26} />
|
<>
|
||||||
Web Vitals
|
<div className="font-semibold text-xl py-4 flex items-center gap-2">
|
||||||
</div>
|
<Icon name="grid-horizontal" size={26} />
|
||||||
<div className="grid gap-4 grid-cols-4 items-start pb-10" id={props.id}>
|
Web Vitals
|
||||||
{smallWidgets && smallWidgets.map((item: any, index: any) => (
|
</div>
|
||||||
<React.Fragment key={item.widgetId}>
|
<div className="grid gap-4 grid-cols-4 items-start pb-10" id={props.id}>
|
||||||
<WidgetWrapper
|
{smallWidgets && smallWidgets.map((item: any, index: any) => (
|
||||||
index={index}
|
<React.Fragment key={item.widgetId}>
|
||||||
widget={item}
|
<WidgetWrapper
|
||||||
moveListItem={(dragIndex: any, hoverIndex: any) => dashboard.swapWidgetPosition(dragIndex, hoverIndex)}
|
index={index}
|
||||||
dashboardId={dashboardId}
|
widget={item}
|
||||||
siteId={siteId}
|
moveListItem={(dragIndex: any, hoverIndex: any) => dashboard.swapWidgetPosition(dragIndex, hoverIndex)}
|
||||||
isWidget={true}
|
dashboardId={dashboardId}
|
||||||
grid="vitals"
|
siteId={siteId}
|
||||||
/>
|
isWidget={true}
|
||||||
</React.Fragment>
|
grid="vitals"
|
||||||
))}
|
/>
|
||||||
</div>
|
</React.Fragment>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
</>
|
||||||
|
)}
|
||||||
|
|
||||||
<div className="font-semibold text-xl py-4 flex items-center gap-2">
|
<div className="font-semibold text-xl py-4 flex items-center gap-2">
|
||||||
<Icon name="grid-horizontal" size={26} />
|
<Icon name="grid-horizontal" size={26} />
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue