diff --git a/components/ActionEventList.tsx b/components/ActionEventList.tsx index be47f66..cc9720d 100644 --- a/components/ActionEventList.tsx +++ b/components/ActionEventList.tsx @@ -3,7 +3,7 @@ import { useTranslation } from "next-i18next"; import { HTMLProps } from "react"; import { useMyEventsSWR } from "../hooks/swr/useMyEventsSWR"; import { Loading } from "./Loading"; -import { EventList } from "./EventList"; +import { ListEvents } from "./ListEvents"; import { EventCreate } from "./EventCreate"; @@ -44,7 +44,7 @@ export function ActionEventList(props: HTMLProps) {

{t("eventListDescription")}

- +

{t("eventListCreateAnother")}

diff --git a/components/EventCreate.tsx b/components/EventCreate.tsx index 8945c50..de63264 100644 --- a/components/EventCreate.tsx +++ b/components/EventCreate.tsx @@ -5,7 +5,7 @@ import { useState } from "react" import { useAxiosRequest } from "../hooks/useAxiosRequest" import { Loading } from "./Loading" import { useEffect } from "react" -import { ErrorBlock } from "./ErrorBlock" +import { ErrorBlock } from "./errors/ErrorBlock" export function EventCreate() { const { t } = useTranslation() diff --git a/components/EventList.tsx b/components/ListEvents.tsx similarity index 81% rename from components/EventList.tsx rename to components/ListEvents.tsx index 60280a3..080a225 100644 --- a/components/EventList.tsx +++ b/components/ListEvents.tsx @@ -1,11 +1,11 @@ import { Event } from "@prisma/client" import { default as Link } from "next/link" -type EventListProps = { +type ListEventsProps = { data: Event[] } -export function EventList(props: EventListProps) { +export function ListEvents(props: ListEventsProps) { const contents = props.data.map(e => (
  • diff --git a/components/Loading.tsx b/components/Loading.tsx index 4b8e492..48be918 100644 --- a/components/Loading.tsx +++ b/components/Loading.tsx @@ -1,5 +1,5 @@ import { faAsterisk } from "@fortawesome/free-solid-svg-icons"; -import { FestaIcon } from "./FestaIcon"; +import { FestaIcon } from "./extensions/FestaIcon"; type LoadingProps = { text: string diff --git a/components/Postcard.tsx b/components/Postcard.tsx deleted file mode 100644 index fa35be2..0000000 --- a/components/Postcard.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import { PostcardContext } from "../contexts/postcard"; -import { useDefinedContext } from "../utils/definedContext"; - -export function Postcard() { - const [postcard, _] = useDefinedContext(PostcardContext) - - const postcardUrl = typeof postcard === "string" ? postcard : postcard.src - - /* eslint-disable @next/next/no-img-element */ - return <> -
    - -} \ No newline at end of file diff --git a/components/editable/EditableMarkdown.tsx b/components/editable/EditableMarkdown.tsx new file mode 100644 index 0000000..fa4a535 --- /dev/null +++ b/components/editable/EditableMarkdown.tsx @@ -0,0 +1,15 @@ +import { HTMLProps } from "react"; +import { EditingContext } from "../../contexts/editing"; +import { useDefinedContext } from "../../utils/definedContext"; +import { FestaMarkdown } from "../extensions/FestaMarkdown"; + + +export function EditableMarkdown({value, ...props}: HTMLProps) { + const [editing,] = useDefinedContext(EditingContext) + + return editing ? ( +