-
Notifications
You must be signed in to change notification settings - Fork 68
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allowing presenter to chat with participants
- Loading branch information
1 parent
a6b9dd9
commit a6e9464
Showing
2 changed files
with
35 additions
and
3 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
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,29 +1,59 @@ | ||
import { useState } from "react"; | ||
import Head from "next/head"; | ||
import Script from "next/script"; | ||
import styles from "../../../styles/Mainstage.module.css"; | ||
import { Container, Row, Col } from "react-bootstrap"; | ||
import Jitsibroadcaster from '../../../components/clientsideonly/jitsibroadcaster' | ||
import InAppChat from "../../../components/inappchat/inappchat"; | ||
import { Button } from "react-bootstrap"; | ||
|
||
const Greenroom = () => { | ||
const greenroom_rid = process.env.NEXT_PUBLIC_ROCKET_CHAT_GREENROOM_RID; | ||
|
||
const Greenroom = ({ cookies }) => { | ||
const [openChat, setOpenChat] = useState(false); | ||
|
||
const handleOpenChat = () => { | ||
setOpenChat((prevState) => !prevState); | ||
}; | ||
return ( | ||
<> | ||
<Head> | ||
<title>Conference Green Room</title> | ||
</Head> | ||
<Script | ||
src="https://cdn.jsdelivr.net/npm/[email protected]/lib/js/joypixels.min.js" | ||
strategy="afterInteractive" | ||
onLoad={() => | ||
console.log(`script loaded correctly, joypixels`) | ||
} | ||
/> | ||
<main className={styles.main}> | ||
<div className={styles.container}> | ||
</div> | ||
{openChat ? ( | ||
<InAppChat closeChat={handleOpenChat} cookies={cookies} rid={greenroom_rid} /> | ||
) : ( | ||
<Button style={{ float: 'right' }} onClick={handleOpenChat}>Open Chat</Button> | ||
)} | ||
<Container> | ||
<Row> | ||
<Col> | ||
<Jitsibroadcaster /> | ||
</Col> | ||
</Row> | ||
</Container> | ||
|
||
</main> | ||
</> | ||
|
||
) | ||
} | ||
|
||
export default Greenroom; | ||
|
||
Greenroom.getInitialProps = ({ req }) => { | ||
const cookies = req.cookies; | ||
|
||
return { | ||
cookies, | ||
}; | ||
}; |