Clean up lint errors in Thoughts

Removed unused imports, variables and functions from Thoughts source files
This commit is contained in:
Michael Curry 2021-05-30 15:09:30 +01:00 committed by Martin Šošić
parent 2d54d005e5
commit 2c417ee188
3 changed files with 3 additions and 9 deletions

View File

@ -9,7 +9,6 @@ import TopNavbar from './TopNavbar.js'
import { getTagColor } from './tag.js' import { getTagColor } from './tag.js'
import createThought from '@wasp/actions/createThought' import createThought from '@wasp/actions/createThought'
import { useQuery } from '@wasp/queries'
// TODO: // TODO:
// - Rename this file to Thought.js. // - Rename this file to Thought.js.
@ -62,10 +61,6 @@ const Thought = (props) => {
setInPreviewMode(defaultInPreviewMode) setInPreviewMode(defaultInPreviewMode)
} }
const togglePreviewMode = () => {
setInPreviewMode(!inPreviewMode)
}
const setNewTagNameIfValid = (tagName) => { const setNewTagNameIfValid = (tagName) => {
if (!tagName || /^[a-z](\.?[a-z0-9])*\.?$/.test(tagName)) { if (!tagName || /^[a-z](\.?[a-z0-9])*\.?$/.test(tagName)) {
setNewTagName(tagName) setNewTagName(tagName)

View File

@ -9,7 +9,7 @@ import { useQuery } from '@wasp/queries'
// Props: active TODO: document this properly. // Props: active TODO: document this properly.
const TagsSidebar = (props) => { const TagsSidebar = (props) => {
const { data: tags, isFetching, error } = useQuery(getTags) const { data: tags } = useQuery(getTags)
return ( return (
<div className="tags-sidebar"> <div className="tags-sidebar">

View File

@ -1,6 +1,6 @@
import React from 'react' import React from 'react'
import ReactMarkdown from 'react-markdown' import ReactMarkdown from 'react-markdown'
import { Link, useLocation } from 'react-router-dom' import { useLocation } from 'react-router-dom'
import './Main.css' import './Main.css'
import './ThoughtsPage.css' import './ThoughtsPage.css'
@ -11,13 +11,12 @@ import TopNavbar from './TopNavbar.js'
import getThoughts from '@wasp/queries/getThoughts' import getThoughts from '@wasp/queries/getThoughts'
import { useQuery } from '@wasp/queries' import { useQuery } from '@wasp/queries'
const ThoughtsPage = (props) => { const ThoughtsPage = (props) => {
const queryParams = new URLSearchParams(useLocation().search) const queryParams = new URLSearchParams(useLocation().search)
const tag = queryParams.get('tag') const tag = queryParams.get('tag')
// TODO: Handle possible errors and fetching. // TODO: Handle possible errors and fetching.
const { data: thoughts, isFetching, error } = useQuery(getThoughts, { tagName: tag }) const { data: thoughts } = useQuery(getThoughts, { tagName: tag })
// TODO: Duplication! layout, navbar, sidebar, ... // TODO: Duplication! layout, navbar, sidebar, ...
return ( return (