Skip to content
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

Open
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

shrinishant
Copy link

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

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • All new and existing tests passed.
  • The title of my pull request is a short description of the requested changes.

Provide a Deployed link of route/page that needs to review

Preview: Deploy preview link here with the appropriate route

@shrinishant shrinishant changed the title Nishant Prompting Unauthenticated Users to sign in first to upvote a story Mar 11, 2022
@@ -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'
Copy link
Member

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

<Modal
content={
<>
<div>
Copy link
Member

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

if (userId && !voteClicked) {
updateVote(story)
} else if (!userId) {
console.log('Not loged In')
Copy link
Member

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

if (userId && !voteClicked) updateVote(story)
if (userId && !voteClicked) {
updateVote(story)
console.log('even after being logged')
Copy link
Member

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Prompting Unauthenticated Users to sign in first to upvote a story
2 participants