From d7cab69cfc98608cf08fc1f95d1815328e92e78c Mon Sep 17 00:00:00 2001 From: Supertiger Date: Sat, 25 Nov 2023 20:02:29 +0000 Subject: [PATCH] Update ticket item design --- src/components/settings/TicketSettings.tsx | 231 ++++++++++++++------- 1 file changed, 156 insertions(+), 75 deletions(-) diff --git a/src/components/settings/TicketSettings.tsx b/src/components/settings/TicketSettings.tsx index 8aa03652..b5c7dae1 100644 --- a/src/components/settings/TicketSettings.tsx +++ b/src/components/settings/TicketSettings.tsx @@ -1,4 +1,12 @@ -import { Accessor, createEffect, createSignal, For, onMount, Setter, Show } from "solid-js"; +import { + Accessor, + createEffect, + createSignal, + For, + onMount, + Setter, + Show, +} from "solid-js"; import Text from "@/components/ui/Text"; import { css, styled } from "solid-styled-components"; import { @@ -20,7 +28,12 @@ import { Emoji } from "../markup/Emoji"; import { CustomLink } from "../ui/CustomLink"; import Breadcrumb, { BreadcrumbItem } from "../ui/Breadcrumb"; import { t } from "i18next"; -import { RawMessage, RawTicket, TicketStatus } from "@/chat-api/RawData"; +import { + RawMessage, + RawTicket, + TicketCategory, + TicketStatus, +} from "@/chat-api/RawData"; import { getTicket, getTickets } from "@/chat-api/services/TicketService.ts"; import { formatTimestamp } from "@/common/date"; import { useWindowProperties } from "@/common/useWindowProperties"; @@ -82,15 +95,23 @@ const TicketPage = () => { - + - + ); }; -const MessageInputArea = (props: { channelId: string, messages: RawMessage[], setMessages: Setter }) => { +const MessageInputArea = (props: { + channelId: string; + messages: RawMessage[]; + setMessages: Setter; +}) => { const [value, setValue] = createSignal(""); const sendClick = async () => { @@ -99,28 +120,59 @@ const MessageInputArea = (props: { channelId: string, messages: RawMessage[], se if (!formattedValue) return; const message = await postMessage({ content: formattedValue, - channelId: props.channelId - }).catch(err => { + channelId: props.channelId, + }).catch((err) => { alert(err.message); setValue(formattedValue); - }) + }); if (!message) return; props.setMessages([...props.messages, message]); - - } + }; return ( - - -