From ecf048c7ed75919fee0529539011654dfa785e2c Mon Sep 17 00:00:00 2001 From: Shubham Date: Mon, 18 Oct 2021 21:19:07 +0530 Subject: [PATCH 01/31] Changes in navbar UI and content --- components/NavBar/index.js | 60 ++++++++++--- components/NavBar/navbar.module.css | 134 ++++++++++++++++++---------- public/assets/github.png | Bin 0 -> 3062 bytes 3 files changed, 138 insertions(+), 56 deletions(-) create mode 100644 public/assets/github.png diff --git a/components/NavBar/index.js b/components/NavBar/index.js index 447807f..5356d8c 100644 --- a/components/NavBar/index.js +++ b/components/NavBar/index.js @@ -3,9 +3,11 @@ import React, { useState, useRef } from 'react'; import styles from './navbar.module.css'; import Image from 'next/image'; import GenericClosePopUp from '../Close-popup/GenericClosePopUp'; +import { LOGIN_URL } from 'constants.js'; const NavBar = ({ personData: { photo } }) => { const RDSLogo = '/assets/Real-Dev-Squad1x.png'; + const GITHUB_LOGO = '/assets/github.png'; const [toggle, setToggle] = useState(false); const navbarRef = useRef(); GenericClosePopUp(navbarRef, () => { @@ -16,22 +18,58 @@ const NavBar = ({ personData: { photo } }) => { +
+ + + + | + + +
- + ); }; diff --git a/components/NavBar/navbar.module.css b/components/NavBar/navbar.module.css index 86486f7..a4d7fe8 100644 --- a/components/NavBar/navbar.module.css +++ b/components/NavBar/navbar.module.css @@ -1,144 +1,192 @@ -.navBar { +.wrapper { font-family: 'Roboto', sans-serif; - width: 100%; - min-height: 85px; - background-color: #1d1283; + font-weight: 700; + font-size: 16px; + margin-bottom: 25px; } -.navBar ul { - list-style-type: none; - margin: 0; - padding: 0; - overflow: hidden; +.navBar li a { + margin: 10px; + display: block; + border-radius: 0.5rem; + color: #ffffff; + text-align: center; + padding: 19px 16px; + text-decoration: none; } -.navBar ul li:nth-last-child(-n+3){ - float: right; +.navBar li { + float: left; } -.navBar ul li { - float: left; +.navBar li a:hover { + color: #49a82e; } -.navBar li .active { - color: #88D870; - text-decoration: underline; - text-underline-offset: 0.75em; +.navBarMenu { + list-style-type: none; + margin: 0; + padding: 0; + overflow: hidden; + background-color: #1d1283; } -.navBar li .logo { - padding: 20px 20px 15px; +.navBarLogoLi { + padding: 14px 20px; } -.navBar li .btnLogin { - padding-top: 30px; +.navBarLogoLi a { + margin: 0px !important; + padding: 0px !important; } -.navBar li a { - display: block; - color: #ffffff; - font-weight: 700; - text-align: center; - padding: 35px 20px 10px; - text-decoration: none; +.navBarLoginLi { + float: right !important; } -.navBar li a:hover { - color: #87d870; +.navBarLoginLi a { + padding: 16px !important; } -.btnLogin { - font-size: 18px; - float: right; +.navBarLogin, +.homeTab { + display: none; } -.loginBtnText { - font-size: 16px; +.btnLoginText { border-radius: 6px; - padding: 0.3rem; - background-color: #041484; + padding: 5px; + background-color: #1d1283; color: white; cursor: pointer; border: 2px solid white; } -.githubLogo { - margin-left: 5px; - width: 15px; - height: 15px; -} - .userGreet { display: none; - font-size: 18px; color: #ffffff; - text-align: center; - padding: 30px 20px 10px; - text-decoration: none; + margin: 25px; } .userProfilePic { - width: 2em; - height: 2em; + width: 32px; + height: 32px; border-radius: 50%; display: inline; vertical-align: middle; } + .userGreetMsg { - font-size: 1em; display: inline; vertical-align: middle; margin-right: 10px; } -.profilePic { - display: none; - margin-right: 1em; - width: 4em; - height: 4em; +.activeTab { + color: #49a82e !important; + text-decoration: underline !important; + text-decoration-thickness: 3px !important; + text-underline-offset: 10px !important; } -.profilePic>img { - width: 100%; - height: 100%; - border-radius: 50%; - cursor: pointer; + +.hamburger { + display: none; } -.dropdownContent { - position: absolute; - right: 5px; + +.bar { + display: block; + width: 25px; + height: 3px; + margin: 5px auto; + background-color: #fff; } -.dropdownContentHide { - display: none; + +.githubLogo{ + margin-left: 4px; } -.dropdownContent { - position: absolute; - background-color: #f9f9f9; - min-width: 100px; - border: 1px solid rgba(0, 0, 0, 0.699); - z-index: 1; + +.header { + display: flex; + justify-content: center; + align-items: center; + flex-wrap: wrap; + padding-top: 5px; } -.dropdownContent a { - color: black; - padding: 5px 0; + +.link { + padding: 10px; + margin-top: 2px; text-decoration: none; - text-align: center; - font-size: 18px; - border-bottom: 1px solid rgba(0, 0, 0, 0.26); - display: block; + font-weight: bold; + color: #041484; + cursor: pointer; + background: none; + border: none; } -.dropdownContent a:hover { - background-color: #e4e2e2 + +.active { + color: #E30464; } -@media screen and (max-width: 500px) { - .navBar li .logo { - padding: 4px 4px 100%; +@media screen and (max-width: 970px) { + .navBar { + background: #1d1283; + } + + .hamburger { + margin: 20px; + display: inline-block; + cursor: pointer; + } + + .navBarMenu { + background: white; + display: none; + width: 100%; + padding: 10px 0px; + box-shadow: 0px 10px 15px rgba(0, 0, 0, 0.5); } - .navBar ul li:nth-last-child(-n+3){ - float: left; + + .navBarMenu.active, + .homeTab { + display: block; } .navBar li a { - padding: 18px 14px; + padding: 10px 40px; + text-align: left; + color: #1d1283; + text-decoration: none; + display: block; + } + + .navBarLogin { + display: block; + margin: 20px; + position: absolute; + top: 0; + right: 0px; + } + + .navBarLoginLi, + .navBarLogoLi { + display: none; + } + + .activeTab { + text-decoration: none; + } + + .navBar li { + float: none; + } + + .mainBanner, + .logoImg { + margin-top: 40px; + } + + .userGreet { + margin: 0px; } -} \ No newline at end of file +} \ No newline at end of file diff --git a/public/assets/github.png b/public/assets/github.png index 1a3571d26d6be2a4d34d39539f715192719b5a5f..6c3b3cd14aece03ce138e53c6e8ecc4954b17e8a 100644 GIT binary patch literal 13669 zcmZ{LWk6J4@aWwI1OX`pL_kWq1O#MB=~7ghrMp33B}7;nrCS;#rMr>t23@*AV(D)F z_xI)f-}~@Bz}=lYb7s!enRDjsxA*Vl9^pR21pwfYg1q!c0DyuYp#Tmh_|X4E^$C1n zTD*Dt1^~(<@NSH-!0)ss@*m#y?F@37{O=DU$&%~_0Iy^fq~EBy&Fs#*H&Gwo_8d-bm^0(} zz6cJ^=jbGn>>U3H=cp#F&dbTyfpfOZB%sD+IAsJsDD5)lGk)OorF{`hn;DGz?FD_5 z=;h5_?~s$jp3|^x`sJ`^+Vftgk-=+Wi{I(TsX}~{q@2>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)(YO7c%q^DT-DQS;ZBtLOzFkgJ1 zcwy0fvK(=0@RjQ*PKehk-{)IUXLql8RK}Qk*G476OFO?z@o&5_3b!s{@*n4bS*Sb2hJ}HPY7Uc)a zzILjoHEX&d4fSR@_u~)~qJb4;jkgeIf86kC|1|1eUi)Bq=?+$3+O^@1x}*Caryaj) zzDY1T-5gR48UKw(IVg^l@7^b4e|B87S8RlK`e`~{-!7P;BRbEY_a9)9x4!Vnv^DPO z$(I{ME}qD)IaegEuQ2VF7h@!S@3re)1VTk7NCe(9L${ttwv$kt)NLQsz|XT}afD4Ce{#Ge2eR)Vhpcr%93!aP zE%O}zKX|&)^bK!P{Uz2uVa;yA{ZLB8iWp&1K;9c73oF)=YG{g?cEgm>Tg_X9CV}G!OaAOr&p&*Yy$=Q6 zjV;}$4NJurf9+S@Ny=SA7X&jyx&fQAcoa8`pjFZ#Mob#l{Rom0mKiPCnpM7K+b1#4@8w692<-}cSiThi%r!5wi8GP!285V}(^gS>rY%E@MtLKl^< zar`CL8+4bcCORp5<(0;FtpOm zisy#xGqiM5C|pc#o8gDGj_Wa)9n#%GAj752RtRhjb{Se84(}nkXx(TP!Z5Tx6Tk~|_hn)l2w@BQ`(zs2{@ zG~e06aM6c^X<{lpj+y2gr3~M=CK^s8Da}mteG-N*oFf1N;i7cMWC|-IpSY(}JqxmM zx>lROdx@QxxcT0+xmT+mcyViT@hG|*0s5NxUdXeIEMyJ3 zB8b1jRr@ZIFZe3QI>%hMw<{5NUe~qFJday={)21y4}8_EX1(|*wEzGB07*qoM6N<$ Ef`3KCnE(I) diff --git a/styles/Home.module.css b/styles/Home.module.css index 67b5735..3b18c5e 100644 --- a/styles/Home.module.css +++ b/styles/Home.module.css @@ -55,7 +55,7 @@ display: flex; flex-wrap: wrap; justify-content: space-around; - padding-top: 2.5em; + /* padding-top: 2.5em; */ width: 100%; padding-bottom: 100px; overflow: hidden; From 26a5f51d4b69390ec11108333039d05861c2a824 Mon Sep 17 00:00:00 2001 From: Shubham Date: Sun, 19 Dec 2021 15:40:28 +0530 Subject: [PATCH 04/31] Add login url from constants --- components/NavBar/index.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/components/NavBar/index.js b/components/NavBar/index.js index 9198e75..51e6db4 100644 --- a/components/NavBar/index.js +++ b/components/NavBar/index.js @@ -30,10 +30,7 @@ const NavBar = ({ personData: { photo } }) => {
- + -
-
Hello, User!
- +
+
+ {isLoggedIn + ? `Hello, ${userData.firstName} + ` + : `Hello, User!`} +
+
diff --git a/components/NavBar/navbar.module.css b/components/NavBar/navbar.module.css index a4d7fe8..46a16e0 100644 --- a/components/NavBar/navbar.module.css +++ b/components/NavBar/navbar.module.css @@ -63,7 +63,6 @@ } .userGreet { - display: none; color: #ffffff; margin: 25px; } @@ -174,7 +173,7 @@ } .activeTab { - text-decoration: none; + text-decoration: none !important; } .navBar li { diff --git a/constants.js b/constants.js index 394b6db..5ebb4ef 100644 --- a/constants.js +++ b/constants.js @@ -1,6 +1,7 @@ const BASE_IMAGE_URL = 'https://raw.githubusercontent.com/Real-Dev-Squad/website-static/main/members'; const BASE_API_URL = process.env.NEXT_PUBLIC_BASE_API_URL; +const USER_DATA_URL = `${BASE_API_URL}/users/self`; const WALLET_URL = `${BASE_API_URL}/wallet`; const CURRENCIES = { NEELAM: 'neelam', @@ -8,4 +9,11 @@ const CURRENCIES = { }; const LOGIN_URL = 'https://github.com/login/oauth/authorize?client_id=23c78f66ab7964e5ef97'; -export { BASE_IMAGE_URL, BASE_API_URL, WALLET_URL, CURRENCIES, LOGIN_URL }; +export { + BASE_IMAGE_URL, + BASE_API_URL, + USER_DATA_URL, + WALLET_URL, + CURRENCIES, + LOGIN_URL, +}; diff --git a/pages/index.js b/pages/index.js index 5bc012e..b0c7f1b 100644 --- a/pages/index.js +++ b/pages/index.js @@ -20,7 +20,7 @@ export default function Home() { Bank Dashboard - +
diff --git a/styles/globals.css b/styles/globals.css index a960f36..dac0aac 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -67,3 +67,9 @@ footer a { min-height: 92vh; padding-bottom: 50px; } +.d-none{ + display: none !important; +} +.d-block{ + display: block !important; +} \ No newline at end of file From 6f21386d5d69107d7421574a246de8264a287b1e Mon Sep 17 00:00:00 2001 From: Shubham Date: Sun, 19 Dec 2021 18:17:32 +0530 Subject: [PATCH 06/31] Fixed display data for signed-out users --- components/NavBar/index.js | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/components/NavBar/index.js b/components/NavBar/index.js index e7e4c61..2aa59dd 100644 --- a/components/NavBar/index.js +++ b/components/NavBar/index.js @@ -23,19 +23,17 @@ const NavBar = () => { useEffect(() => { const fetchData = async () => { await fetch(USER_DATA_URL, { credentials: 'include' }) - .then((response) => { - if (response.status === 401) { - setIsLoggedIn(false); - } - return response.json(); - }) + .then((response) => response.json()) .then((responseJson) => { if (responseJson.incompleteUserDetails) { return window.location.replace( 'https://my.realdevsquad.com/signup' ); } - setIsLoggedIn(true); + responseJson.statusCode === 401 + ? setIsLoggedIn(false) + : setIsLoggedIn(true); + setUserData({ userName: responseJson.username, firstName: responseJson.first_name, From 6a371bb4a0cfa63acdab9a12a4b6a1d68aadab19 Mon Sep 17 00:00:00 2001 From: Shubham Date: Sun, 19 Dec 2021 18:21:40 +0530 Subject: [PATCH 07/31] Added mobile UI change for currency exchange page --- pages/currency-exchange/currency-exchange.module.css | 3 --- 1 file changed, 3 deletions(-) diff --git a/pages/currency-exchange/currency-exchange.module.css b/pages/currency-exchange/currency-exchange.module.css index 0eebc6b..b50d1e4 100644 --- a/pages/currency-exchange/currency-exchange.module.css +++ b/pages/currency-exchange/currency-exchange.module.css @@ -4,9 +4,6 @@ @media only screen and (max-width: 600px) { /*Big smartphones [426px -> 600px]*/ - .exchange_rates { - margin-top: 50px; - } } @media only screen and (max-width: 425px) { /*Small smartphones [325px -> 425px]*/ From 229305d1b5589c0035fdd09502c7e658f12dda75 Mon Sep 17 00:00:00 2001 From: Shubham Date: Sun, 19 Dec 2021 18:42:37 +0530 Subject: [PATCH 08/31] Added changes to use Link component for anchor tags --- components/NavBar/index.js | 159 +++++++++++++++++++------------------ 1 file changed, 83 insertions(+), 76 deletions(-) diff --git a/components/NavBar/index.js b/components/NavBar/index.js index 2aa59dd..6a52cd5 100644 --- a/components/NavBar/index.js +++ b/components/NavBar/index.js @@ -1,7 +1,7 @@ -import Link from 'next/link'; import React, { useState, useRef, useEffect } from 'react'; import { useRouter } from 'next/router'; import styles from './navbar.module.css'; +import Link from 'next/link'; import Image from 'next/image'; import GenericClosePopUp from '../Close-popup/GenericClosePopUp'; import { USER_DATA_URL, LOGIN_URL } from 'constants.js'; @@ -67,23 +67,24 @@ const NavBar = () => { : `${styles.navBarLogin} d-none` } > - - - + + + + +
{ } >
  • - - home nav logo - + + + home nav logo + +
  • - Home + Home
  • - Welcome + Welcome
  • - Events + Events
  • - Members + Members
  • - - Crypto - + + Crypto +
  • - Status + Status
  • { : `${styles.navBarLoginLi} d-none` } > - - - + + + + + ); From fa950d0a42cf08635f4c84063f710c71f041c85d Mon Sep 17 00:00:00 2001 From: Shubham Date: Sun, 19 Dec 2021 19:43:10 +0530 Subject: [PATCH 09/31] Remove commented code --- styles/Home.module.css | 1 - 1 file changed, 1 deletion(-) diff --git a/styles/Home.module.css b/styles/Home.module.css index 3b18c5e..e05e993 100644 --- a/styles/Home.module.css +++ b/styles/Home.module.css @@ -55,7 +55,6 @@ display: flex; flex-wrap: wrap; justify-content: space-around; - /* padding-top: 2.5em; */ width: 100%; padding-bottom: 100px; overflow: hidden; From 6e23e6afb5a2762ffa0fdbaadfd9be67e17c9532 Mon Sep 17 00:00:00 2001 From: Shubham Date: Tue, 21 Dec 2021 02:05:22 +0530 Subject: [PATCH 10/31] css code refactor changes --- components/NavBar/navbar.module.css | 4 +--- styles/globals.css | 8 ++++---- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/components/NavBar/navbar.module.css b/components/NavBar/navbar.module.css index 46a16e0..334b0c1 100644 --- a/components/NavBar/navbar.module.css +++ b/components/NavBar/navbar.module.css @@ -1,7 +1,5 @@ .wrapper { - font-family: 'Roboto', sans-serif; - font-weight: 700; - font-size: 16px; + font: 700 16px 'Roboto', sans-serif; margin-bottom: 25px; } diff --git a/styles/globals.css b/styles/globals.css index dac0aac..b5febf6 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -4,7 +4,7 @@ body { margin: 0; font-family: -apple-system, BlinkMacSystemFont, Segoe UI, Roboto, Oxygen, Ubuntu, Cantarell, Fira Sans, Droid Sans, Helvetica Neue, sans-serif; - background-color: #e9ebff;; + background-color: #e9ebff; min-height: 100%; } @media only screen and (min-width: 905px) { @@ -67,9 +67,9 @@ footer a { min-height: 92vh; padding-bottom: 50px; } -.d-none{ +.d-none { display: none !important; } -.d-block{ +.d-block { display: block !important; -} \ No newline at end of file +} From 49e06d5f6708dfd42c713a65c1bda061004c7c14 Mon Sep 17 00:00:00 2001 From: Shubham Date: Tue, 21 Dec 2021 02:06:45 +0530 Subject: [PATCH 11/31] Add and load paths from constants file --- components/NavBar/index.js | 16 ++++++++-------- constants.js | 9 +++++++++ 2 files changed, 17 insertions(+), 8 deletions(-) diff --git a/components/NavBar/index.js b/components/NavBar/index.js index 6a52cd5..81ca4ed 100644 --- a/components/NavBar/index.js +++ b/components/NavBar/index.js @@ -4,7 +4,7 @@ import styles from './navbar.module.css'; import Link from 'next/link'; import Image from 'next/image'; import GenericClosePopUp from '../Close-popup/GenericClosePopUp'; -import { USER_DATA_URL, LOGIN_URL } from 'constants.js'; +import { USER_DATA_URL, LOGIN_URL, PATHS } from 'constants.js'; const NavBar = () => { const router = useRouter(); @@ -112,7 +112,7 @@ const NavBar = () => { } >
  • - + {
  • - Home + Home
  • - Welcome + Welcome
  • - Events + Events
  • - Members + Members
  • - + Crypto
  • - Status + Status
  • Date: Tue, 21 Dec 2021 02:22:07 +0530 Subject: [PATCH 12/31] Remove !important property from navbar css --- components/NavBar/navbar.module.css | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/components/NavBar/navbar.module.css b/components/NavBar/navbar.module.css index 334b0c1..5651343 100644 --- a/components/NavBar/navbar.module.css +++ b/components/NavBar/navbar.module.css @@ -33,17 +33,17 @@ padding: 14px 20px; } -.navBarLogoLi a { - margin: 0px !important; - padding: 0px !important; +.navBar li.navBarLogoLi a { + margin: 0px; + padding: 0px; } -.navBarLoginLi { - float: right !important; +.navBar li.navBarLoginLi { + float: right; } -.navBarLoginLi a { - padding: 16px !important; +.navBar li.navBarLoginLi a { + padding: 16px; } .navBarLogin, @@ -79,11 +79,11 @@ margin-right: 10px; } -.activeTab { - color: #49a82e !important; - text-decoration: underline !important; - text-decoration-thickness: 3px !important; - text-underline-offset: 10px !important; +.navBar li a.activeTab { + color: #49a82e; + text-decoration: underline; + text-decoration-thickness: 3px; + text-underline-offset: 10px; } .hamburger { @@ -170,8 +170,8 @@ display: none; } - .activeTab { - text-decoration: none !important; + .navBar li a.activeTab { + text-decoration: none; } .navBar li { From 9f51ca9ebe724cc2f6f54d4a2b08eead67ba6095 Mon Sep 17 00:00:00 2001 From: Shubham Date: Tue, 21 Dec 2021 02:30:39 +0530 Subject: [PATCH 13/31] Refactor css code --- components/NavBar/navbar.module.css | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/components/NavBar/navbar.module.css b/components/NavBar/navbar.module.css index 5651343..e9cbf95 100644 --- a/components/NavBar/navbar.module.css +++ b/components/NavBar/navbar.module.css @@ -98,7 +98,7 @@ background-color: #fff; } -.githubLogo{ +.githubLogo { margin-left: 4px; } @@ -122,7 +122,7 @@ } .active { - color: #E30464; + color: #e30464; } @media screen and (max-width: 970px) { @@ -186,4 +186,4 @@ .userGreet { margin: 0px; } -} \ No newline at end of file +} From 69465650c749ad72f2a9b9f175ed6344e226a563 Mon Sep 17 00:00:00 2001 From: Shubham Date: Tue, 21 Dec 2021 23:27:48 +0530 Subject: [PATCH 14/31] Add UI changes in navbar --- components/NavBar/index.js | 10 ++-------- components/NavBar/navbar.module.css | 4 ++-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/components/NavBar/index.js b/components/NavBar/index.js index 81ca4ed..7f551db 100644 --- a/components/NavBar/index.js +++ b/components/NavBar/index.js @@ -91,10 +91,7 @@ const NavBar = () => { } >
    - {isLoggedIn - ? `Hello, ${userData.firstName} - ` - : `Hello, User!`} + {isLoggedIn ? `Hello, ${userData.firstName}!` : `Hello, User!`}
    { } >
    - {isLoggedIn - ? `Hello, ${userData.firstName} - ` - : `Hello, User!`} + {isLoggedIn ? `Hello, ${userData.firstName}!` : `Hello, User!`}
    Date: Wed, 22 Dec 2021 22:56:20 +0530 Subject: [PATCH 15/31] Add default avatar for user profile picture --- components/NavBar/index.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/components/NavBar/index.js b/components/NavBar/index.js index 7f551db..a97ecda 100644 --- a/components/NavBar/index.js +++ b/components/NavBar/index.js @@ -11,6 +11,7 @@ const NavBar = () => { const RDS_LOGO = '/assets/Real-Dev-Squad1x.png'; const GITHUB_LOGO = '/assets/github.png'; + const DEFAULT_AVATAR = '/assets/default_avatar.jpg'; const [userData, setUserData] = useState({}); const [toggle, setToggle] = useState(false); const [isLoggedIn, setIsLoggedIn] = useState(false); @@ -98,8 +99,9 @@ const NavBar = () => { src={ isLoggedIn ? `https://raw.githubusercontent.com/Real-Dev-Squad/website-static/main/members/${userData.userName}/img.png` - : `` + : `${DEFAULT_AVATAR}` } + alt="Profile Picture" />
  • @@ -182,8 +184,9 @@ const NavBar = () => { src={ isLoggedIn ? `https://raw.githubusercontent.com/Real-Dev-Squad/website-static/main/members/${userData.userName}/img.png` - : `` + : `${DEFAULT_AVATAR}` } + alt="Profile Picture" />
    From c58540a9b0e22e82dec5e72d87ff38f40ab7ad22 Mon Sep 17 00:00:00 2001 From: Shubham Date: Wed, 22 Dec 2021 23:34:47 +0530 Subject: [PATCH 16/31] Add UI changes in navbar --- components/NavBar/navbar.module.css | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/components/NavBar/navbar.module.css b/components/NavBar/navbar.module.css index db1048b..ede23bc 100644 --- a/components/NavBar/navbar.module.css +++ b/components/NavBar/navbar.module.css @@ -62,7 +62,7 @@ .userGreet { color: #ffffff; - margin: 25px; + margin: 23px; } .userProfilePic { @@ -153,8 +153,6 @@ padding: 10px 40px; text-align: left; color: #1d1283; - text-decoration: none; - display: block; } .navBarLogin { From 9ccb6442e10b6eea99be607a5df58a11302e9911 Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 23 Dec 2021 17:04:09 +0530 Subject: [PATCH 17/31] Add UI changes in navbar --- styles/globals.css | 3 --- 1 file changed, 3 deletions(-) diff --git a/styles/globals.css b/styles/globals.css index b5febf6..270cded 100644 --- a/styles/globals.css +++ b/styles/globals.css @@ -70,6 +70,3 @@ footer a { .d-none { display: none !important; } -.d-block { - display: block !important; -} From 9b5d2e188cf9a60c2e8dc09291930659a0422df3 Mon Sep 17 00:00:00 2001 From: Shubham Date: Mon, 27 Dec 2021 13:01:58 +0530 Subject: [PATCH 18/31] Add profile link on greet message & error handling in fetch user --- components/NavBar/index.js | 80 ++++++++++++++++++----------- components/NavBar/navbar.module.css | 9 +++- constants.js | 2 + 3 files changed, 59 insertions(+), 32 deletions(-) diff --git a/components/NavBar/index.js b/components/NavBar/index.js index a97ecda..367b5f1 100644 --- a/components/NavBar/index.js +++ b/components/NavBar/index.js @@ -4,7 +4,12 @@ import styles from './navbar.module.css'; import Link from 'next/link'; import Image from 'next/image'; import GenericClosePopUp from '../Close-popup/GenericClosePopUp'; -import { USER_DATA_URL, LOGIN_URL, PATHS } from 'constants.js'; +import { + USER_DATA_URL, + LOGIN_URL, + USER_PROFILE_URL, + PATHS, +} from 'constants.js'; const NavBar = () => { const router = useRouter(); @@ -24,17 +29,20 @@ const NavBar = () => { useEffect(() => { const fetchData = async () => { await fetch(USER_DATA_URL, { credentials: 'include' }) - .then((response) => response.json()) + .then((response) => { + if (!response.ok) { + setIsLoggedIn(false); + throw new Error(`${response.status} (${response.statusText})`); + } + return response.json(); + }) .then((responseJson) => { if (responseJson.incompleteUserDetails) { return window.location.replace( 'https://my.realdevsquad.com/signup' ); } - responseJson.statusCode === 401 - ? setIsLoggedIn(false) - : setIsLoggedIn(true); - + setIsLoggedIn(true); setUserData({ userName: responseJson.username, firstName: responseJson.first_name, @@ -91,18 +99,24 @@ const NavBar = () => { isLoggedIn ? `${styles.userGreet}` : `${styles.userGreet} d-none` } > -
    - {isLoggedIn ? `Hello, ${userData.firstName}!` : `Hello, User!`} -
    - Profile Picture + + +
    + {isLoggedIn + ? `Hello, ${userData.firstName}!` + : `Hello, User!`} +
    + Profile Picture +
    +
    diff --git a/components/NavBar/navbar.module.css b/components/NavBar/navbar.module.css index ede23bc..2d5fce2 100644 --- a/components/NavBar/navbar.module.css +++ b/components/NavBar/navbar.module.css @@ -42,8 +42,9 @@ float: right; } -.navBar li.navBarLoginLi a { - padding: 12px; +.navBar li.navBarLoginLi .btnLogin { + padding: 0px; + margin: 22px; } .navBarLogin, @@ -65,6 +66,10 @@ margin: 23px; } +.navBarLoginLi .userGreet a{ + padding: 0px; +} + .userProfilePic { width: 32px; height: 32px; diff --git a/constants.js b/constants.js index fe6018d..083f9ea 100644 --- a/constants.js +++ b/constants.js @@ -17,6 +17,7 @@ const PATHS = { }; const LOGIN_URL = 'https://github.com/login/oauth/authorize?client_id=23c78f66ab7964e5ef97'; +const USER_PROFILE_URL = 'https://my.realdevsquad.com/profile'; export { BASE_IMAGE_URL, BASE_API_URL, @@ -24,5 +25,6 @@ export { WALLET_URL, CURRENCIES, LOGIN_URL, + USER_PROFILE_URL, PATHS, }; From c82d48eef4eb9adeaf7d9fa03764e477606e51f4 Mon Sep 17 00:00:00 2001 From: Shubham Date: Tue, 28 Dec 2021 15:51:41 +0530 Subject: [PATCH 19/31] Fix profile url --- components/NavBar/index.js | 11 +++-------- constants.js | 3 +-- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/components/NavBar/index.js b/components/NavBar/index.js index 367b5f1..3eab14c 100644 --- a/components/NavBar/index.js +++ b/components/NavBar/index.js @@ -4,12 +4,7 @@ import styles from './navbar.module.css'; import Link from 'next/link'; import Image from 'next/image'; import GenericClosePopUp from '../Close-popup/GenericClosePopUp'; -import { - USER_DATA_URL, - LOGIN_URL, - USER_PROFILE_URL, - PATHS, -} from 'constants.js'; +import { USER_DATA_URL, LOGIN_URL, PATHS } from 'constants.js'; const NavBar = () => { const router = useRouter(); @@ -99,7 +94,7 @@ const NavBar = () => { isLoggedIn ? `${styles.userGreet}` : `${styles.userGreet} d-none` } > - +
    {isLoggedIn @@ -190,7 +185,7 @@ const NavBar = () => { : `${styles.userGreet} d-none` } > - +
    {isLoggedIn diff --git a/constants.js b/constants.js index 083f9ea..964781f 100644 --- a/constants.js +++ b/constants.js @@ -14,10 +14,10 @@ const PATHS = { MEMBERS: 'https://members.realdevsquad.com/', CRYPTO: 'https://crypto.realdevsquad.com/', STATUS: 'https://status.realdevsquad.com/', + PROFILE: 'https://my.realdevsquad.com/', }; const LOGIN_URL = 'https://github.com/login/oauth/authorize?client_id=23c78f66ab7964e5ef97'; -const USER_PROFILE_URL = 'https://my.realdevsquad.com/profile'; export { BASE_IMAGE_URL, BASE_API_URL, @@ -25,6 +25,5 @@ export { WALLET_URL, CURRENCIES, LOGIN_URL, - USER_PROFILE_URL, PATHS, }; From 71e51c3cd9e6b5ca823555a7b4958fbd587dc355 Mon Sep 17 00:00:00 2001 From: Rohan Raj Gupta <78433013+rohan09-raj@users.noreply.github.com> Date: Sun, 2 Jan 2022 02:21:30 +0530 Subject: [PATCH 20/31] Added .env.development file (#245) Co-authored-by: user.name: "Rohan Raj Gupta --- .env.development | 1 + 1 file changed, 1 insertion(+) create mode 100644 .env.development diff --git a/.env.development b/.env.development new file mode 100644 index 0000000..03d683f --- /dev/null +++ b/.env.development @@ -0,0 +1 @@ +NEXT_PUBLIC_BASE_API_URL=https://api.realdevsquad.com From 204941f9947eff9fd8d86e8f8e17b7a252281c21 Mon Sep 17 00:00:00 2001 From: Shubham Date: Thu, 13 Jan 2022 20:22:29 +0530 Subject: [PATCH 21/31] Improvement in code and changes to use cloudinary images --- components/NavBar/index.js | 89 +++++++++++++------------------------- constants.js | 39 ++++++++++++++--- 2 files changed, 64 insertions(+), 64 deletions(-) diff --git a/components/NavBar/index.js b/components/NavBar/index.js index 3eab14c..1508487 100644 --- a/components/NavBar/index.js +++ b/components/NavBar/index.js @@ -4,7 +4,7 @@ import styles from './navbar.module.css'; import Link from 'next/link'; import Image from 'next/image'; import GenericClosePopUp from '../Close-popup/GenericClosePopUp'; -import { USER_DATA_URL, LOGIN_URL, PATHS } from 'constants.js'; +import { USER_DATA_URL, LOGIN_URL, PATHS, NAV_MENU } from 'constants.js'; const NavBar = () => { const router = useRouter(); @@ -33,14 +33,15 @@ const NavBar = () => { }) .then((responseJson) => { if (responseJson.incompleteUserDetails) { - return window.location.replace( - 'https://my.realdevsquad.com/signup' - ); + window.open('https://my.realdevsquad.com/signup', '_blank'); } setIsLoggedIn(true); setUserData({ userName: responseJson.username, firstName: responseJson.first_name, + profilePicture: responseJson.picture + ? responseJson.picture.url + : DEFAULT_AVATAR, }); }) .catch((err) => { @@ -72,11 +73,7 @@ const NavBar = () => { } > - + -
    +
    - {isLoggedIn - ? `Hello, ${userData.firstName}!` - : `Hello, User!`} + {`Hello ${isLoggedIn ? `${userData.firstName}` : 'User'}!`}
    Profile Picture {
    -
  • - Home -
  • -
  • - Welcome -
  • -
  • - Events -
  • -
  • - Members -
  • -
  • - - Crypto - -
  • -
  • - Status -
  • + {NAV_MENU.map((navTab) => { + return ( +
  • + + + {navTab.name} + + +
  • + ); + })}
  • - +
  • - {NAV_MENU.map((navTab) => { + {NAV_MENU.map((navTab, index) => { return (
  • From fd64c8080b861340c60e30291199222f79b6fab7 Mon Sep 17 00:00:00 2001 From: Shubham Date: Sun, 16 Jan 2022 19:10:57 +0530 Subject: [PATCH 23/31] Replace useEffect by useLayoutEffect for login button --- components/NavBar/index.js | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/components/NavBar/index.js b/components/NavBar/index.js index 0bdb9aa..d0d16ed 100644 --- a/components/NavBar/index.js +++ b/components/NavBar/index.js @@ -1,4 +1,4 @@ -import React, { useState, useRef, useEffect } from 'react'; +import React, { useState, useRef, useEffect, useLayoutEffect } from 'react'; import { useRouter } from 'next/router'; import styles from './navbar.module.css'; import Link from 'next/link'; @@ -15,13 +15,12 @@ const NavBar = () => { const [userData, setUserData] = useState({}); const [toggle, setToggle] = useState(false); const [isLoggedIn, setIsLoggedIn] = useState(false); - const [mountedComponent, setMountedComponent] = useState(false); const navbarRef = useRef(); GenericClosePopUp(navbarRef, () => { setToggle(false); }); - useEffect(() => { + useLayoutEffect(() => { const fetchData = async () => { await fetch(USER_DATA_URL, { credentials: 'include' }) .then((response) => { @@ -47,7 +46,6 @@ const NavBar = () => { .catch((err) => { console.error(err); }); - setMountedComponent(true); }; fetchData(); @@ -65,13 +63,7 @@ const NavBar = () => {
  • -
    +
    -
    +