mirror of
https://github.com/cpvalente/ontime.git
synced 2026-08-11 02:13:48 +00:00
cleanup
- removing upload for now, should go somewhere else
This commit is contained in:
@@ -8,13 +8,12 @@ import EventListWrapper from './list/EventListWrapper';
|
||||
import { useDisclosure } from '@chakra-ui/hooks';
|
||||
import SettingsModal from '../modals/SettingsModal';
|
||||
import SettingsIconBtn from 'common/components/buttons/SettingsIconBtn';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { useEffect } from 'react';
|
||||
import DownloadIconBtn from 'common/components/buttons/DownloadIconBtn';
|
||||
import { downloadEvents, uploadEvents } from 'app/api/ontimeApi';
|
||||
import { downloadEvents } from 'app/api/ontimeApi';
|
||||
|
||||
export default function Editor() {
|
||||
const { isOpen, onOpen, onClose } = useDisclosure();
|
||||
const [file, setFile] = useState(null);
|
||||
|
||||
// Set window title
|
||||
useEffect(() => {
|
||||
@@ -25,19 +24,6 @@ export default function Editor() {
|
||||
downloadEvents();
|
||||
};
|
||||
|
||||
const handleFile = (e) => {
|
||||
setFile(e.target.files[0]);
|
||||
};
|
||||
|
||||
const handleUpload = (e) => {
|
||||
e.preventDefault();
|
||||
console.log('gonna upload', file);
|
||||
|
||||
if (file && file.type === 'application/json') {
|
||||
if (file.size < 1048576) uploadEvents(file);
|
||||
}
|
||||
};
|
||||
|
||||
return (
|
||||
<>
|
||||
<SettingsModal isOpen={isOpen} onClose={onClose} />
|
||||
@@ -81,19 +67,7 @@ export default function Editor() {
|
||||
Info
|
||||
</Heading>
|
||||
<NumberedText number={4} text={'Running Info'} />
|
||||
<div className={styles.content}>
|
||||
<form id='uploaddb' onSubmit={handleUpload}>
|
||||
<input
|
||||
type='file'
|
||||
name='jsondb'
|
||||
accept='.json'
|
||||
onChange={handleFile}
|
||||
/>
|
||||
<button className='submit-btn' type='submit'>
|
||||
Upload
|
||||
</button>
|
||||
</form>
|
||||
</div>
|
||||
<div className={styles.content}></div>
|
||||
</Box>
|
||||
|
||||
<Box className={styles.settings}>
|
||||
|
||||
Reference in New Issue
Block a user