diff --git a/components/ActionLoginTelegram.tsx b/components/ActionLoginTelegram.tsx index 3794ca2..734124e 100644 --- a/components/ActionLoginTelegram.tsx +++ b/components/ActionLoginTelegram.tsx @@ -2,7 +2,7 @@ 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" +import { LoginContext } from "./contexts/login" import { ApiError, ApiResult } from "../types/api" import { FestaLoginData, TelegramLoginData } from "../types/user" import { useDefinedContext } from "../utils/definedContext" diff --git a/components/LogoutLink.tsx b/components/LogoutLink.tsx index eb39009..78f5bde 100644 --- a/components/LogoutLink.tsx +++ b/components/LogoutLink.tsx @@ -1,5 +1,5 @@ import { useTranslation } from "next-i18next" -import { LoginContext } from "../contexts/login" +import { LoginContext } from "./contexts/login" import { useDefinedContext } from "../utils/definedContext" export function LogoutLink() { diff --git a/components/contexts/editing.tsx b/components/contexts/editing.tsx new file mode 100644 index 0000000..37ad180 --- /dev/null +++ b/components/contexts/editing.tsx @@ -0,0 +1,4 @@ +import { createStateContext } from "../../utils/stateContext"; + + +export const EditingContext = createStateContext() diff --git a/contexts/login.tsx b/components/contexts/login.tsx similarity index 77% rename from contexts/login.tsx rename to components/contexts/login.tsx index f8bfca5..2be2fe3 100644 --- a/contexts/login.tsx +++ b/components/contexts/login.tsx @@ -1,5 +1,5 @@ -import { FestaLoginData } from "../types/user"; -import { createStateContext } from "../utils/stateContext"; +import { FestaLoginData } from "../../types/user"; +import { createStateContext } from "../../utils/stateContext"; /** diff --git a/components/editable/EditableDateRange.tsx b/components/editable/EditableDateRange.tsx index 14deda5..eb253ec 100644 --- a/components/editable/EditableDateRange.tsx +++ b/components/editable/EditableDateRange.tsx @@ -1,6 +1,6 @@ import { faChevronRight, faClock } from "@fortawesome/free-solid-svg-icons" import { HTMLProps } from "react" -import { EditingContext } from "../../contexts/editing" +import { EditingContext } from "../contexts/editing" import { useDefinedContext } from "../../utils/definedContext" import { FestaIcon } from "../extensions/FestaIcon" import { FormDateRange } from "../form/FormDateRange" diff --git a/components/editable/EditableMarkdown.tsx b/components/editable/EditableMarkdown.tsx index fa4a535..c4d392d 100644 --- a/components/editable/EditableMarkdown.tsx +++ b/components/editable/EditableMarkdown.tsx @@ -1,5 +1,5 @@ import { HTMLProps } from "react"; -import { EditingContext } from "../../contexts/editing"; +import { EditingContext } from "../contexts/editing"; import { useDefinedContext } from "../../utils/definedContext"; import { FestaMarkdown } from "../extensions/FestaMarkdown"; diff --git a/components/editable/EditablePostcard.tsx b/components/editable/EditablePostcard.tsx index 13a0a1b..53fec07 100644 --- a/components/editable/EditablePostcard.tsx +++ b/components/editable/EditablePostcard.tsx @@ -1,5 +1,5 @@ import { HTMLProps } from "react"; -import { EditingContext } from "../../contexts/editing"; +import { EditingContext } from "../contexts/editing"; import { useDefinedContext } from "../../utils/definedContext"; import { Postcard } from "../postcard/Postcard"; diff --git a/components/editable/EditableText.tsx b/components/editable/EditableText.tsx index b2d1c30..c05f7d2 100644 --- a/components/editable/EditableText.tsx +++ b/components/editable/EditableText.tsx @@ -1,5 +1,5 @@ import { HTMLProps } from "react"; -import { EditingContext } from "../../contexts/editing"; +import { EditingContext } from "../contexts/editing"; import { useDefinedContext } from "../../utils/definedContext"; diff --git a/components/tools/ToolToggleEditing.tsx b/components/tools/ToolToggleEditing.tsx index 9da9e09..c84b349 100644 --- a/components/tools/ToolToggleEditing.tsx +++ b/components/tools/ToolToggleEditing.tsx @@ -1,6 +1,6 @@ import { faBinoculars, faPencil } from "@fortawesome/free-solid-svg-icons" import { useTranslation } from "next-i18next" -import { EditingContext } from "../../contexts/editing" +import { EditingContext } from "../contexts/editing" import { useDefinedContext } from "../../utils/definedContext" import { FestaIcon } from "../extensions/FestaIcon" diff --git a/contexts/editing.tsx b/contexts/editing.tsx deleted file mode 100644 index ccd1123..0000000 --- a/contexts/editing.tsx +++ /dev/null @@ -1,4 +0,0 @@ -import { createStateContext } from "../utils/stateContext"; - - -export const EditingContext = createStateContext() diff --git a/hooks/useAxios.ts b/hooks/useAxios.ts index 80e362b..70396d5 100644 --- a/hooks/useAxios.ts +++ b/hooks/useAxios.ts @@ -1,6 +1,6 @@ import { AxiosInstance, AxiosRequestConfig, default as axios } from "axios"; import { useContext, useMemo } from "react"; -import { LoginContext } from "../contexts/login"; +import { LoginContext } from "../components/contexts/login"; import { FestaLoginData } from "../types/user"; export function useAxios(config: AxiosRequestConfig = {}, data?: FestaLoginData | null): AxiosInstance { diff --git a/pages/_app.tsx b/pages/_app.tsx index 95a6515..fab0e78 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -1,6 +1,6 @@ import '../styles/globals.css' import type { AppProps } from 'next/app' -import { LoginContext } from '../contexts/login' +import { LoginContext } from '../components/contexts/login' import { useState } from 'react' import defaultPostcard from "../public/postcards/adi-goldstein-Hli3R6LKibo-unsplash.jpg" import { PostcardRenderer } from '../components/postcard/PostcardRenderer' diff --git a/pages/events/[slug].tsx b/pages/events/[slug].tsx index c1fb356..e21396c 100644 --- a/pages/events/[slug].tsx +++ b/pages/events/[slug].tsx @@ -8,7 +8,7 @@ import { ToolBar } from "../../components/tools/ToolBar"; import { EditableMarkdown } from "../../components/editable/EditableMarkdown"; import { EditableText } from "../../components/editable/EditableText"; import { ToolToggleEditing } from "../../components/tools/ToolToggleEditing"; -import { EditingContext } from "../../contexts/editing"; +import { EditingContext } from "../../components/contexts/editing"; import { database } from "../../utils/prismaClient"; import { EditablePostcard } from "../../components/editable/EditablePostcard"; import { ViewEvent } from "../../components/view/ViewEvent"; diff --git a/pages/index.tsx b/pages/index.tsx index 41f1e1f..9730bcc 100644 --- a/pages/index.tsx +++ b/pages/index.tsx @@ -1,7 +1,7 @@ import { NextPageContext } from 'next' import { useTranslation } from 'next-i18next' import { serverSideTranslations } from 'next-i18next/serverSideTranslations' -import { LoginContext } from '../contexts/login' +import { LoginContext } from '../components/contexts/login' import { useDefinedContext } from '../utils/definedContext' import { ActionLoginTelegram } from '../components/ActionLoginTelegram' import { ActionEventList } from '../components/ActionEventList'