mirror of
https://github.com/Unleash/unleash.git
synced 2025-05-08 01:15:49 +02:00
fix: grids needs containers and items
This commit is contained in:
parent
3f7e43c599
commit
e9a63197cf
@ -27,18 +27,20 @@ const EnvironmentMetricComponent: React.FC = () => {
|
||||
|
||||
const metricComponents = featureMetrics.map(metric => {
|
||||
return (
|
||||
<Grid item sm={6}>
|
||||
<Grid item sm={4}>
|
||||
<FeatureEnvironmentMetrics key={metric.environment} metric={metric} />
|
||||
</Grid>)
|
||||
})
|
||||
return (
|
||||
<>
|
||||
<Grid sm={12} data-loading>
|
||||
<Grid container data-loading spacing={1}>
|
||||
<Grid item xs={12}>
|
||||
<h2>{'Environments'}</h2>
|
||||
<hr />
|
||||
</Grid>
|
||||
{metricComponents}
|
||||
</Grid>
|
||||
<Grid sm={12} data-loading>
|
||||
<Grid container data-loading>
|
||||
<h2>Applications</h2>
|
||||
<hr />
|
||||
<FeatureSeenApplications />
|
||||
|
@ -1,7 +1,7 @@
|
||||
import useFeatureMetrics from '../../../../hooks/api/getters/useFeatureMetrics/useFeatureMetrics';
|
||||
import { Link, useParams } from 'react-router-dom';
|
||||
import { IFeatureViewParams } from '../../../../interfaces/params';
|
||||
import { Grid, List, ListItem, ListItemText } from '@material-ui/core';
|
||||
import { Grid } from '@material-ui/core';
|
||||
import React from 'react';
|
||||
import { useStyles } from './FeatureSeenApplications.styles';
|
||||
|
||||
@ -12,7 +12,7 @@ const FeatureSeenApplications: React.FC = () => {
|
||||
let seenApplications;
|
||||
if (metrics?.seenApplications?.length > 0) {
|
||||
seenApplications = metrics.seenApplications.map(appName => {
|
||||
return (<ListItem><ListItemText primary={
|
||||
return (<Grid item xs={4}>
|
||||
<Link
|
||||
to={`/applications/${appName}`}
|
||||
className={[
|
||||
@ -22,17 +22,16 @@ const FeatureSeenApplications: React.FC = () => {
|
||||
>
|
||||
{appName}
|
||||
</Link>
|
||||
} /></ListItem>)
|
||||
</Grid>)
|
||||
});
|
||||
} else {
|
||||
seenApplications = (<ListItem><ListItemText primary={'Not seen in any applications'} /></ListItem>);
|
||||
seenApplications = (<Grid item xs={12}><div>{'Not seen in any applications'}</div></Grid>);
|
||||
}
|
||||
|
||||
return (
|
||||
<Grid sm={12}>
|
||||
<List>
|
||||
{seenApplications}
|
||||
</List>
|
||||
<Grid container spacing={1}>
|
||||
<hr />
|
||||
{seenApplications}
|
||||
</Grid>
|
||||
);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user