-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Make the "Become a Mentor" button responsive. #72
Merged
Merged
Changes from 20 commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
638fccb
Corrected npm start command in README.md for local development
mayura-andrew 04537ab
Merge branch 'sef-global:main' into main
mayura-andrew 638ec27
Fixed README
mayura-andrew 0a2cddf
Merge branch 'sef-global:main' into main
mayura-andrew 335507c
Fixed Facebook icon in nav bar and Apply button issue
mayura-andrew f6fea0b
Fixed Apply button and See more button used TailwindCSS
mayura-andrew 92a661b
Backend API URL Problem
mayura-andrew 32595c8
Fixed Apply button and See more buttons (Removed template iterals)
mayura-andrew c26820e
Connect with Backend API
mayura-andrew 1e5b97f
added \
mayura-andrew a9666e9
Added environment variable to connect backend api
mayura-andrew dfc7028
Fixed typos in README
mayura-andrew 4f86fd0
added .end to .gitignore
mayura-andrew 0bf8c9f
Merge branch 'main' into main
mayura-andrew 5fc0a50
fixed typos in example.env file
mayura-andrew c07988c
changed API_URL setup
mayura-andrew 0516513
Fixed example.env
mayura-andrew 2459152
Stop tracking .env file
mayura-andrew 46118e6
fixed "Become a menter" button using Tailwind
mayura-andrew 4df0cda
Merge branch 'sef-global:main' into main
mayura-andrew 16c2662
Fixed that "Become a Mentor" button issue in MenuDrawer
mayura-andrew 66bfb48
Fixed LoginModal mobile responsiveness
mayura-andrew File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -1,4 +1,4 @@ | ||||
import React from 'react'; | ||||
import React, { useContext, useState } from 'react'; | ||||
|
||||
import { | ||||
TwitterOutlined, | ||||
|
@@ -8,6 +8,12 @@ | |||
} from '@ant-design/icons'; | ||||
import { Avatar, Button, Drawer, Space, Typography } from 'antd'; | ||||
|
||||
import { | ||||
UserContext, | ||||
type UserContextType, | ||||
} from './../../../contexts/UserContext'; | ||||
import { useNavigate } from 'react-router-dom'; | ||||
|
||||
import styles from './MenuDrawer.module.css'; | ||||
|
||||
const { Text } = Typography; | ||||
|
@@ -18,6 +24,11 @@ | |||
} | ||||
|
||||
const MenuDrawer: React.FC<MenuDrawerProps> = ({ openMenu, setOpenMenu }) => { | ||||
const [isLoginModalVisible, setIsLoginModalVisible] = useState(false); | ||||
const navigate = useNavigate(); | ||||
|
||||
const { user } = useContext(UserContext) as UserContextType; | ||||
|
||||
const handleOpenMenu = (): boolean => { | ||||
return openMenu; | ||||
}; | ||||
|
@@ -26,6 +37,19 @@ | |||
setOpenMenu(false); | ||||
}; | ||||
|
||||
const handleLoginModalOpen = (): void => { | ||||
setIsLoginModalVisible(true); | ||||
}; | ||||
|
||||
const handleMentorRegistration = (): void => { | ||||
console.log('Clicked'); | ||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||
if (user === null) { | ||||
handleLoginModalOpen(); | ||||
} else { | ||||
navigate('/mentor-registration'); | ||||
} | ||||
}; | ||||
|
||||
return ( | ||||
<Drawer | ||||
open={handleOpenMenu()} | ||||
|
@@ -50,6 +74,12 @@ | |||
<a href="" target="_blank" rel="noreferrer"> | ||||
<Text className={styles.antTypography}>Join Us</Text> | ||||
</a> | ||||
<Button | ||||
className="mr-5 mb-5 w-40 h-9 font-sans text-black-400 py-1 px-4 rounded" | ||||
onClick={handleMentorRegistration} | ||||
> | ||||
Become a Mentor | ||||
</Button> | ||||
<Space direction="horizontal" size={20}> | ||||
<a | ||||
href="https://www.facebook.com/sustainableeducationfoundation/" | ||||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need it use openMenu, setOpenMenu
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Screencast_20240114_003851.webm
Fixed that issue :)