diff --git a/TODO.md b/TODO.md index c4fca15aa..458a54ab9 100644 --- a/TODO.md +++ b/TODO.md @@ -20,6 +20,7 @@ Calendar ## Other +- [ ] Sort tags so that they are always in same order - [x] Maybe make bracket URL mandatory? - [ ] components render twice on state change? - [ ] If week has no events show some text + don't show time zone text diff --git a/app/components/Main.tsx b/app/components/Main.tsx index 76b6e5474..cfd6fa06d 100644 --- a/app/components/Main.tsx +++ b/app/components/Main.tsx @@ -4,9 +4,20 @@ import type * as React from "react"; export const Main = ({ children, className, + halfWidth, }: { children: React.ReactNode; className?: string; + halfWidth?: boolean; }) => ( -
{children}
+
+ {children} +
); diff --git a/app/routes/calendar/new.tsx b/app/routes/calendar/new.tsx index 3d595d6ac..b0a93c960 100644 --- a/app/routes/calendar/new.tsx +++ b/app/routes/calendar/new.tsx @@ -2,7 +2,7 @@ import { Form } from "@remix-run/react"; import { Label } from "~/components/Label"; import { Main } from "~/components/Main"; import * as React from "react"; -import type { CalendarEvent } from "~/db/types"; +import type { CalendarEvent, CalendarEventTag } from "~/db/types"; import { CALENDAR_EVENT_DESCRIPTION_MAX_LENGTH } from "~/constants"; import { Button } from "~/components/Button"; import type { LinksFunction } from "@remix-run/node"; @@ -13,21 +13,27 @@ import { TrashIcon } from "~/components/icons/Trash"; import { Input } from "~/components/Input"; import { FormMessage } from "~/components/FormMessage"; import { useIsMounted } from "~/hooks/useIsMounted"; +import allTags from "./tags.json"; +import { Tags } from "./components/Tags"; export const links: LinksFunction = () => { return [{ rel: "stylesheet", href: styles }]; }; +export const handle = { + i18n: "calendar", +}; + export default function CalendarNewEventPage() { return ( -
+
- {/* */} + {/* */}
@@ -172,3 +178,38 @@ function BracketUrlInput() { ); } + +function TagsAdder() { + const { t } = useTranslation("calendar"); + const [tags, setTags] = React.useState([]); + + const tagsForSelect = ( + Object.keys(allTags) as Array + ).filter((tag) => !tags.includes(tag)); + + return ( +
+
+ + + + "Badge prizes" tag is added automatically if applicable + +
+ +
+ ); +} diff --git a/app/styles/calendar-new.css b/app/styles/calendar-new.css index cf93241b6..f9ef16b15 100644 --- a/app/styles/calendar-new.css +++ b/app/styles/calendar-new.css @@ -7,3 +7,7 @@ grid-template-columns: max-content max-content 1fr; list-style: none; } + +.calendar-new__tags-select { + max-width: 10rem; +} diff --git a/app/styles/layout.css b/app/styles/layout.css index 6eb20217e..03cbde3a5 100644 --- a/app/styles/layout.css +++ b/app/styles/layout.css @@ -43,6 +43,10 @@ padding-inline: var(--s-3); } +.main.half-width { + max-width: 24rem; +} + .layout__main { padding-block-end: var(--s-32); }