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

View File

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

View File

@ -1,6 +1,6 @@
import React from 'react'
import ReactMarkdown from 'react-markdown'
import { Link, useLocation } from 'react-router-dom'
import { useLocation } from 'react-router-dom'
import './Main.css'
import './ThoughtsPage.css'
@ -11,13 +11,12 @@ import TopNavbar from './TopNavbar.js'
import getThoughts from '@wasp/queries/getThoughts'
import { useQuery } from '@wasp/queries'
const ThoughtsPage = (props) => {
const queryParams = new URLSearchParams(useLocation().search)
const tag = queryParams.get('tag')
// 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, ...
return (