Skip to content

Commit

Permalink
Feature/integrating-new-signup-flow (Real-Dev-Squad#293)
Browse files Browse the repository at this point in the history
feat: integrating signup flow
  • Loading branch information
ranitasahaa1230 authored Dec 6, 2022
1 parent fc04834 commit 9feaa96
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions components/NavBar/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,12 @@ const NavBar = () => {
const [isLoggedIn, setIsLoggedIn] = useState(false);
const [mountedComponent, setMountedComponent] = useState(false);
const navbarRef = useRef();

let authUrl = LOGIN_URL;
if (typeof window !== 'undefined') {
authUrl = `${LOGIN_URL}&state=${window.location.href}`;
}

GenericClosePopUp(navbarRef, () => {
setToggle(false);
});
Expand Down Expand Up @@ -68,7 +74,7 @@ const NavBar = () => {
mountedComponent ? '' : 'd-none'
}`}
>
<Link href={LOGIN_URL}>
<Link href={authUrl}>
<a className={`${styles.btnLogin} ${isLoggedIn ? 'd-none' : ''}`}>
<button className={styles.btnLoginText}>
Sign In
Expand Down Expand Up @@ -137,7 +143,7 @@ const NavBar = () => {
mountedComponent ? '' : 'd-none'
}`}
>
<Link href={LOGIN_URL}>
<Link href={authUrl}>
<a className={`${styles.btnLogin} ${isLoggedIn ? 'd-none' : ''}`}>
<button className={styles.btnLoginText}>
Sign In With GitHub
Expand Down

0 comments on commit 9feaa96

Please sign in to comment.