mirror of
https://github.com/pawelmalak/flame.git
synced 2025-07-25 13:59:36 +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
|
@ -11,7 +11,7 @@ import { actionCreators } from '../../store';
|
|||
import { App, Category } from '../../interfaces';
|
||||
|
||||
// UI
|
||||
import { Icon, Container, SectionHeadline, Spinner } from '../UI';
|
||||
import { Icon, Container, SectionHeadline, Spinner, Message } from '../UI';
|
||||
|
||||
// CSS
|
||||
import classes from './Home.module.css';
|
||||
|
@ -30,6 +30,7 @@ export const Home = (): JSX.Element => {
|
|||
apps: { apps, loading: appsLoading },
|
||||
bookmarks: { categories, loading: bookmarksLoading },
|
||||
config: { config },
|
||||
auth: { isAuthenticated },
|
||||
} = useSelector((state: State) => state);
|
||||
|
||||
const dispatch = useDispatch();
|
||||
|
@ -100,7 +101,18 @@ export const Home = (): JSX.Element => {
|
|||
|
||||
<Header />
|
||||
|
||||
{!config.hideApps ? (
|
||||
{!isAuthenticated &&
|
||||
!apps.some((a) => a.isPinned) &&
|
||||
!categories.some((c) => c.isPinned) ? (
|
||||
<Message>
|
||||
Welcome to Flame! Go to <Link to="/settings/app">/settings</Link>,
|
||||
login and start customizing your new homepage
|
||||
</Message>
|
||||
) : (
|
||||
<></>
|
||||
)}
|
||||
|
||||
{!config.hideApps && (isAuthenticated || apps.some((a) => a.isPinned)) ? (
|
||||
<Fragment>
|
||||
<SectionHeadline title="Applications" link="/applications" />
|
||||
{appsLoading ? (
|
||||
|
@ -119,10 +131,11 @@ export const Home = (): JSX.Element => {
|
|||
<div className={classes.HomeSpace}></div>
|
||||
</Fragment>
|
||||
) : (
|
||||
<div></div>
|
||||
<></>
|
||||
)}
|
||||
|
||||
{!config.hideCategories ? (
|
||||
{!config.hideCategories &&
|
||||
(isAuthenticated || categories.some((c) => c.isPinned)) ? (
|
||||
<Fragment>
|
||||
<SectionHeadline title="Bookmarks" link="/bookmarks" />
|
||||
{bookmarksLoading ? (
|
||||
|
@ -142,7 +155,7 @@ export const Home = (): JSX.Element => {
|
|||
)}
|
||||
</Fragment>
|
||||
) : (
|
||||
<div></div>
|
||||
<></>
|
||||
)}
|
||||
|
||||
<Link to="/settings" className={classes.SettingsButton}>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue