mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-19 19:49:37 +02:00
Display info message on homescreen if applications or categories arrays are empty
This commit is contained in:
parent
22920f2660
commit
35c589c94c
8 changed files with 58 additions and 42 deletions
|
@ -1,4 +1,5 @@
|
|||
import classes from './AppGrid.module.css';
|
||||
import { Link } from 'react-router-dom';
|
||||
import { App } from '../../../interfaces/App';
|
||||
|
||||
import AppCard from '../AppCard/AppCard';
|
||||
|
@ -8,16 +9,24 @@ interface ComponentProps {
|
|||
}
|
||||
|
||||
const AppGrid = (props: ComponentProps): JSX.Element => {
|
||||
const apps = (
|
||||
<div className={classes.AppGrid}>
|
||||
{props.apps.map((app: App): JSX.Element => {
|
||||
return <AppCard
|
||||
key={app.id}
|
||||
app={app}
|
||||
/>
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
let apps: JSX.Element;
|
||||
|
||||
if (props.apps.length > 0) {
|
||||
apps = (
|
||||
<div className={classes.AppGrid}>
|
||||
{props.apps.map((app: App): JSX.Element => {
|
||||
return <AppCard
|
||||
key={app.id}
|
||||
app={app}
|
||||
/>
|
||||
})}
|
||||
</div>
|
||||
)
|
||||
} else {
|
||||
apps = (
|
||||
<p className={classes.AppsMessage}>You don't have any applications. You can add a new one from <Link to='/applications'>/application</Link> menu</p>
|
||||
);
|
||||
}
|
||||
|
||||
return apps;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue