refractor + style tweaks

- bugfix on lower
- delay between 0-60 minutes
- action buttons in dropdown
- added button for toggling element visibility
- several css and code cleanups
- renamed settingsAPI
This commit is contained in:
cv
2021-04-24 10:32:19 +02:00
parent 11fca1ab6d
commit ea92fc7de7
44 changed files with 835 additions and 572 deletions
+10 -10
View File
@@ -15,15 +15,15 @@ import {
Textarea,
} from '@chakra-ui/react';
import {
fetchSettings,
postSettings,
settingsNamespace,
} from '../../app/api/settingsApi';
fetchEvent,
postEvent,
eventNamespace,
} from '../../app/api/eventApi';
import { useQuery } from 'react-query';
import { useEffect, useState } from 'react';
export default function SettingsModal(props) {
const { data, status, isError } = useQuery(settingsNamespace, fetchSettings);
const { data, status, isError } = useQuery(eventNamespace, fetchEvent);
const [formData, setFormData] = useState({
title: '',
url: '',
@@ -48,7 +48,7 @@ export default function SettingsModal(props) {
event.preventDefault();
setSubmitting(true);
await postSettings(formData).then(setSubmitting(false)).then(onClose);
await postEvent(formData).then(setSubmitting(false)).then(onClose);
};
return (
@@ -77,7 +77,7 @@ export default function SettingsModal(props) {
size='sm'
name='title'
placeholder='Event Title'
autocomplete='off'
autoComplete='off'
value={formData.title}
onChange={(event) =>
setFormData({ ...formData, title: event.target.value })
@@ -97,7 +97,7 @@ export default function SettingsModal(props) {
size='sm'
name='url'
placeholder='www.onsite.no'
autocomplete='off'
autoComplete='off'
value={formData.url}
onChange={(event) =>
setFormData({ ...formData, url: event.target.value })
@@ -117,7 +117,7 @@ export default function SettingsModal(props) {
size='sm'
name='pubInfo'
placeholder='Information to be shown on public screens'
autocomplete='off'
autoComplete='off'
value={formData.publicInfo}
onChange={(event) =>
setFormData({
@@ -140,7 +140,7 @@ export default function SettingsModal(props) {
size='sm'
name='backstageInfo'
placeholder='Information to be shown on backstage screens'
autocomplete='off'
autoComplete='off'
value={formData.backstageInfo}
onChange={(event) =>
setFormData({