diff --git a/components/ActionEventList.tsx b/components/ActionEventList.tsx index 6d79dfe..35827a8 100644 --- a/components/ActionEventList.tsx +++ b/components/ActionEventList.tsx @@ -1,4 +1,4 @@ -import classNames from "classnames"; +import { default as classNames } from "classnames"; import { useTranslation } from "next-i18next"; import { HTMLProps } from "react"; import { useMyEvents } from "../hooks/useMyEvents"; @@ -8,16 +8,16 @@ import { EventCreate } from "./EventCreate"; export function ActionEventList(props: HTMLProps) { - const {t} = useTranslation() + const { t } = useTranslation() const { data, error } = useMyEvents() const newClassName = classNames(props.className, { "negative": error, }) - + let contents: JSX.Element - if(error) { + if (error) { contents = <>

{t("eventListError")} @@ -27,16 +27,16 @@ export function ActionEventList(props: HTMLProps) { } - else if(!data) { - contents = + else if (!data) { + contents = } else { - if(data.length === 0) { + if (data.length === 0) { contents = <>

{t("eventListCreateFirst")}

- + } else { @@ -44,11 +44,11 @@ export function ActionEventList(props: HTMLProps) {

{t("eventListDescription")}

- +

{t("eventListCreateAnother")}

- + } } diff --git a/components/ActionLoginTelegram.tsx b/components/ActionLoginTelegram.tsx index cb23c48..3794ca2 100644 --- a/components/ActionLoginTelegram.tsx +++ b/components/ActionLoginTelegram.tsx @@ -1,5 +1,5 @@ -import {default as axios, AxiosError } from "axios" -import {default as classNames} from "classnames" +import { default as axios, AxiosError } from "axios" +import { default as classNames } from "classnames" import { useTranslation } from "next-i18next" import { HTMLProps, useCallback, useState } from "react" import { LoginContext } from "../contexts/login" @@ -9,8 +9,8 @@ import { useDefinedContext } from "../utils/definedContext" import { TelegramLoginButton } from "./TelegramLoginButton" -export function ActionLoginTelegram({className, ...props}: HTMLProps) { - const { t } = useTranslation("common") +export function ActionLoginTelegram({ className, ...props }: HTMLProps) { + const { t } = useTranslation("common") const [_, setLogin] = useDefinedContext(LoginContext) const [working, setWorking] = useState(false) const [error, setError] = useState(null) @@ -23,7 +23,7 @@ export function ActionLoginTelegram({className, ...props}: HTMLProps>("/api/login?provider=telegram", data) } - catch(e) { + catch (e) { const axe = e as AxiosError setError(axe?.response?.data as ApiError | undefined) return @@ -41,11 +41,11 @@ export function ActionLoginTelegram({className, ...props}: HTMLProps @@ -55,7 +55,7 @@ export function ActionLoginTelegram({className, ...props}: HTMLProps ) } - else if(working) { + else if (working) { message = t("formTelegramLoginWorking") contents = <> } @@ -68,7 +68,7 @@ export function ActionLoginTelegram({className, ...props}: HTMLProps ) } - + return (

diff --git a/components/Avatar.tsx b/components/Avatar.tsx index 8afe777..a9fc24f 100644 --- a/components/Avatar.tsx +++ b/components/Avatar.tsx @@ -1,5 +1,5 @@ -import Image, { ImageProps } from "next/image"; -import classNames from "classnames" +import { default as Image, ImageProps } from "next/image"; +import { default as classNames } from "classnames" export function Avatar(props: ImageProps) { return ( diff --git a/components/ErrorBlock.tsx b/components/ErrorBlock.tsx index 1efb693..ecabc67 100644 --- a/components/ErrorBlock.tsx +++ b/components/ErrorBlock.tsx @@ -11,7 +11,7 @@ export function ErrorBlock(props: ErrorBlockProps) { return (

- +   {props.text} diff --git a/components/ErrorInline.tsx b/components/ErrorInline.tsx index 4cead85..58f65ab 100644 --- a/components/ErrorInline.tsx +++ b/components/ErrorInline.tsx @@ -9,7 +9,7 @@ type ErrorInlineProps = { export function ErrorInline(props: ErrorInlineProps) { return ( - +   {props.text} diff --git a/components/EventCreate.tsx b/components/EventCreate.tsx index e1a711c..4c8ef5a 100644 --- a/components/EventCreate.tsx +++ b/components/EventCreate.tsx @@ -8,29 +8,29 @@ import { useEffect } from "react" import { ErrorBlock } from "./ErrorBlock" export function EventCreate() { - const {t} = useTranslation() + const { t } = useTranslation() const router = useRouter() const [name, setName] = useState("") const createEvent = useAxiosRequest({ method: "POST", url: "/api/events/", - data: {name} + data: { name } }) // This is a pretty bad hack... or not? // Idc, as long as it works useEffect(() => { - if(createEvent.error) return - if(!createEvent.data) return + if (createEvent.error) return + if (!createEvent.data) return router.push(`/event/${createEvent.data.slug}`) }) - if(createEvent.running) return + if (createEvent.running) return return <> -

{e.preventDefault(); createEvent.run()}} + onSubmit={e => { e.preventDefault(); createEvent.run() }} noValidate >
- {createEvent.error ? : null} + {createEvent.error ? : null} } \ No newline at end of file diff --git a/components/EventList.tsx b/components/EventList.tsx index 6486c59..60280a3 100644 --- a/components/EventList.tsx +++ b/components/EventList.tsx @@ -1,5 +1,5 @@ import { Event } from "@prisma/client" -import Link from "next/link" +import { default as Link } from "next/link" type EventListProps = { data: Event[] diff --git a/components/FestaIcon.tsx b/components/FestaIcon.tsx index 5f02e8f..9be10e4 100644 --- a/components/FestaIcon.tsx +++ b/components/FestaIcon.tsx @@ -1,5 +1,5 @@ import { FontAwesomeIcon, FontAwesomeIconProps } from "@fortawesome/react-fontawesome"; -import classNames from "classnames"; +import { default as classNames } from "classnames"; export function FestaIcon(props: FontAwesomeIconProps) { const newClassName = classNames(props.className, "icon") diff --git a/components/TelegramLoginButton.tsx b/components/TelegramLoginButton.tsx index 1ec9dfb..304f682 100644 --- a/components/TelegramLoginButton.tsx +++ b/components/TelegramLoginButton.tsx @@ -1,4 +1,3 @@ -import * as React from 'react'; import { default as OriginalTelegramLoginButton } from 'react-telegram-login'