From 569bdb8c5d7538fa0ea8a99ff2f8376f7cbfa51a Mon Sep 17 00:00:00 2001 From: piotrruss Date: Mon, 6 Sep 2021 23:13:22 +0200 Subject: added stadard linter --- pages/index.js | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'pages/index.js') diff --git a/pages/index.js b/pages/index.js index 72f99f4..ac36c3b 100644 --- a/pages/index.js +++ b/pages/index.js @@ -1,38 +1,40 @@ import styles from 'styles/Main.module.scss' -import React from 'react' +import Image from 'next/image' import useUser from 'hooks/useUser' import useSettings from 'hooks/useSettings' import useApps from 'hooks/useApps' import useMediaQuery from 'hooks/useMediaQuery' -import {Layout, App, Splash} from 'components' -import {open} from 'helpers/windowActions' +import { Layout, App, Splash } from 'components' +import { open } from 'helpers/windowActions' import appList from 'configs/appList' const Home = () => { - const {t} = useSettings() - const {apps, setApps} = useApps() - const touchDevice = useMediaQuery('(pointer: coarse)'); - const {user} = useUser({ + const { t } = useSettings() + const { apps, setApps } = useApps() + const touchDevice = useMediaQuery('(pointer: coarse)') + const { user } = useUser({ redirectToLogin: true, redirectToVerify: true, - redirectToApps: true, + redirectToApps: true }) - if (!user) return ( - - ) + if (!user) { + return ( + + ) + } const handleClick = (e, appProps) => { switch (e.detail) { case 1: touchDevice ? open(appProps, setApps) : e.currentTarget.focus() - break; + break case 2: open(appProps, setApps) e.currentTarget.blur() - break; + break } - }; + } const handleKey = (e, appProps) => { if (e.key === 'Enter') { @@ -48,11 +50,11 @@ const Home = () => {
handleClick(e, {appName: a[0], ...a[1]})} - onKeyDown={e => handleKey(e, {appName: a[0], ...a[1]})} - tabIndex="0" + onClick={e => handleClick(e, { appName: a[0], ...a[1] })} + onKeyDown={e => handleKey(e, { appName: a[0], ...a[1] })} + tabIndex='0' > - {`${a[0]} + {`${a[0]}

{t(a[0])}

)) @@ -70,7 +72,7 @@ const Home = () => { > - ); + ) })} -- cgit v1.2.3