From f90df6b3297deb0c74245ee8aecbc4fd459b42e4 Mon Sep 17 00:00:00 2001 From: Muhammad Bilal Mohib-ul-Nabi Date: Sat, 8 Apr 2023 20:04:57 +0500 Subject: [PATCH] Development (#3) * Readme updated * Readme updated * Readme updated * Updated for SEO * Updated for SEO --- components/Main/Home/MainContent/index.tsx | 72 ++++ .../Pages/Profile/ProfileComp/index.tsx | 284 ++++++++++++++++ .../Profile/ProfileComp/style.module.css | 314 +++++++++++++++++ jsconfig.json | 9 + pages/_app.tsx | 141 ++------ pages/dashboard/[uid].tsx | 116 +++++++ pages/index.tsx | 139 ++------ pages/login.tsx | 15 +- pages/profile/[uuid].tsx | 319 +++--------------- pages/profile/style.module.css | 300 +--------------- tsconfig.json | 6 +- 11 files changed, 913 insertions(+), 802 deletions(-) create mode 100644 components/Main/Home/MainContent/index.tsx create mode 100644 components/Pages/Profile/ProfileComp/index.tsx create mode 100644 components/Pages/Profile/ProfileComp/style.module.css create mode 100644 jsconfig.json create mode 100644 pages/dashboard/[uid].tsx diff --git a/components/Main/Home/MainContent/index.tsx b/components/Main/Home/MainContent/index.tsx new file mode 100644 index 0000000..be2ead4 --- /dev/null +++ b/components/Main/Home/MainContent/index.tsx @@ -0,0 +1,72 @@ +import React, { useState, useEffect, useRef } from 'react'; +import { useRouter } from 'next/router'; +import type { NextPage } from 'next'; +import Head from 'next/head'; +// Importing Components +import Home from '@app/components/Main/Home'; +import Navbar from '@app/components/Navbar'; +import Sidebar from '@app/components/Sidebar'; +import Inbox from '@app/components/Main/Inbox'; + +// Importing Material UI Components +import { + Box +} from '@mui/material'; + +import styles from "../../../../styles/Home.module.css"; + +interface MainContentProps { + isOpen: boolean; + setIsOpen: (value: boolean) => void; + currentMenuItem: number; + setCurrentMenuItem: (value: number) => void; + signedInUserData: { email: string }; +} + +const MainContent: React.FC = ({ isOpen, setIsOpen, currentMenuItem, setCurrentMenuItem, signedInUserData }) => { + return ( +
+ +
+ + +
+ {/* Home Page */} +
+ +
+ + {/* My Tasks Page */} +
+
+

My Tasks

+
+ + {/* Inbox Page */} +
+ +
+ + {/* Reporting Page */} +
+
+

Reporting

+
+ + {/* Portfolios Page */} +
+
+

Portfolios

+
+ + {/* Goals Page */} +
+
+

Goals

+
+
+
+
+ ); +}; +export default MainContent; \ No newline at end of file diff --git a/components/Pages/Profile/ProfileComp/index.tsx b/components/Pages/Profile/ProfileComp/index.tsx new file mode 100644 index 0000000..8ac6c98 --- /dev/null +++ b/components/Pages/Profile/ProfileComp/index.tsx @@ -0,0 +1,284 @@ +import React, { useState, useEffect, useRef } from 'react'; +import { useRouter } from 'next/router'; +import type { NextPage } from 'next'; +import Image from 'next/image'; +import Head from 'next/head'; + +// Importing Material UI Components +import { + Box +} from '@mui/material'; + +// Importing Icons +import { CiTimer } from "react-icons/ci"; +import { AiOutlineMail } from "react-icons/ai"; +import { BsCheckCircle } from "react-icons/bs"; + +import DatePicker from 'react-date-picker/dist/entry.nostyle'; + +import { + doc, + collection, + onSnapshot, + addDoc, + query, + orderBy, + deleteDoc, + setDoc, + where +} from "firebase/firestore"; +import { useCollection } from 'react-firebase-hooks/firestore'; + +import { + onAuthStateChanged, +} from "firebase/auth"; + +import { db, auth } from "../../../../firebase"; + +// Importing Components +import CustomLoader from '@app/components/CustomLoader'; +import Navbar from '@app/components/Navbar'; +import Sidebar from '@app/components/Sidebar'; + +import styles from './style.module.css'; + +interface ProfileCompProps { + isSignedIn: boolean; + signedInUserData: any; +} + +const ProfileComp: React.FC = ({ isSignedIn, signedInUserData }) => { + const router = useRouter(); + const { uuid } = router.query; + + const [taskDue, setTaskDue] = useState(new Date()); + + const frequentCollaboratorsList = [ + { + name: "Bilal Mohib", + email: "bilalmohib7896@gmail.com", + photoURL: null + }, + { + name: "Arif Alvi", + email: "arifalvi@gmail.com", + photoURL: null + }, + { + name: "Imran Khan", + email: "imrankhan@gmail.com", + photoURL: null + }, + { + name: "Nawaz Sharif", + email: "nawazsharif@gmail.com", + photoURL: null + }, + { + name: "Asif Ali Zardari", + email: "asifalizardari@gmail.com", + photoURL: null + } + ] + + /////////////////////////////////////// Database Part //////////////////////////////////////////////// + let q = query(collection(db, "Data", "Projects", `${uuid}`)); + + const [snapshot, loading, error] = useCollection( + q, + { + snapshotListenOptions: { includeMetadataChanges: true }, + } + ); + + // GETTINGS Active Jobs + const [projects, setProjects] = useState([]) + // const [loading, setLoading] = useState(true); + + // FOR GETTING PROJECTS + useEffect(() => { + + if (!loading) { + // if (snapshot.docs.length !== projects.length) { + setProjects(snapshot?.docs.map(doc => ({ ...doc.data(), id: doc.id }))); + // setLoading(false); + // console.clear(); + console.log("Projects ==> ", projects); + // } + } + + // eslint-disable-next-line react-hooks/exhaustive-deps + }, [loading, snapshot]); + // FOR GETTING PROJECTS + + /////////////////////////////////////// Database Part //////////////////////////////////////////////// + + return ( +
+ {(isSignedIn && !loading) ? ( +
+
+
+
+ {signedInUserData.displayName} +
+
+

{signedInUserData.displayName}

+

+

+ + {/* 10:19am */} +   + {new Date().toLocaleTimeString()} +   + local time +

+

bilalmohib20001@gmail.com

+

+
+
+
+ +
+
+ + {/* Main Profile Container */} +
+
+
+
+
+ My tasks +
+
+ +
+
+
+ { + projects.map((item: any, index: any) => { + return ( +
+
+

alert("Mark As Completed")}>

+

{item.ProjectName}

+
+
+ +
+
+ ) + }) + } +
+
+
+ +
+
+

About me

+

Use this space to tell people about yourself.

+
+
+

Frequent collaborators

+
+ { + frequentCollaboratorsList.map((item, index) => { + return ( +
+
+
+ {item.name} +
+
+

{item.email}

+
+
+
+ ) + }) + } +
+ {/*
*/} +
+
+
+ + + {/* MAIN Profile Container */} +
+
+
+
+
+ My recent projects +
+
+
+ { + projects.map((item: any, index: any) => { + return ( +
+
+

alert("Mark As Completed")}>

+

{item.ProjectName}

+
+
+ +
+
+ ) + }) + } +
+
+
+ +
+ {/* */} +
+
+

+ {/* MAIN Profile Container */} +
+ ) : ( + + )} +
+ ) +} + +export default ProfileComp; \ No newline at end of file diff --git a/components/Pages/Profile/ProfileComp/style.module.css b/components/Pages/Profile/ProfileComp/style.module.css new file mode 100644 index 0000000..68e0dba --- /dev/null +++ b/components/Pages/Profile/ProfileComp/style.module.css @@ -0,0 +1,314 @@ +/* Main Container */ +.container { + /* border: 1px solid red; */ + background-color: #f9f8f8; + padding-left: 10%; + padding-right: 10%; + padding-top: 33px; +} + +.main { + width: auto; + height: auto; + background-color: white; +} + +/* Top Profile Container */ +.profileContainerTop { + /* border: 3px solid green; */ + display: flex; + flex-direction: row; + align-items: center; + justify-content: space-between; +} + +/* Left Side Profile Image Container */ +.profileImageContainer { + /* border: 1px solid red; */ + width: fit-content; +} + +/* Profile Image Style */ +.profileImage { + /* border: 2px solid red; */ + border-radius: 50%; + /* Make Image quality best */ + image-rendering: optimizeQuality; + /* Make Image quality best */ +} + +/* Right Side Profile Container */ +.profileRightContainer { + /* border: 2px solid grey; */ + padding-left: 30px; +} + +/* Profile Display Name */ +.profileName { + font-size: 32px; + line-height: 40px; + color: #1e1f21; + font-weight: 400; + margin-top: 30px; +} + +/* Profile Info Container */ +.profileInfoContainer { + /* border: 2px solid grey; */ + display: flex; + margin-top: 10px; +} + +.profileInfoContainer p { + font-size: 14px; + line-height: 20px; + color: #6D6E6F; + font-weight: 400; + margin-right: 10px; +} + +.email:hover { + text-decoration: underline; + cursor: pointer; +} + +/* Sign Out Button */ +.signOutBtn { + border: 1px solid #0c56d0; + background-color: #f9f8f8; + padding: 10px 20px; + border-radius: 5px; + font-size: 14px; + line-height: 20px; + color: #0c56d0; + text-transform: none; + font-weight: 400; + margin-top: 10px; +} + +/* Main Profile Container */ +.profileContainerMain { + /* border: 2px solid grey; */ + display: flex; + flex-direction: row; + margin-top: 30px; +} + +/* //////////////////////////// MAIN PROFILE CONTAINER //////////////////////////// */ +.profileContainerMain { + /* border: 2px solid rgb(255, 0, 0); */ + display: flex; + flex-direction: row; + margin-top: 30px; +} + +/* my Tasks Container */ +.myTasksMainContainer { + border: 1px solid #f1efee; + background-color: white; + width: 70%; + border-radius: 8px; + padding-top: 20px; +} + +.viewAllTasksBtn { + border: 1px solid #cfcbcb; + background-color: white; + border-radius: 5px; + font-size: 12px; + box-shadow: none !important; + width: 110px !important; + line-height: 10px; + padding-left: 0px !important; + padding-right: 0px !important; + color: #454d5b; + text-transform: none; + font-weight: 400; +} + +.viewAllTasksBtn:hover { + border: 1px solid #b4b4b4; + background-color: #f9f8f8 !important; + color: #454d5b !important; +} + +/* Header My Tasks */ +.headerMyTasks { + border-bottom: 1px solid #f1efee; + display: flex; + flex-direction: row; + justify-content: space-between; + padding-left: 20px; + padding-right: 20px; + padding-bottom: 20px; +} + +.headerMyTasks div { + font-size: 20px; + color: #1E1F21; +} + +/* Right Header My Tasks */ +.myTasksHeaderRight { + padding-top: 0px !important; + margin-top: -2px !important; +} + +/* Right Side Container */ +.rightSideMainContainer { + /* border: 2px solid rgb(200, 84, 17); */ + width: 30%; + margin-left: 2.5%; + /* padding-left: 20px; */ + padding-bottom: 3px; +} + +/* Right Side Containers */ +.aboutMeContainer { + border: 1px solid #f1efee; + padding-top: 25px; + padding-left: 25px; + padding-right: 25px; + margin-bottom: 20px; + padding-bottom: 20px; + margin-bottom: 25px; + background-color: #ffffff; + border-radius: 8px; +} + +/* Out Side Container FCL */ +.outsideContainerFCL { + /* border: 3px solid rgb(30, 0, 255); */ + overflow-y: auto; + height: 300px; + margin-bottom: 10px; +} + +.frequentCollaborators { + border: 1px solid #f1efee; + border-radius: 8px !important; + /* padding: 25px; */ + padding-bottom: 10px; + background-color: #ffffff !important; +} + +.fcHeading { + margin-left: 25px; + padding-top: 25px; + /* border: 2px solid red; */ +} + +/* Heading About me */ +.aboutMeContainer h1 { + /* border: 3px solid rgb(0, 0, 255); */ + font-size: 20px; + margin-bottom: 10px; + background-color: #ffffff !important; +} + +.aboutMeContainer p { + /* border: 3px solid rgb(0, 0, 255); */ + font-size: 14px; + margin-top: 22px; + line-height: 20px; + color: #6D6E6F; + font-weight: 400; + background-color: #ffffff !important; +} + +.frequentCollaborators h1 { + /* border: 3px solid rgb(255, 0, 0); */ + font-size: 20px; + margin-bottom: 25px; + background-color: #ffffff; +} + +/* List Of frequentCollaborators */ +.frequentCollaboratorsList { + /* border: 3px solid rgb(255, 0, 0); */ + background-color: #ffffff; + padding-bottom: 10px; + padding-top: 5px; + height: 70px; +} + +.frequentCollaboratorsList:hover { + /* border: 3px solid rgb(6, 49, 8); */ + background-color: #f9f8f8; + border-radius: 5px; + cursor: pointer; + /* display: flex; + flex-direction: row; */ +} + +.frequentCollaboratorsImageContainer { + /* border: 2px solid red; */ + padding-left: 30px; +} + +.frequentCollaboratorsImage { + border-radius: 50%; +} + +.emailfcnc { + font-size: 14px; + line-height: 20px; + color: #1E1F21; + font-weight: 400; + padding-top: 18px; + margin-left: 15px; + background-color: inherit; +} + +.emailfcnc:hover { + background-color: initial; +} + +.bodymyTasksContainer { + /* border: 2px solid red; */ + margin-top: 30px; + height: 420px; + overflow-y: auto; +} + +/* My Tasks List */ +.myTasksList { + border-bottom: 1px solid #f1efee; + padding-left: 20px; + padding-right: 20px; + background-color: #ffffff; + justify-content: space-between; + display: flex; +} + +.myTasksList:hover { + background-color: #f9f8f8; + border-radius: 5px; + cursor: pointer; +} + +.myTasksListLeft { + /* border: 2px solid rgb(0, 17, 255); */ + display: flex; + flex-direction: row; + margin-top: 5px; + height: 30px; + margin-bottom: 5px; +} + +.myTasksListRight { + padding-top: 5px; +} + +.pnmyTask { + margin-left: 10px; +} + +.taskCompleteIcon:hover { + color: green; + cursor: pointer; +} + +/* My Tasks List */ + +/* //////////////////////////// MAIN PROFILE CONTAINER //////////////////////////// */ \ No newline at end of file diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000..a3f037b --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,9 @@ +{ + "compilerOptions": { + "baseUrl": ".", + "paths": { + "@app/*": ["./*"] + } + } + } + \ No newline at end of file diff --git a/pages/_app.tsx b/pages/_app.tsx index b7fdbe6..8223ffc 100644 --- a/pages/_app.tsx +++ b/pages/_app.tsx @@ -4,21 +4,18 @@ import { useRouter } from 'next/router'; import type { AppProps } from 'next/app'; import Script from 'next/script'; ////////////////////////////////////////////////// -import Head from 'next/head'; // Importing Components import Landing from '../components/Landing'; import Navbar from '../components/Navbar'; import Sidebar from '../components/Sidebar'; import Home from '../components/Main/Home'; import Inbox from '../components/Main/Inbox'; -import { ProfileComp } from './profile/[uuid]'; import { ProjectDetailsComp } from './projectDetails/[projectName]/[projectID]'; // Importing firebase import { db, auth } from "../firebase"; import { - onAuthStateChanged, - signOut + onAuthStateChanged } from "firebase/auth"; // Importing firebase @@ -31,7 +28,7 @@ import 'react-date-picker/dist/DatePicker.css'; import 'react-calendar/dist/Calendar.css'; import '../styles/globals.css'; -function MyApp({ Component, pageProps }: AppProps) { +function MyApp({ Component, pageProps }: AppProps & { Component: React.ComponentType }) { const router = useRouter(); const { uuid } = router.query; @@ -88,120 +85,40 @@ function MyApp({ Component, pageProps }: AppProps) { }); }, [signedInUserData, Loading]); - useEffect(() => { - console.clear(); - console.log('routeChangeStart', router.pathname); - if (router.pathname === "/login" || - router.pathname === "/signup" || - router.pathname === "/forgot-password" || - router.pathname === "/reset-password" || - router.pathname === "/verify-email" || - router.pathname === "/createProject" || - router.pathname === "/features" || - router.pathname === "/pricing" || - router.pathname === "/about" || - router.pathname === "/contact" || - router.pathname === "/terms" || - router.pathname === "/privacy" - ) { - setHideExtra(0); - } - else if ( - router.pathname == `/profile/[uuid]` - || router.pathname === '/profile' - || router.pathname === '/projectDetails/[projectName]/[projectID]' - || router.pathname === '/projectDetails' - ) { - setHideExtra(2); - } - else { - setHideExtra(1); - } - setLoading(false); - // eslint-disable-next-line react-hooks/exhaustive-deps - }, [router.pathname]); - return ( <> - {(!loading) && ( + {/* {(!loading) && (
- {(!isSignedIn && !loading && hideExtra !== 0) ? ( + {(!isSignedIn && !loading) ? ( ) : ( - - { - ((hideExtra == 1) && !loading) ? ( -
-
- -
- - -
- {/* Home Page */} -
- -
- - {/* My Tasks Page */} -
-
-

My Tasks

-
- - {/* Inbox Page */} -
- -
- - {/* Reporting Page */} -
-
-

Reporting

-
- - {/* Portfolios Page */} -
-
-

Portfolios

-
- - {/* Goals Page */} -
-
-

Goals

-
-
-
-
-
- ) : (hideExtra == 2 && !loading) && ( -
-
- -
- - -
- {(router.pathname == `/profile/[uuid]` || router.pathname == '/profile') ? ( - - ) : (router.pathname == '/projectDetails/[projectName]/[projectID]') ? ( - - ) : ( - <> - )} -
-
-
-
- )} -
+ )}
- )} - + )} */} + + +