Skip to content

Commit 98e5616

Browse files
authored
Merge pull request #161 from akankshat05/vote
fixed vote button
2 parents 1453a22 + 5f2f5c8 commit 98e5616

File tree

2 files changed

+19
-7
lines changed

2 files changed

+19
-7
lines changed

src/assets/scss/components/vote.scss

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -27,18 +27,21 @@
2727

2828
.vote-button {
2929
color: $eos-white;
30+
cursor: pointer;
3031
font-weight: bold;
3132
margin: 4px 8px;
3233

33-
&-clickable {
34-
cursor: pointer;
35-
}
36-
3734
.eos-icons {
3835
margin: 0px 4px 0px 4px;
3936
}
4037
}
4138

39+
.vote-link {
40+
color: $eos-white;
41+
font-weight: bold;
42+
text-decoration: none;
43+
}
44+
4245
@media (max-width: 900px) {
4346
.vote-wrapper {
4447
align-items: center;

src/components/Vote.js

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,13 +73,22 @@ const Vote = (props) => {
7373
{votes}
7474
</div>
7575
<div
76-
className={`vote-button ${userId ? 'vote-button-clickable' : ''}`}
76+
className='vote-button'
7777
onClick={() => {
7878
if (userId && !voteClicked) updateVote(story)
7979
}}
8080
>
81-
<EOS_THUMB_UP className='eos-icons' color='white' />
82-
Vote
81+
{!userId ? (
82+
<Link className='vote-link' to='/login'>
83+
<EOS_THUMB_UP className='eos-icons' color='white' />
84+
Vote
85+
</Link>
86+
) : (
87+
<>
88+
<EOS_THUMB_UP className='eos-icons' color='white' />
89+
Vote
90+
</>
91+
)}
8392
</div>
8493
{isOpen && (
8594
<Modal

0 commit comments

Comments
 (0)