updated config file with calendar ID

This commit is contained in:
Benjamin Jones 2021-05-26 12:59:12 +02:00
parent 2a7499fc0e
commit 0c3e5544d3
3 changed files with 11 additions and 5 deletions

View File

@ -12,6 +12,7 @@ import {
OpenIcon, OpenIcon,
} from './styles' } from './styles'
import { colours } from '../../assets/theme' import { colours } from '../../assets/theme'
import config from '../../data/config'
const Chat = ({ overlayActive }) => { const Chat = ({ overlayActive }) => {
const { width, height } = useWindowDimensions() const { width, height } = useWindowDimensions()
@ -26,7 +27,7 @@ const Chat = ({ overlayActive }) => {
<CloseBox colour={colours.white} size={18} onClick={toggleChatOpen} /> <CloseBox colour={colours.white} size={18} onClick={toggleChatOpen} />
</ChatHeader> </ChatHeader>
<iframe <iframe
src="https://titanembeds.com/embed/709318870909059082?css=215&defaultchannel=826751398757793842&lang=en_EN" src={`https://titanembeds.com/embed/${config.chat.guildId}?css=${config.chat.css}&defaultchannel=${config.chat.channelId}&lang=en_EN`}
height={(height / 4) * 3} height={(height / 4) * 3}
width="350" width="350"
frameBorder="0" frameBorder="0"

View File

@ -3,6 +3,10 @@ export default {
seriesTrailer: seriesTrailer:
'https://tv.undersco.re/videos/embed/5e29327c-41de-4b48-b567-ee28b181336f', 'https://tv.undersco.re/videos/embed/5e29327c-41de-4b48-b567-ee28b181336f',
calendar: calendarId: '9FzomgAfidHWCQcx',
'https://cloud.undersco.re/remote.php/dav/public-calendars/9FzomgAfidHWCQcx?export', chat: {
guildId: '709318870909059082',
channelId: '826751398757793842',
css: '215',
},
} }

View File

@ -10,7 +10,9 @@ export const useEventStream = () => {
async function fetchData() { async function fetchData() {
setLoading(true) setLoading(true)
const { data: responseData } = await axios.get(`${config.calendar}`) const { data: responseData } = await axios.get(
`https://cloud.undersco.re/remote.php/dav/public-calendars/${config.calendarId}/?export`
)
const jCalData = ICAL.parse(responseData) const jCalData = ICAL.parse(responseData)
const comp = new ICAL.Component(jCalData) const comp = new ICAL.Component(jCalData)
@ -26,7 +28,6 @@ export const useEventStream = () => {
) )
.map(vevent => { .map(vevent => {
const event = new ICAL.Event(vevent) const event = new ICAL.Event(vevent)
console.log('eventstat', vevent.getFirstPropertyValue('status'))
return event return event
}) })
.sort((a, b) => a.startDate.toJSDate() - b.startDate.toJSDate()) .sort((a, b) => a.startDate.toJSDate() - b.startDate.toJSDate())