q works now for creating a insta room

This commit is contained in:
Arjun Patel
2022-01-21 22:54:09 -08:00
parent a897c7a9b4
commit 892d3f7dd4
2 changed files with 230 additions and 204 deletions
-3
View File
@@ -376,9 +376,6 @@ export default function DashboardRoom() {
title={"Press q to create an instant room if you have GSuite."}
>
<button
onClick={() =>
window.open("https://meet.google.com/new", "_blank")
}
className="right-1 rounded-lg py-1 px-2 ml-1
shadow-md text-center text-white text-sm font-bold"
>
+39 -10
View File
@@ -99,7 +99,6 @@ export default function CreateOrUpdateRoomModal(props: IModalProps) {
if (hasGSuite) {
// create google meet link based on the room name without spaces
var slugName =
user.firstName +
"-" +
@@ -252,18 +251,46 @@ export default function CreateOrUpdateRoomModal(props: IModalProps) {
);
};
function createRoomNow() {
async function createRoomNow() {
console.log("creating room");
// reset form for the right values to be in there
// resetForm();
// handleGetAutoGSuiteLink();
resetForm();
// submit form
// handleSubmit().then(() => {
// console.log("creating room instantly");
// });
// handleSubmit().then((res) => console.log(res));
const newRoom = new Room();
// create google meet link based on the room name without spaces
var slugName =
user.firstName + "-" + "room" + moment(new Date()).format("dddddohmma");
slugName = slugName.replace(/\s/g, "-");
const autoLink =
"https://accounts.google.com/AccountChooser/signinchooser?continue=https://g.co/meet/" +
slugName;
newRoom.link = autoLink;
newRoom.status = RoomStatus.empty;
newRoom.membersInRoom = [];
newRoom.approximateDateTime = null;
newRoom.members = [currUser.uid]; // add currUser to the list of "people"
newRoom.type = RoomType.now;
newRoom.name = roomName;
newRoom.createdByUserId = currUser.uid;
newRoom.teamId = team.id;
console.log(newRoom);
handleModalType(ShowModalType.na);
await roomService.createOrUpdateRoom(newRoom);
resetForm();
toast.success("created room");
}
const keyMap: KeyMap = {
@@ -278,6 +305,9 @@ export default function CreateOrUpdateRoomModal(props: IModalProps) {
};
return (
<>
<GlobalHotKeys keyMap={keyMap} handlers={handlers} />
<Modal
title="Room Details"
centered
@@ -285,8 +315,6 @@ export default function CreateOrUpdateRoomModal(props: IModalProps) {
onOk={handleSubmit}
onCancel={handleCloseModal}
>
<GlobalHotKeys keyMap={keyMap} handlers={handlers} />
<div className="flex flex-col">
{hasGSuite ? (
<span className="flex flex-col items-start">
@@ -499,5 +527,6 @@ export default function CreateOrUpdateRoomModal(props: IModalProps) {
)}
</div>
</Modal>
</>
);
}