From 42b7ef1b2c9335c9899d11179b590e7ff096f93d Mon Sep 17 00:00:00 2001 From: Avior Date: Sun, 5 Jan 2020 00:56:27 +0100 Subject: [PATCH] Fixed lint errors :D Signed-off-by: Avior --- components/Element.tsx | 14 +++---- components/Filters.tsx | 73 ++++++++++++++++---------------- components/Footer.tsx | 15 ++----- components/Header.tsx | 11 ++--- components/Layout.tsx | 15 ++++--- components/Menu.tsx | 13 ++---- components/Navbar.tsx | 49 +++++++++++----------- components/Post.ts | 35 ++++++++-------- components/default.tsx | 4 +- config.ts | 21 +++++----- pages/[category]/[slug].tsx | 50 +++++++++++++--------- pages/_app.tsx | 9 ++-- pages/_document.tsx | 11 ++--- pages/_error.tsx | 13 +++--- pages/index.tsx | 84 +++++++++++++++++++------------------ pages/tag/[tag].tsx | 42 ++++++++++++------- 16 files changed, 230 insertions(+), 229 deletions(-) diff --git a/components/Element.tsx b/components/Element.tsx index 7e85c6d..1fe55f3 100644 --- a/components/Element.tsx +++ b/components/Element.tsx @@ -1,7 +1,6 @@ -import React from 'react' import Link from 'next/link' +import React from 'react' import { ChevronRight } from 'react-feather' -import next from 'next' interface Props { title: string @@ -12,7 +11,7 @@ interface Props { } const months = [ - "le 13eme mois", + 'le 13eme mois', 'Janvier', 'Février', 'Mars', @@ -24,16 +23,13 @@ const months = [ 'Septembre', 'Octobre', 'Novembre', - 'Décembre' + 'Décembre', ] export default class Element extends React.Component { - constructor(props: Props) { - super(props) - } - render() { + public render() { let date = this.props.date - if (typeof this.props.date === "string") { + if (typeof this.props.date === 'string') { date = new Date(this.props.date) } const t = `${date.getDate()} ${months[date.getMonth()]} ${date.getFullYear()}` diff --git a/components/Filters.tsx b/components/Filters.tsx index 945a884..db6de77 100644 --- a/components/Filters.tsx +++ b/components/Filters.tsx @@ -1,11 +1,12 @@ -import React from 'react' import Link from 'next/link' -import '../styl/styl.styl' -import { ChevronRight, ChevronDown } from 'react-feather' +import React from 'react' +import { ChevronDown, ChevronRight } from 'react-feather' + import config from '../config' +import '../styl/styl.styl' interface Props { - categories?: string[] + categories?: Array onQuery?: (query: string, sort?: boolean) => void onHeight?: (height: number) => void } @@ -17,40 +18,9 @@ interface States { export default class Filters extends React.Component { - private aside = undefined private input = undefined - constructor(props: Props) { - super(props) - } - - setInput = element => { - this.input = element - } - - onKeyDown = (ev: React.KeyboardEvent) => { - setTimeout(() => { - this.submit() - }, 1); - } - - onClick = () => { - if (this.input.value !== "") { - this.submit() - return - } - this.input.focus() - } - - onChange = (ev) => { - this.submit(ev.target.value === "true") - } - - submit = (sort?: boolean) => { - if (this.props.onQuery) this.props.onQuery(this.input.value, sort) - } - - render() { + public render() { return (