Skip to content

Commit

Permalink
Front page: remove unnecessary useMemo
Browse files Browse the repository at this point in the history
  • Loading branch information
FilipChalupa committed Mar 9, 2024
1 parent 2a1d2cf commit 830ed51
Showing 1 changed file with 13 additions and 17 deletions.
30 changes: 13 additions & 17 deletions components/Frontpage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -20,24 +20,20 @@ import { usePWAInstall } from 'react-use-pwa-install'
import logo from '../public/images/app-icon/favicon.svg'
import { CreateCustomForm } from './CreateCustomForm'

export const Frontpage: React.FunctionComponent = () => {
const staticPresets = React.useMemo(
() => [
{ to: '/run/?seconds=60&flashOnZero', label: 'Countdown 1 minute' },
{ to: '/run/?seconds=120&flashOnZero', label: 'Countdown 2 minutes' },
{ to: '/run/?seconds=300&flashOnZero', label: 'Countdown 5 minutes' },
{ to: '/run/?seconds=600&flashOnZero', label: 'Countdown 10 minutes' },
{ to: '/run/?seconds=3600&flashOnZero', label: 'Countdown 60 minutes' },
{
to: '/run/?seconds=86400&showHours&flashOnZero',
label: 'Countdown 1 day',
},
],
[],
)

const dynamicPresets = React.useMemo(() => ['1', '2', '3'], [])
const staticPresets = [
{ to: '/run/?seconds=60&flashOnZero', label: 'Countdown 1 minute' },
{ to: '/run/?seconds=120&flashOnZero', label: 'Countdown 2 minutes' },
{ to: '/run/?seconds=300&flashOnZero', label: 'Countdown 5 minutes' },
{ to: '/run/?seconds=600&flashOnZero', label: 'Countdown 10 minutes' },
{ to: '/run/?seconds=3600&flashOnZero', label: 'Countdown 60 minutes' },
{
to: '/run/?seconds=86400&showHours&flashOnZero',
label: 'Countdown 1 day',
},
] as const
const dynamicPresets = ['1', '2', '3'] as const

export const Frontpage: React.FunctionComponent = () => {
const install = usePWAInstall()

return (
Expand Down

0 comments on commit 830ed51

Please sign in to comment.