Skip to content

Commit

Permalink
lint
Browse files Browse the repository at this point in the history
  • Loading branch information
ug.rp committed Apr 19, 2024
1 parent f26f874 commit 1ef401a
Show file tree
Hide file tree
Showing 10 changed files with 23 additions and 44 deletions.
16 changes: 10 additions & 6 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@
"dev": "PORT=3000 react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"eject": "react-scripts eject",
"lint": "eslint --fix --ext .js,.json ./src"
},
"eslintConfig": {
"extends": [
Expand Down
11 changes: 0 additions & 11 deletions src/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,25 +6,14 @@ import {DbSessionContext} from 'contexts/db-session'
import DbSession from 'components/db-session'
import Layout from 'layouts/app'

import PageHome from 'pages/home'

import AuthRequired from 'components/auth-required'
import PageRegister from 'pages/auth/register'
import PageLogin from 'pages/auth/login'
import PageLogout from 'pages/auth/logout'
import PageResetPassword from 'pages/auth/reset-password'

import PageAccount from 'pages/account'
import PageAccountChannels from 'pages/channels/me'

import PageChannels from 'pages/channels'
import PageChannel from 'pages/channel'
import PageChannelsCreate from 'pages/create/channel'
import PageChannelsImport from 'pages/create/channel/import'
import PageChannelEdit from 'pages/channel/edit'

import PageTest from 'pages/test'
import PageAdd from 'pages/create/track'
import PageStyleguide from 'pages/style'
import PageNoMatch from 'pages/404'

Expand Down
15 changes: 7 additions & 8 deletions src/components/site/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import config from 'config'
import {DbSessionContext} from 'contexts/db-session'
import CommandMenu from 'components/site/command-menu'
import createCommands from 'utils/commands'
import {SelectUserChannel} from 'components/channels'

const {RADIO4000_APP_NAME_MINI} = config

Expand All @@ -15,13 +14,13 @@ export default function Nav(props) {
{({session, setUserChannel, userChannel, userChannels}) => {
const commands = createCommands({isSignedIn: session, navigate, userChannel})

const handleChannelChanged = ({target: {name, value: selectedChannelSlug}}) => {
const selectedChannel = userChannels.find((channel) => {
return channel.slug === selectedChannelSlug
})
setUserChannel(selectedChannel)
navigate(`/${selectedChannelSlug}/`)
}
/* const handleChannelChanged = ({target: {name, value: selectedChannelSlug}}) => {
const selectedChannel = userChannels.find((channel) => {
return channel.slug === selectedChannelSlug
})
setUserChannel(selectedChannel)
navigate(`/${selectedChannelSlug}/`)
} */

return (
<>
Expand Down
2 changes: 1 addition & 1 deletion src/components/styled-firebase-auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const StyledFirebaseAuth = ({uiConfig, firebaseAuth, className, uiCallback}) =>
unregisterAuthObserver()
firebaseUiWidget.reset()
}
}, [firebaseAuth, uiCallback, userSignedIn, firebaseui, uiConfig])
}, [firebaseAuth, uiCallback, userSignedIn, uiConfig])

return <div className={className} ref={elementRef} />
}
Expand Down
2 changes: 1 addition & 1 deletion src/layouts/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {useState, useEffect} from 'react'
import {ThemeContext, themeContextDefault, darkMediaQuery} from 'contexts/theme.js'
import {PlayerProvider} from 'contexts/player'
import SiteNav from 'components/site/nav'
import Player from 'components/player'
/* import Player from 'components/player' */

export default function LayoutApp({children, dbSession, session}) {
const [theme, setTheme] = useState(themeContextDefault.theme)
Expand Down
7 changes: 1 addition & 6 deletions src/pages/account/index.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,7 @@
import {Link, useNavigate} from 'react-router-dom'
import {Link} from 'react-router-dom'
import LayoutAccount from 'layouts/account'
import DeleteUserForm from 'components/delete-user-form'
import ThemeToggleButton from 'components/site/theme-toggle-button'

export default function Account({dbSession: {database, session, userChannel}}) {
const navigate = useNavigate()
const handleDeleteUser = () => navigate('/logout')

return (
<LayoutAccount>
<section>
Expand Down
2 changes: 1 addition & 1 deletion src/pages/auth/login.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {Link, useNavigate, useSearchParams} from 'react-router-dom'
import {useNavigate, useSearchParams} from 'react-router-dom'
import AuthForm from 'components/auth-form'
import ResetPasswordForm from 'components/auth-reset-password-form'

Expand Down
1 change: 0 additions & 1 deletion src/pages/create/channel/import.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import React, {useState} from 'react'
import {Link} from 'react-router-dom'
import ChannelsLayout from 'layouts/channels'
import FirebaseAuth from 'components/firebase-ui/auth'
import ErrorDisplay from 'components/error-display'
import LoginRequired from 'components/login-required'
Expand Down
8 changes: 0 additions & 8 deletions src/pages/home.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,6 @@
import config from 'config'
import {Link} from 'react-router-dom'
import useChannels from 'hooks/use-channels'
// import Channels from 'components/channels'

const {RADIO4000_APP_NAME} = config

export default function PageHome({dbSession: {database, session, userChannel}}) {
// const { channels } = useChannels(database, 30)
// const channelsLastCreated = [...channels].slice(0)

if (userChannel)
return (
<div>
Expand Down

0 comments on commit 1ef401a

Please sign in to comment.