remove unused
cleanup styles
simplify post code
commentz
This commit is contained in:
cv
2021-10-27 22:54:50 +02:00
parent 0a5fa12c21
commit 1afdd67760
6 changed files with 20 additions and 13 deletions
+1 -2
View File
@@ -1,10 +1,9 @@
import { useEffect } from 'react';
import { useState, useEffect } from 'react';
import { useSocket } from 'app/context/socketContext';
import style from './Info.module.css';
import InfoTitle from './InfoTitle';
import InfoLogger from './InfoLogger';
import InfoNif from './InfoNif';
import { useState } from 'react';
export default function Info() {
const socket = useSocket();
+1 -2
View File
@@ -11,8 +11,7 @@ export default function InfoNif() {
placeholderData: ontimePlaceholderInfo,
});
const [collapsed, setCollapsed] = useState(false);
const baseURL = `http://__IP__:${4001}`;
const baseURL = 'http://__IP__:4001';
const handleLink = (url) => {
if (window.process?.type === 'renderer') {
@@ -13,7 +13,7 @@ import { EVENT_TABLE } from 'app/api/apiConstants';
import style from './Modals.module.css';
export default function SettingsModal() {
const { data, status, isError } = useFetch(EVENT_TABLE, fetchEvent);
const { data, status } = useFetch(EVENT_TABLE, fetchEvent);
const [formData, setFormData] = useState({
title: '',
url: '',
@@ -36,13 +36,11 @@ export default function SettingsModal() {
});
}, [data]);
console.log(`formData.endMessage`, formData.endMessage);
const submitHandler = async (event) => {
event.preventDefault();
setSubmitting(true);
await postEvent(formData).then(setSubmitting(false));
await postEvent(formData);
setChanged(false);
setSubmitting(false);
@@ -71,7 +69,6 @@ export default function SettingsModal() {
value={formData.title}
onChange={(event) => {
setChanged(true);
setFormData({ ...formData, title: event.target.value });
}}
isDisabled={submitting}
+1 -1
View File
@@ -50,5 +50,5 @@ export default function ModalManager(props) {
ModalManager.propTypes = {
isOpen: PropTypes.bool.isRequired,
onClose: PropTypes.bool.isRequired,
onClose: PropTypes.func.isRequired,
};
+5 -2
View File
@@ -6,6 +6,10 @@
margin-top: 0.5em;
}
.modalBody > button {
margin-top: 1em;
}
.notes {
font-weight: 400;
color: #2b6cb0;
@@ -26,8 +30,7 @@ span.notes {
.modalInline {
display: flex;
justify-content: space-between;
gap: 1em;
gap: 2em;
}
.highNotes {
+10 -1
View File
@@ -145,7 +145,13 @@ const server = http.createServer(app);
export const startServer = async (overrideConfig = null) => {
// Setup default port
const port = overrideConfig?.port || serverPort;
// const port = overrideConfig?.port || serverPort;
/* Note: Port is hardcoded
* need to find a good solution for sharing
* the dynamic info with the frontend
*/
const port = 4001;
// Start server
const returnMessage = `HTTP Server is listening on port ${port}`;
@@ -165,9 +171,12 @@ export const shutdown = async () => {
// shutdown express server
server.close();
// shutdown OSC Server
shutdownOSCServer();
// shutdown OSC Client
oscClient.close();
// shutdown timer
global.timer.shutdown();