From 52addc77031230f2a2853758d06abcdb3b4813dd Mon Sep 17 00:00:00 2001 From: Kent Brockman Date: Sun, 10 Jul 2022 09:02:22 -0600 Subject: [PATCH] convert invite buttons on class page to dropdown --- webclient/src/Classes.js | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) diff --git a/webclient/src/Classes.js b/webclient/src/Classes.js index d38b0ba..7ecafc7 100644 --- a/webclient/src/Classes.js +++ b/webclient/src/Classes.js @@ -450,8 +450,40 @@ export function ICalButtons(props) { }); }; + const addToGoogleCalendar = (e) => { + e.preventDefault(); + // TODO: fill in URL from clazz properties + window.location = 'https://www.google.com/calendar/render?action=TEMPLATE&text=Title&dates=20190227/20190228' + }; + + const options = [ + { key: 'email', icon: 'mail outline', text: 'Email ICS Event', value: 'email' }, + { key: 'download', icon: 'download', text: 'Download ICS Event', value: 'download' }, + { key: 'google', icon: 'google', text: 'Add to Google Calendar', value: 'google' }, + ]; + + let selectedOption = options[0]; + + const onClick = (e, data) => { + selectedOption = options.filter(x => x.value === data.value)[0]; + console.log(selectedOption); + // TODO set state here + // setState({selectedOption: selectedOption}); + // TODO: change the Button onClick handler...based on selected option? + }; + return ( - <> + + + } + /> + + /*<> @@ -463,7 +495,7 @@ export function ICalButtons(props) { } {error && Error.} - + */ ); };