-
Notifications
You must be signed in to change notification settings - Fork 40
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,17 @@ | ||
import { useState, useEffect } from 'react'; | ||
import { Badge, Button, Col, Container, Row } from 'react-bootstrap'; | ||
import { | ||
Badge, | ||
Button, | ||
Col, | ||
Container, | ||
Row, | ||
Dropdown, | ||
ButtonGroup, | ||
} from 'react-bootstrap'; | ||
import { GoLocation } from 'react-icons/go'; | ||
import styles from '../styles/index.module.css'; | ||
import { atcb_action } from 'add-to-calendar-button'; | ||
import { BiCalendarPlus } from 'react-icons/bi'; | ||
|
||
function EventStrip({ | ||
event, | ||
|
@@ -15,6 +25,7 @@ function EventStrip({ | |
const [timezone, setTimezone] = useState(''); | ||
const [startDate, setStartDate] = useState(event.attributes['starts-at']); | ||
const [endDate, setEndDate] = useState(event.attributes['ends-at']); | ||
const [config, setConfig] = useState({}); | ||
|
||
useEffect(() => { | ||
// Fetch the timezone from the user's browser | ||
|
@@ -35,6 +46,28 @@ function EventStrip({ | |
|
||
setStartDate(`${new Date(start).toLocaleTimeString('en-US', options)}`); | ||
setEndDate(`${new Date(end).toLocaleTimeString('en-US', options)}`); | ||
|
||
const config = { | ||
name: event?.attributes['name'], | ||
description: event?.attributes['description'], | ||
startDate: '2024-03-25', | ||
startTime: '11:00', | ||
endTime: '14:30', | ||
organizer: 'Rocket.Chat|[email protected]', | ||
location: 'https://meet.google.com/dbt-czaj-whr', | ||
options: [ | ||
'Apple', | ||
'Google', | ||
'iCal', | ||
'Microsoft365', | ||
'MicrosoftTeams', | ||
'Outlook.com', | ||
'Yahoo', | ||
], | ||
iCalFileName: 'rocket-chat-gsoc-alumni-summit-2024', | ||
}; | ||
|
||
setConfig(config); | ||
}, [event.attributes['starts-at'], event.attributes['ends-at'], timezone]); | ||
|
||
return ( | ||
|
@@ -47,24 +80,35 @@ function EventStrip({ | |
<Col style={{ overflow: 'auto' }}>{event.attributes.name}</Col> | ||
<Col | ||
xs={2} | ||
md={1} | ||
xl={1} | ||
sm={1.5} | ||
xxl={1} | ||
md={1.5} | ||
xl={0.5} | ||
sm={2} | ||
xxl={1.5} | ||
className="event-join-button" | ||
> | ||
{showMainstage ? ( | ||
<Button size="sm" onClick={handleJoin}> | ||
Join | ||
</Button> | ||
<> | ||
<Button size="sm" onClick={handleJoin}> | ||
Join | ||
</Button> | ||
</> | ||
) : ( | ||
<Button | ||
size="sm" | ||
href={customLink || `/conferences/greenroom/${eid}`} | ||
target="_blank" | ||
> | ||
Join | ||
</Button> | ||
<ButtonGroup> | ||
<Button | ||
size="sm" | ||
href={customLink || `/conferences/greenroom/${eid}`} | ||
target="_blank" | ||
> | ||
Join | ||
</Button> | ||
<Button | ||
variant={'light'} | ||
size="sm" | ||
onClick={() => atcb_action(config)} | ||
> | ||
<BiCalendarPlus color="#ff6a71" /> | ||
</Button> | ||
</ButtonGroup> | ||
)} | ||
</Col> | ||
</Row> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters