From 2b5de793b4951d56842d565a54ea14ae20d33cb5 Mon Sep 17 00:00:00 2001 From: Alexander Biraben-Renard Date: Tue, 1 Oct 2024 16:54:21 +0100 Subject: [PATCH 1/2] feat: add "accept" field to form file input elements --- components/EditCompany.tsx | 12 +++++------- components/EditStudent.tsx | 11 ++++++++--- components/FileInput.tsx | 23 ++++++++++++++++++++++- components/UpsertEvent.tsx | 2 +- lib/constants.ts | 4 ++++ lib/files/saveFile.ts | 16 +++++++--------- 6 files changed, 47 insertions(+), 21 deletions(-) diff --git a/components/EditCompany.tsx b/components/EditCompany.tsx index 9fa495d7..083387b8 100644 --- a/components/EditCompany.tsx +++ b/components/EditCompany.tsx @@ -2,7 +2,7 @@ import { SLUG_START, slugComputer } from "@/app/companies/slug" import { updateCompany } from "@/lib/crud/companies" -import { ServerSideFormHandler } from "@/lib/types" +import { FileCategory, ServerSideFormHandler } from "@/lib/types" import FileInput from "./FileInput" import { FormInModal } from "./forms/FormInModal" @@ -10,10 +10,8 @@ import { GenericFormModal } from "./modals/GenericFormModal" import { MDXEditorMethods } from "@mdxeditor/editor" import { CompanyProfile } from "@prisma/client" -import { InfoCircledIcon } from "@radix-ui/react-icons" -import { Pencil1Icon } from "@radix-ui/react-icons" -import { Tooltip } from "@radix-ui/themes" -import { Card, Flex, IconButton, Text, TextField } from "@radix-ui/themes" +import { InfoCircledIcon, Pencil1Icon } from "@radix-ui/react-icons" +import { Card, Flex, IconButton, Text, TextField, Tooltip } from "@radix-ui/themes" import dynamic from "next/dynamic" import React, { useRef, useState } from "react" @@ -70,9 +68,9 @@ const EditCompanyForm = ({ close, prevCompanyProfile }: { close: () => void; pre - + - + - - + + - +