mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-19 19:49:37 +02:00
Empty sections will be hidden from guests. Fixed temperature value rounding. Added welcome message
This commit is contained in:
parent
882f011d07
commit
d110d9b732
11 changed files with 80 additions and 71 deletions
|
@ -3,6 +3,7 @@ import { Link } from 'react-router-dom';
|
|||
import { App } from '../../../interfaces/App';
|
||||
|
||||
import { AppCard } from '../AppCard/AppCard';
|
||||
import { Message } from '../../UI';
|
||||
|
||||
interface Props {
|
||||
apps: App[];
|
||||
|
@ -13,36 +14,32 @@ interface Props {
|
|||
export const AppGrid = (props: Props): JSX.Element => {
|
||||
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 {
|
||||
if (props.totalApps) {
|
||||
if (props.searching) {
|
||||
apps = (
|
||||
<p className={classes.AppsMessage}>
|
||||
No apps match your search criteria
|
||||
</p>
|
||||
);
|
||||
} else {
|
||||
apps = (
|
||||
<p className={classes.AppsMessage}>
|
||||
There are no pinned applications. You can pin them from the{' '}
|
||||
<Link to="/applications">/applications</Link> menu
|
||||
</p>
|
||||
);
|
||||
}
|
||||
if (props.searching || props.apps.length) {
|
||||
if (!props.apps.length) {
|
||||
apps = <Message>No apps match your search criteria</Message>;
|
||||
} else {
|
||||
apps = (
|
||||
<p className={classes.AppsMessage}>
|
||||
<div className={classes.AppGrid}>
|
||||
{props.apps.map((app: App): JSX.Element => {
|
||||
return <AppCard key={app.id} app={app} />;
|
||||
})}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
} else {
|
||||
if (props.totalApps) {
|
||||
apps = (
|
||||
<Message>
|
||||
There are no pinned applications. You can pin them from the{' '}
|
||||
<Link to="/applications">/applications</Link> menu
|
||||
</Message>
|
||||
);
|
||||
} else {
|
||||
apps = (
|
||||
<Message>
|
||||
You don't have any applications. You can add a new one from{' '}
|
||||
<Link to="/applications">/applications</Link> menu
|
||||
</p>
|
||||
</Message>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue