From 088c3c4e2729c5bdbeb21eaf7feff59dbba09e06 Mon Sep 17 00:00:00 2001 From: evlist Date: Mon, 16 Jan 2023 22:55:08 +0100 Subject: [PATCH] WPT editor --- src/components/wpt/WptEditor.tsx | 40 +++++++++++++++++++++++--------- 1 file changed, 29 insertions(+), 11 deletions(-) diff --git a/src/components/wpt/WptEditor.tsx b/src/components/wpt/WptEditor.tsx index ce5cd5f..197a6c2 100644 --- a/src/components/wpt/WptEditor.tsx +++ b/src/components/wpt/WptEditor.tsx @@ -1,18 +1,12 @@ import { useI18n } from '@solid-primitives/i18n'; -import { - Dialog, - Box, - TextField, - Stack, - Button, - IconButton, -} from '@suid/material'; +import { Box, TextField, Stack, Button, IconButton } from '@suid/material'; import { cloneDeep } from 'lodash'; import { Component, createSignal } from 'solid-js'; import { emptyWpt } from '../../db/wpt'; import { peekCachedSignal } from '../../workers/cached-signals'; import dispatch from '../../workers/dispatcher-main'; import EditIcon from '@suid/icons-material/Edit'; +import Dialog from '../dialog'; enum Mode { CLOSED, @@ -37,6 +31,11 @@ const WptEditor: Component = ({ wptId }) => { const edit = () => { setMode(Mode.EDIT); setEditedWpt(cloneDeep(wpt())); + console.log({ + caller: 'WptEditor / edit', + wptId, + editedWpt: editedWpt(), + }); }; const closeHandler = () => { @@ -45,7 +44,7 @@ const WptEditor: Component = ({ wptId }) => { const saveHandler = () => { console.log({ - caller: 'Wpt / saveHandler', + caller: 'WptEditor / saveHandler', wptId, editedWpt: editedWpt(), }); @@ -66,11 +65,20 @@ const WptEditor: Component = ({ wptId }) => { - +
= ({ wptId }) => { setEditedWpt({ ...editedWpt(), extensions }); }} /> + { + setEditedWpt({ ...editedWpt(), desc: event.target.value }); + }} + InputProps={{ inputComponent: 'textarea' }} + />