diff --git a/src/app/sampleData.js b/src/app/sampleData.js index 427fc2ddc..b36146aa6 100644 --- a/src/app/sampleData.js +++ b/src/app/sampleData.js @@ -1,16 +1,36 @@ const dummy = new Date(); export const sampleData = { - id: '1', - title: 'Is the internet a fad?', - subtitle: 'Carlos Valente', - timeStart: '10:00', - timeEnd: '11:30', - clockStarted: dummy, - timerDuration: 10, - message: { - text: 'Hurry Up!', - color: '#F00', - active: false, - }, + events: [ + { + id: '1', + title: 'Is the internet a fad?', + subtitle: 'It is', + presenter: 'Carlos Valente', + timeStart: '10:00', + timeEnd: '11:30', + clockStarted: dummy, + timerDuration: 10, + message: { + text: 'Hurry Up!', + color: '#F00', + active: false, + }, + }, + { + id: '2', + title: 'Is reddit a dictatorship?', + subtitle: 'It is', + presenter: 'Carlos Valente', + timeStart: '11:40', + timeEnd: '13:00', + clockStarted: dummy, + timerDuration: 10, + message: { + text: 'Hurry Up!', + color: '#F00', + active: false, + }, + }, + ], }; diff --git a/src/features/editors/Editor.jsx b/src/features/editors/Editor.jsx index bcf39724d..4eb178f82 100644 --- a/src/features/editors/Editor.jsx +++ b/src/features/editors/Editor.jsx @@ -1,7 +1,8 @@ -import { Flex, Text } from '@chakra-ui/layout'; +import { Button } from '@chakra-ui/button'; import { Heading } from '@chakra-ui/layout'; import { SimpleGrid } from '@chakra-ui/layout'; import { Box } from '@chakra-ui/layout'; +import { useState } from 'react'; import NumberedText from '../../common/components/text/NumberedText'; import EventForm from '../form/EventForm'; import PreviewContainer from '../viewers/PreviewContainer'; @@ -9,6 +10,8 @@ import styles from './Editor.module.css'; import EventList from './list/EventList'; export default function Editor() { + const [selectedEvent, setSelectedEvent] = useState(null); + return ( List Events
- + +
+ +
diff --git a/src/features/editors/Editor.module.css b/src/features/editors/Editor.module.css index bb8e8a16b..faab89d18 100644 --- a/src/features/editors/Editor.module.css +++ b/src/features/editors/Editor.module.css @@ -6,8 +6,8 @@ .editor { height: 100%; - margin-top: 1em; - background-color: white; + margin-top: 2.5vh; + background-color: #fcfcfa; padding: 2em; display: flex; @@ -16,4 +16,4 @@ .content { padding-top: 2em; -} +} \ No newline at end of file diff --git a/src/features/editors/list/EventList.jsx b/src/features/editors/list/EventList.jsx index f3be5cc9f..3c491d1a4 100644 --- a/src/features/editors/list/EventList.jsx +++ b/src/features/editors/list/EventList.jsx @@ -1,56 +1,32 @@ -import { - Table, - Thead, - Tbody, - Tr, - Th, - Td, - TableCaption, - Button, -} from '@chakra-ui/react'; +import { Table, Thead, Tbody, Tr, Th } from '@chakra-ui/react'; +import { useState } from 'react'; +import { sampleData } from '../../../app/sampleData'; +import EventListItem from './EventListItem'; + +export default function EventList(props) { + const [data, setData] = useState(sampleData); -export default function EventList() { return ( -
- - Todays event list - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Event TitleEvent SubtitlePresenter NameTime StartTime EndTimer
TitleSubtitlePresenter10:0011:0060.00 - -
TitleSubtitlePresenter10:0011:0060.00 - -
-
+ + + + + + + + + + + + {data.events.map((e) => ( + + ))} + +
Event TitlePresenter NameTime StartTime End
); } diff --git a/src/features/editors/list/EventListItem.jsx b/src/features/editors/list/EventListItem.jsx new file mode 100644 index 000000000..bf208e9e4 --- /dev/null +++ b/src/features/editors/list/EventListItem.jsx @@ -0,0 +1,27 @@ +import { Button } from '@chakra-ui/button'; +import { Td, Tr } from '@chakra-ui/table'; + +export default function EventListItem(props) { + return ( + + {props.data.title} + {props.data.presenter} + {props.data.timeStart} + {props.data.timeEnd} + + + + + ); +}