-
Notifications
You must be signed in to change notification settings - Fork 46
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
Prompting Unauthenticated Users to sign in first to upvote a story #163
base: main
Are you sure you want to change the base?
Conversation
src/components/AuthWrapper.jsx
Outdated
@@ -4,6 +4,7 @@ import LanguageDropdown from './LanguageDropdown' | |||
import eosIcon from '../assets/images/user-story-logo.svg' | |||
import SocialMediaLinks from '../components/SocialMediaLinks' | |||
import { EOS_COPYRIGHT } from 'eos-icons-react' | |||
import { Link } from '@reach/router' |
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.
this issue seems to already have been addressed in #162
Please remove these changes from this PR so that the other one can be merged
src/components/StoryPageTimeline.js
Outdated
<Modal | ||
content={ | ||
<> | ||
<div> |
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.
try not to use too many empty divs that don't even have classes. Titles are display block elements, they don't need to be encapsulated in divs
src/components/Vote.js
Outdated
if (userId && !voteClicked) { | ||
updateVote(story) | ||
} else if (!userId) { | ||
console.log('Not loged In') |
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.
Avoid leaving console logs in production. They don't add value to users
src/components/StoryPageTimeline.js
Outdated
if (userId && !voteClicked) updateVote(story) | ||
if (userId && !voteClicked) { | ||
updateVote(story) | ||
console.log('even after being logged') |
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.
Avoid leaving console logs in production. They don't add value to users
Issue Number
fixes #150
Describe the changes you've made
I have used a state to look for whether the modal should be shown or not, and have set this to true if the user is not sign-in/authenticated and tries to upvote for the story. I've used the Modal component (which was already there in the project) to prompt the user. And have made the upvote button clickable and hovering mouse on it to pointer, in case of unauthenticated user (which was not so earlier)
Describe if there is any unusual behavior (Any Warning) of your code(Write
NA
if there isn't)NA
Additional context (OPTIONAL)
Test plan (OPTIONAL)
A good test plan should give instructions that someone else can easily follow.
Logout yourself (if already login) and then go to any of the story available and try to click on upvote button and you should see a prompting modal asking you to sign in first to upvote for the story.
Checklist
Provide a Deployed link of route/page that needs to review
Preview: Deploy preview link here with the appropriate route