1
1
import React from 'react' ;
2
2
3
3
export default ( props ) => {
4
- let { value, myValue, maxDown, maxUp, color, onVote, className } = props ;
4
+ let { value, myValue, maxDown, maxUp, color, onVote, className, isLoginActive } = props ;
5
+ let { voteAppToken} = localStorage ;
5
6
6
7
let click = ( e , n ) => {
7
8
onVote ( Math . min ( maxUp , Math . max ( n , - maxDown ) ) ) ;
@@ -34,7 +35,7 @@ export default (props) => {
34
35
}
35
36
} ;
36
37
37
- return < div className = "vote-button" style = { { color : color } } >
38
+ return voteAppToken ? ( < div className = "vote-button" style = { { color : color } } >
38
39
{ makeTriangle ( Infinity , triangleUp , 30 , 11 ) }
39
40
{ makeTriangle ( 10 , triangleUp , 20 , 2 ) }
40
41
{ makeTriangle ( 1 , triangleUp , 15 , 1 ) }
@@ -47,7 +48,11 @@ export default (props) => {
47
48
{ makeTriangle ( - 1 , triangleDown , 15 , 1 ) }
48
49
{ makeTriangle ( - 10 , triangleDown , 20 , 2 ) }
49
50
{ makeTriangle ( - Infinity , triangleDown , 30 , 11 ) }
50
- </ div > ;
51
+ </ div > ) : ( < div className = "vote-button" style = { { color : color } } >
52
+ < div className = "vote-button__value" title = { value + " was voted in total by all users." } >
53
+ < span className = { className } > { value } </ span >
54
+ </ div >
55
+ </ div > ) ;
51
56
} ;
52
57
53
58
function triangleUp ( { color, size} ) {
0 commit comments