From 294873b69dac2d340c0c16460becdb08efd3b68e Mon Sep 17 00:00:00 2001 From: Arjun Patel Date: Wed, 9 Feb 2022 22:26:44 -0800 Subject: [PATCH] fixing other issues with build --- packages/common/helpers/userHelper.tsx | 2 +- packages/common/services/userService.ts | 2 +- .../UserDetails/SimpleUserDetailsRow.tsx | 2 +- packages/web/helpers/userHelper.tsx | 2 +- packages/web/pages/teams/dashboard.tsx | 1063 ----------------- packages/web/pages/teams/demo.tsx | 855 ------------- 6 files changed, 4 insertions(+), 1922 deletions(-) delete mode 100644 packages/web/pages/teams/dashboard.tsx delete mode 100644 packages/web/pages/teams/demo.tsx diff --git a/packages/common/helpers/userHelper.tsx b/packages/common/helpers/userHelper.tsx index 549476f..4d187f9 100644 --- a/packages/common/helpers/userHelper.tsx +++ b/packages/common/helpers/userHelper.tsx @@ -1,4 +1,4 @@ -import { User, UserStatus } from "../models/user"; +import User, { UserStatus } from "../models/user"; function getStatusValue(status: UserStatus) { switch (status) { diff --git a/packages/common/services/userService.ts b/packages/common/services/userService.ts index e929f77..e79ebb9 100644 --- a/packages/common/services/userService.ts +++ b/packages/common/services/userService.ts @@ -11,7 +11,7 @@ import { Unsubscribe, DocumentSnapshot, } from "firebase/firestore"; -import { User, UserStatus } from "../models/user"; +import User, { UserStatus } from "../models/user"; import Collections from "./collections"; export default class UserService { diff --git a/packages/web/components/UserDetails/SimpleUserDetailsRow.tsx b/packages/web/components/UserDetails/SimpleUserDetailsRow.tsx index 78ceb94..fa06cfb 100644 --- a/packages/web/components/UserDetails/SimpleUserDetailsRow.tsx +++ b/packages/web/components/UserDetails/SimpleUserDetailsRow.tsx @@ -1,4 +1,4 @@ -import { User } from "@nirvana/common/models/user"; +import User from "@nirvana/common/models/user"; import UserAvatar from "./UserAvatar"; import { ReactElement } from "react"; diff --git a/packages/web/helpers/userHelper.tsx b/packages/web/helpers/userHelper.tsx index 549476f..cc5e1fe 100644 --- a/packages/web/helpers/userHelper.tsx +++ b/packages/web/helpers/userHelper.tsx @@ -1,4 +1,4 @@ -import { User, UserStatus } from "../models/user"; +import User, { UserStatus } from "@nirvana/common/models/user"; function getStatusValue(status: UserStatus) { switch (status) { diff --git a/packages/web/pages/teams/dashboard.tsx b/packages/web/pages/teams/dashboard.tsx deleted file mode 100644 index 0731dbb..0000000 --- a/packages/web/pages/teams/dashboard.tsx +++ /dev/null @@ -1,1063 +0,0 @@ -import Image from "next/image"; -import React, { useState } from "react"; -import { - FaMicrophoneAlt, - FaHeadphonesAlt, - FaTh, - FaAngleDown, - FaPlusSquare, - FaBroom, - FaBell, - FaFilePdf, - FaCopy, - FaClock, - FaPlay, - FaPlus, - FaCheck, - FaCode, - FaLink, - FaExternalLinkAlt, - FaArchive, - FaAtlassian, - FaSearch, -} from "react-icons/fa"; -import { IoPulseOutline, IoRemoveOutline, IoTimer } from "react-icons/io5"; -import { BsThreeDots } from "react-icons/bs"; - -import { UserStatus, User } from "../../models/user"; -import { KeyCode } from "../../globals/keycode"; - -import { useRouter } from "next/router"; -import { useEffect } from "react"; -import { useRecoilState } from "recoil"; -import { useAuth } from "../../contexts/authContext"; - -const testFriends = [ - { - name: "Liam", - role: "engineer", - systemAvatar: "29", - status: UserStatus.online, - }, - { - name: "Emily", - role: "engineer", - systemAvatar: "02", - status: UserStatus.online, - }, - { - name: "Paul", - role: "architect", - systemAvatar: "43", - status: UserStatus.online, - }, - { - name: "Mark", - role: "engineer", - systemAvatar: "04", - status: UserStatus.busy, - }, - { - name: "Adriana", - role: "design", - systemAvatar: "06", - status: UserStatus.busy, - }, - { - name: "Josh", - role: "design", - systemAvatar: "05", - status: UserStatus.offline, - }, -]; - -export default function Dashboard() { - const { currUser } = useAuth(); - - const router = useRouter(); - - useEffect(() => { - // if not authenticated, take user to the login - if (!currUser) { - console.log("not authenticated...routing from dashboard to teams home"); - router.push("/teams/login"); - } - }, [currUser]); - - const [selectedChannel, setSelectedChannel] = useState(null); - - console.log("in dashboard " + currUser); - - async function handleSignOut() { - console.log("clicked log out button"); - - try { - await logOut(); - - router.push("/teams"); - } catch (error) { - console.log(error); - } - } - - function statusBubble(status: UserStatus) { - console.log(status); - - switch (status) { - case UserStatus.online: - return ( - - ); - case UserStatus.busy: - return ( - - ); - case UserStatus.offline: - return ( - - ); - default: - return ( - - ); - } - } - - function renderPulse(status: UserStatus) { - switch (status) { - case UserStatus.online: - return ( - - ); - case UserStatus.busy: - return ( - - ); - case UserStatus.offline: - return ( - - ); - default: - return ( - - ); - } - } - - function handleKeyboardShortcut(event) { - console.log(event.keyCode); - - switch (event.keyCode) { - case KeyCode.Escape: - setSelectedChannel(null); - break; - case KeyCode.Zero: - setSelectedChannel(0); - break; - case KeyCode.One: - setSelectedChannel(1); - break; - case KeyCode.Two: - setSelectedChannel(2); - break; - case KeyCode.Three: - setSelectedChannel(3); - break; - case KeyCode.Four: - setSelectedChannel(4); - break; - case KeyCode.Five: - setSelectedChannel(5); - break; - default: - return; - } - } - - return ( - <> -
- {/* header content */} -
- {/* welcome message */} - - - πŸ‘‹Hey Arjun, Good Afternoon! - - - {/* Date and time */} - - - Tues, Jan 11th - - - 1:34am - - - - - {/* header control section */} - - - {/* search bar */} -
- - - - - -
- - - - - - - {/* avatar */} - - - - profile - -
-
- -
- {/* personal line */} -
- - - TEAM - - - - - - {/* list of team members */} - {testFriends.map((friend, i) => { - return ( - - - - - {statusBubble(friend.status)} - - profile - - - - - - {friend.name}{" "} - - {selectedChannel == i ? ( - <> - - - ) : ( - - )} - - - - {friend.role} - - - - {renderPulse(friend.status)} - - ); - })} -
- -
- {/* pinned */} -
- - - - ANNOUNCEMENTS - - - - updates, pep talks, blockers, reminders - - - - {/* tab pane */} - - - Active - - - - Resolved - - - - - TODAY - - - - - - -
- {/* adriana's announcement */} - - - - - {statusBubble(UserStatus.busy)} - - profile - - - - - Adriana - - 5 minutes ago - - blockers - - - - - {/* arjun's announcement */} - - - - - {statusBubble(UserStatus.busy)} - - profile - - - - Arjun - - 30 minutes ago - - - engineering - - - - - -
-
- - {/* rooms */} -
- - - ROOMS - - - - {/* tab pane */} - - - All - - - - Live - - - - Scheduled - - - - Recurring - - - - - Week - - - - - - - - {/* all rooms */} - - {/* spontaneous bugs room */} - - {/* header */} - - {/* meeting details */} - - - bug fixing - - - were just fixing that jsx bug thats a paiiinnnn - - - {/* badges and tags */} - - - blockers - - - - engineering - - - - - {/* room status */} - - - - live - - - {/* room attachments */} - - - - - - - - - {/* footer */} - - - - - profile - - - - profile - - - - Arjun and Liam - - - {" "} - - - - {/* live room - design meeting */} - - {/* header */} - - {/* meeting details */} - - - Shopping Cart Experience - - - lets finish the mockups @josh, @mark, and @arjun please - step in for feedback - - - {/* badges and tags */} - - - design - - - - - {/* room status */} - - - - live - - - on and off all day - - - {/* room attachments */} - - - - - - - - - {/* footer */} - - - - - profile - - - - Adriana - - - - - - - - {/* scheduled room - one on one */} - - {/* header */} - - {/* meeting details */} - - - Arjun and Paul - One on one - - - performance review - - - {/* badges and tags */} - - - private - - - - - {/* room status */} - - - - scheduled - - - - 3ish? Ill ping you Arjun - - - - - {/* footer */} - - - {" "} - - - - {/* recurring room - dsu */} - - {/* header */} - - {/* meeting details */} - - - Daily Standup - - - - {/* badges and tags */} - - - scrum - - - - engineering - - - - - {/* room status */} - - - - recurring - - - 10am daily - - - - {/* footer */} - - - - {" "} - - - - {/* recurring room - demo */} - - {/* header */} - - {/* meeting details */} - - - Sprint Demo - - - all hands on deck...lets have fun :) - - - {/* badges and tags */} - - - scrum - - - - - {/* room status */} - - - - recurring - - - - biweekly fridays! - - - - - {/* footer */} - - - - - - - - - - {/* recurring room - wine wednesdays */} - - {/* header */} - - {/* meeting details */} - - - Wine Wednesdays - - - @JOSH YOU BETTER COME - - - {/* badges and tags */} - - - party πŸŽ‰ - - - - - {/* room status */} - - - - recurring - - - - wednesdays 7-9pm - - - - - {/* footer */} - - - - - - - - - -
-
-
- - {/* attachments */} -
- {/* header row */} - - - - Attachments - - - - - code, links (jira tickets, drive folders, powerpoints), - screenshots - - - - {/* tab pane */} - - - Team - - - - Personal - - - - Favorites - - - - - TODAY - - - - - - - - - - {/* row of attachments */} -
- {/* pdf example */} - - {/* attmnt header */} - - - - - - report.pdf - - - - blockers - - - - {/* attachment actions */} - - - - - - - {/* attmnt footer */} - - - - - profile - - - - - - Adriana - - - 5 minutes ago - - - - - - - - {/* jira example */} - - {/* attmnt header */} - - - - - RAM-22 - - technical doc - stripe - - - - engineering - - - - {/* attachment actions */} - - - - - - - {/* attmnt footer */} - - - - - profile - - - - - Paul - - 2 hours ago - - - - - - -
-
-
- -
- {/* dynamic footer based on selection */} -
- - - - - {statusBubble(UserStatus.online)} - - profile - - - - - {selectedChannel == null - ? "" - : testFriends[selectedChannel].name}{" "} - - - - {selectedChannel == null - ? "" - : testFriends[selectedChannel].role} - - - - - {/* shortcuts */} - - - R - - - SPACE - - -
-
- - ); -} diff --git a/packages/web/pages/teams/demo.tsx b/packages/web/pages/teams/demo.tsx deleted file mode 100644 index 56e6429..0000000 --- a/packages/web/pages/teams/demo.tsx +++ /dev/null @@ -1,855 +0,0 @@ -import Head from 'next/head' -import Image from 'next/image'; -import React from 'react'; -import { FaMicrophoneAlt, - FaHeadphonesAlt, - FaTh, - FaAngleDown, - FaPlusSquare, - FaBroom, - FaBell, - FaFilePdf, - FaCopy, - FaClock, - FaPlay, - FaPlus, - FaCheck, - FaCode, - FaLink, - FaExternalLinkAlt, - FaArchive, - FaAtlassian, - FaSearch - -} from "react-icons/fa"; -import { IoPulseOutline, IoRemoveOutline, IoTimer } from "react-icons/io5"; -import { BsThreeDots } from "react-icons/bs"; - -import { UserStatus, User } from '../../models/user' -import { KeyCode } from '../../globals/keycode' - -import BackgroundLayout from '../../components/Layouts/BackgroundLayout' - -let testFriends = [ - { - name: "Liam", - role: "engineer", - systemAvatar: "29", - status: UserStatus.online - }, - { - name: "Emily", - role: "engineer", - systemAvatar: "02", - status: UserStatus.online - }, - { - name: "Paul", - role: "architect", - systemAvatar: "43", - status: UserStatus.online - }, - { - name: "Mark", - role: "engineer", - systemAvatar: "04", - status: UserStatus.busy - }, - { - name: "Adriana", - role: "design", - systemAvatar: "06", - status: UserStatus.busy - }, - { - name: "Josh", - role: "design", - systemAvatar: "05", - status: UserStatus.offline - } -] - -function getUser(name: string) : User { - return new User() -} - -type MyState = { - selectedChannel?: number -}; - - -export default class Demo extends React.Component<{ }, MyState> { - state: MyState = { - selectedChannel: null - } - - componentDidMount(): void { - document.addEventListener("keydown", this.handleKeyboardShortcut) - } - - componentWillUnmount(): void { - document.removeEventListener("keydown", this.handleKeyboardShortcut); - } - - statusBubble(status: UserStatus) { - console.log(status) - - switch(status) { - case UserStatus.online: - return - case UserStatus.busy: - return - case UserStatus.offline: - return - default: - return - } - } - - renderPulse(status: UserStatus) { - switch(status) { - case UserStatus.online: - return - case UserStatus.busy: - return - case UserStatus.offline: - return - default: - return - } - } - - handleKeyboardShortcut = (event) => { - console.log(event.keyCode) - - switch(event.keyCode) { - case KeyCode.Escape: - this.setState({ - selectedChannel: null - }) - break - case KeyCode.Zero: - this.setState({ - selectedChannel: 0 - }); - break - case KeyCode.One: - this.setState({ - selectedChannel: 1 - }); - break - case KeyCode.Two: - this.setState({ - selectedChannel: 2 - }); - break - case KeyCode.Three: - this.setState({ - selectedChannel: 3 - }); - break - case KeyCode.Four: - this.setState({ - selectedChannel: 4 - }); - break - case KeyCode.Five: - this.setState({ - selectedChannel: 5 - }); - break - default: - return - } - } - - render() { - return ( - -
- {/* header content */} -
- {/* welcome message */} - - πŸ‘‹Hey Arjun, Good Afternoon! - - {/* Date and time */} - - Tues, Jan 11th - 1:34am - - - - {/* avatar */} - - {/* search bar */} -
- - - - - -
- - - - - - - {/* avatar */} - - - - profile - -
-
- -
- {/* personal line */} -
- - - TEAM - - - - - - - {/* list of team members */} - { - testFriends.map((friend, i) => { - return ( - - - - - {this.statusBubble(friend.status)} - - profile - - - - - {friend.name} - { - this.state.selectedChannel == i ? - <> - - - - : - - } - - - - {friend.role} - - - {this.renderPulse(friend.status)} - - ) - }) - } -
- -
- {/* pinned */} -
- - - ANNOUNCEMENTS - - - updates, pep talks, blockers, reminders - - - {/* tab pane */} - - Active - - Resolved - - - - TODAY - - - - - - -
- {/* adriana's announcement */} - - - - - {this.statusBubble(UserStatus.busy)} - - profile - - - - Adriana - 5 minutes ago - - blockers - - - - - {/* arjun's announcement */} - - - - - {this.statusBubble(UserStatus.busy)} - - profile - - - - Arjun - 30 minutes ago - - engineering - - - - - -
-
- - {/* rooms */} -
- - ROOMS - - - - {/* tab pane */} - - All - - Live - - Scheduled - - Recurring - - - - Week - - - - - - - - {/* all rooms */} - - {/* spontaneous bugs room */} - - {/* header */} - - {/* meeting details */} - - bug fixing - were just fixing that jsx bug thats a paiiinnnn - - {/* badges and tags */} - - - blockers - - - - engineering - - - - - {/* room status */} - - - - live - - - {/* room attachments */} - - - - - - - - - - {/* footer */} - - - - - profile - - - - profile - - - - Arjun and Liam - - - - - - - {/* live room - design meeting */} - - {/* header */} - - {/* meeting details */} - - Shopping Cart Experience - lets finish the mockups @josh, @mark, and @arjun please step in for feedback - - {/* badges and tags */} - - - design - - - - - {/* room status */} - - - - live - - on and off all day - - {/* room attachments */} - - - - - - - - - {/* footer */} - - - - - profile - - - - Adriana - - - - - - - - {/* scheduled room - one on one */} - - {/* header */} - - {/* meeting details */} - - Arjun and Paul - One on one - performance review - - {/* badges and tags */} - - - private - - - - - {/* room status */} - - - - scheduled - - - 3ish? Ill ping you Arjun - - - - {/* footer */} - - - - - - - {/* recurring room - dsu */} - - {/* header */} - - {/* meeting details */} - - - Daily Standup - - - - {/* badges and tags */} - - - scrum - - - - engineering - - - - - {/* room status */} - - - - recurring - - - 10am daily - - - - {/* footer */} - - - - - - - - - - {/* recurring room - demo */} - - {/* header */} - - {/* meeting details */} - - - Sprint Demo - - all hands on deck...lets have fun :) - - {/* badges and tags */} - - - scrum - - - - - {/* room status */} - - - - recurring - - - biweekly fridays! - - - - {/* footer */} - - - - - - - - - - {/* recurring room - wine wednesdays */} - - {/* header */} - - {/* meeting details */} - - - Wine Wednesdays - - @JOSH YOU BETTER COME - - {/* badges and tags */} - - - party πŸŽ‰ - - - - - {/* room status */} - - - - recurring - - - wednesdays 7-9pm - - - - {/* footer */} - - - - - - - - - - -
-
-
- - {/* attachments */} -
- {/* header row */} - - - Attachments - - - - code, links (jira tickets, drive folders, powerpoints), screenshots - - - {/* tab pane */} - - Team - - Personal - - Favorites - - - - TODAY - - - - - - - - - - {/* row of attachments */} -
- {/* pdf example */} - - {/* attmnt header */} - - - - - report.pdf - - - blockers - - - - {/* attachment actions */} - - - - - - - {/* attmnt footer */} - - - - - profile - - - - - Adriana - 5 minutes ago - - - - - - - {/* jira example */} - - {/* attmnt header */} - - - - - RAM-22 - technical doc - stripe - - - engineering - - - - {/* attachment actions */} - - - - - - - {/* attmnt footer */} - - - - - profile - - - - - Paul - 2 hours ago - - - - - -
-
-
- -
- {/* dynamic footer based on selection */} -
- - - - - {this.statusBubble(UserStatus.online)} - - profile - - - - {this.state.selectedChannel == null ? "" : testFriends[this.state.selectedChannel].name} - - {this.state.selectedChannel == null ? "" : testFriends[this.state.selectedChannel].role} - - - - {/* shortcuts */} - - - R - - - SPACE - - -
-
-
- ) - } - -} \ No newline at end of file