diff --git a/.vscode/launch.json b/.vscode/launch.json index 9a3ac80d..86085257 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -10,7 +10,7 @@ }, { "name": "Next.js: debug client-side", - "type": "pwa-msedge", + "type": "msedge", "request": "launch", "url": "http://localhost:3000", "cwd": "${workspaceFolder}/client" @@ -21,7 +21,18 @@ "request": "launch", "command": "yarn start", "cwd": "${workspaceFolder}/client", - "console": "integratedTerminal", + "serverReadyAction": { + "pattern": "started server on .+, url: (https?://.+)", + "uriFormat": "%s", + "action": "debugWithEdge" + } + }, + { + "name": "Next.js: debug production stack", + "type": "node-terminal", + "request": "launch", + "command": "yarn start:prod", + "cwd": "${workspaceFolder}/client", "serverReadyAction": { "pattern": "started server on .+, url: (https?://.+)", "uriFormat": "%s", diff --git a/client/env/.env.sample b/client/env/.env.sample index bdad6248..b8f03963 100644 --- a/client/env/.env.sample +++ b/client/env/.env.sample @@ -5,6 +5,7 @@ PORT=3000 # ----- ----- APOLLO GRAPHQL ----- ----- NEXT_PUBLIC_SERVER_ADDRESS=some-server-url +SERVER_ACCESS_API_KEY=some-api-key # ----- ----- IMAGEKIT ----- ----- diff --git a/client/src/assets/placeholder/onboarding.js b/client/src/assets/placeholder/onboarding.js index 93a7f959..774bcc5f 100644 --- a/client/src/assets/placeholder/onboarding.js +++ b/client/src/assets/placeholder/onboarding.js @@ -18,8 +18,8 @@ export const ONBOARDING = Object.freeze({ EMAIL_PLACEHOLDER: 'instituteID@nitrkl.ac.in', BUTTON: { PRIMARY: 'Get Verification Link', - SECONDARY: 'Check again and continue', - MOBILE: 'Next', + SECONDARY: 'Open webmail', + FINALLY: 'Confirm Verification', }, NOTE: 'Note: This only works if you’re a current student/ employee of \n NIT Rourkela with a valid institute email id.', }, @@ -28,27 +28,26 @@ export const ONBOARDING = Object.freeze({ TITLE: 'Interested Topics', CONTENT: "Select the topics you're interested in, and get smarter article suggestions on the MM website!", + LOADING_CONTENT: + "Give us a moment while we save your choices. Wouldn't want to mix them up.", }, TOPICS: [ - 'Witsdom', - 'Campus Buzz', - 'Alumni Affairs', - 'Student Activities', - 'Halls', - 'Interviews', - 'SAC Speaks', - 'Dean Speaks', - 'Videos', - 'Guest Interviews', - "Director's Desk", - "Chief Warden's Column", - 'Comics', - 'Alumnus Speaks', - 'Editorial', - 'Placements', - 'Internships', - 'Higher Education', - 'Photostories', + ['Campus Buzz', 12], + ['Alumni Affairs', 52], + ['Student Activities', 14], + ['Halls', 15], + ['Interviews', 21], + ['SAC Speaks', 22], + ['Guest Interviews', 24], + ["Director's Desk", 31], + ["Chief Warden's Column", 32], + ['Alumnus Speaks', 51], + ['Editorial', 66], + ['Placements', 41], + ['Internships', 42], + ['Higher Education', 43], + ['Photostories', 62], + ['Witsdom', 61], ], }, NEWSLETTER: { diff --git a/client/src/components/admin/Sidebar/menulist/NavCollapse.jsx b/client/src/components/admin/Sidebar/menulist/NavCollapse.jsx index a8ed85cf..84bc4586 100644 --- a/client/src/components/admin/Sidebar/menulist/NavCollapse.jsx +++ b/client/src/components/admin/Sidebar/menulist/NavCollapse.jsx @@ -9,11 +9,9 @@ import { ListItemText, Typography, } from '@mui/material'; -import { - FiberManualRecord, - KeyboardArrowDown, - KeyboardArrowUp, -} from '@mui/icons-material'; +import FiberManualRecord from '@mui/icons-material/FiberManualRecord'; +import KeyboardArrowDown from '@mui/icons-material/KeyboardArrowDown'; +import KeyboardArrowUp from '@mui/icons-material/KeyboardArrowUp'; // components import NavItem from './NavItem'; diff --git a/client/src/components/admin/Sidebar/menulist/NavItem.jsx b/client/src/components/admin/Sidebar/menulist/NavItem.jsx index 13f26c4d..bfdadace 100644 --- a/client/src/components/admin/Sidebar/menulist/NavItem.jsx +++ b/client/src/components/admin/Sidebar/menulist/NavItem.jsx @@ -11,7 +11,7 @@ import { } from '@mui/material'; // context -import { SidebarContext } from '../../../../context/SidebarContext'; +import { SidebarContext } from '../../../../context/SidebarContextProvider'; const NavItem = ({ item, level }) => { const theme = useTheme(); diff --git a/client/src/components/homepage/SocialMedia.js b/client/src/components/homepage/SocialMedia.js index 0e3cebc6..261a113c 100644 --- a/client/src/components/homepage/SocialMedia.js +++ b/client/src/components/homepage/SocialMedia.js @@ -15,7 +15,8 @@ import insta4 from '../../assets/images/instagram/insta4.jpeg'; import insta5 from '../../assets/images/instagram/insta5.jpeg'; import insta6 from '../../assets/images/instagram/insta6.jpeg'; import Image from 'next/image'; -import { YouTube, Instagram } from '@mui/icons-material'; +import YouTube from '@mui/icons-material/YouTube'; +import Instagram from '@mui/icons-material/Instagram'; const INSTA_LINKS = [insta1, insta2, insta3, insta4, insta5, insta6]; diff --git a/client/src/components/marginals/DesktopNavbar.js b/client/src/components/marginals/DesktopNavbar.js index a49711f5..878c927b 100644 --- a/client/src/components/marginals/DesktopNavbar.js +++ b/client/src/components/marginals/DesktopNavbar.js @@ -1,4 +1,4 @@ -import React, { useState, useEffect, useRef } from 'react'; +import React, { useState, useEffect, useRef, useContext } from 'react'; import Link from 'next/link'; import Image from 'next/image'; import { useRouter } from 'next/router'; @@ -7,13 +7,20 @@ import { useRouter } from 'next/router'; import InputAdornment from '@mui/material/InputAdornment'; import SearchIcon from '@mui/icons-material/Search'; import makeStyles from '@mui/styles/makeStyles'; -import { Container, Typography, TextField, Fade } from '@mui/material'; +import { + Container, + Typography, + TextField, + ButtonBase, + Fade, +} from '@mui/material'; // import TrendingUpSharpIcon from '@mui/icons-material/TrendingUpSharp'; // Utils import ROUTES from '../../utils/getRoutes'; import NewTabLink from '../shared/links/NewTabLink'; import getArticleLink from '../../utils/getArticleLink'; +import { authContext } from '../../context/AuthContextProvider'; // Assets import logoFullBlack from '../../assets/images/logos/logo_full_black.png'; @@ -21,13 +28,16 @@ import logoFullBlack from '../../assets/images/logos/logo_full_black.png'; //hooks import useAutoComplete from '../../hooks/useAutoComplete'; +//components +import UserAvatar from '../widgets/UserAvatar'; + const DesktopNavbar = () => { const router = useRouter(); const [search, setSearch] = useState(''); const [isSearchActive, setIsSearchActive] = useState(false); const inputRef = useRef(null); const classes = useStyles({ isSearchActive }); - + const { user } = useContext(authContext); const autoCompleteData = useAutoComplete(search, 10); useEffect(() => { @@ -120,21 +130,38 @@ const DesktopNavbar = () => { objectFit='cover' /> - - - - - ), - }} - /> +
+ + + + ), + }} + /> +
+ {user ? ( +
+ +
+ ) : ( + + + Sign In + + + )} +
+