From f3ad73dae1ea4ef050f579e522339406b4cdb445 Mon Sep 17 00:00:00 2001 From: 0-ft <0ft@pm.me> Date: Wed, 18 May 2022 16:55:55 +0100 Subject: [PATCH] Update event editing modal --- src/EditModal.css | 51 +++++++ src/components/EditEvent.tsx | 285 ++++++++++++++++++++--------------- src/view.ts | 1 + 3 files changed, 215 insertions(+), 122 deletions(-) create mode 100644 src/EditModal.css diff --git a/src/EditModal.css b/src/EditModal.css new file mode 100644 index 0000000..b84aab0 --- /dev/null +++ b/src/EditModal.css @@ -0,0 +1,51 @@ +.ofc-edit-modal-content { + display: grid; + gap: 1em; + grid-template-columns: 1fr 1fr; +} + +.ofc-edit-modal-column { + display: flex; + flex-direction: column; +} + +.ofc-edit-modal-event-save-button { + margin: 0; +} + +.ofc-edit-modal-content label { + color: var(--text-muted); + font-size: 14px; +} + +.ofc-edit-modal-content input[type="date"], +.ofc-edit-modal-content input[type="time"], +.ofc-edit-modal-content select { + background: var(--background-modifier-form-field); + border: 1px solid var(--background-modifier-border); + color: var(--text-normal); + font-family: inherit; + padding: 5px 14px; + font-size: 16px; + border-radius: 4px; + outline: none; + height: 30px; +} + +.ofc-edit-modal-buttons, +.ofc-edit-modal-checkbox { + display: flex; +} + +.ofc-edit-modal-event-delete-button { + background-color: var(--background-secondary); + color: var(--background-modifier-error); + border-color: var(--background-modifier-error); + border-width: 1px; + border-style: solid; + margin-right: auto; +} + +.not-visible { + display: none; +} \ No newline at end of file diff --git a/src/components/EditEvent.tsx b/src/components/EditEvent.tsx index c333c0d..fa8df1c 100644 --- a/src/components/EditEvent.tsx +++ b/src/components/EditEvent.tsx @@ -1,4 +1,3 @@ -import { DropdownComponent } from "obsidian"; import * as React from "react"; import { useEffect, useRef, useState } from "react"; import { @@ -57,26 +56,31 @@ const DAY_MAP = { const DaySelect = ({ value: days, onChange, + label: selectLabel, }: { value: string[]; onChange: (days: string[]) => void; + label: string; }) => { return ( -
- {open && } -
-