feat: add (non-working) edit page

This commit is contained in:
Sam 2022-05-14 16:46:03 +02:00
parent 15797b679c
commit ca2cf9e06f
9 changed files with 140 additions and 11 deletions

View file

@ -1,11 +1,15 @@
import React, { PropsWithChildren } from "react";
export type Props = PropsWithChildren<{ title: string }>;
export type Props = PropsWithChildren<{ title: string; draggable?: boolean }>;
export default function Card({ title, children }: Props) {
export default function Card({ title, draggable, children }: Props) {
return (
<div className="bg-slate-100 dark:bg-slate-700 rounded-md shadow">
<h1 className="text-2xl p-2 border-b border-zinc-200 dark:border-slate-800">
<h1
className={`text-2xl p-2 border-b border-zinc-200 dark:border-slate-800${
draggable && " handle hover:cursor-grab"
}`}
>
{title}
</h1>
<div className="flex flex-col p-2">{children}</div>

View file

@ -9,9 +9,15 @@ import {
import Card from "./Card";
import type { Field } from "./types";
export default function FieldCard({ field }: { field: Field }) {
export default function FieldCard({
field,
draggable,
}: {
field: Field;
draggable?: boolean;
}) {
return (
<Card title={field.name}>
<Card title={field.name} draggable={draggable}>
{field.favourite.map((entry) => (
<p className="text-lg font-bold">
<HeartFill className="inline" /> {entry}