Skip to content

Commit 5f9f942

Browse files
author
Pavithra K
committed
Adds Login with github button
1 parent d50dad0 commit 5f9f942

File tree

3 files changed

+55
-13
lines changed

3 files changed

+55
-13
lines changed

assets/github-mark-32.png

1.53 KB
Loading

components/vote/app-style.scss

Lines changed: 43 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,23 @@
55
.vote-app {
66
margin: 1.5em;
77

8-
&__influence-descriptions {
9-
display: flex;
10-
flex-direction: column;
8+
&__top {
9+
display: flex;
10+
flex-direction: column;
11+
12+
@include break(medium) {
13+
flex-direction: row-reverse;
14+
}
15+
}
1116

12-
@include break(medium) {
13-
flex-direction: row;
14-
}
17+
&__influence-description {
18+
flex: 0 0 80%;
1519
}
1620

21+
&__user-section {
22+
flex: 0 0 20%;
23+
}
24+
1725
&__influence-section {
1826
flex: 0 0 100%;
1927
}
@@ -28,6 +36,35 @@
2836
}
2937
}
3038

39+
&__login-button {
40+
margin: 20px 0;
41+
42+
button {
43+
border: none;
44+
outline: none;
45+
color: getColor(white);
46+
background: getColor(elephant);
47+
padding: 5px 10px 5px 10px;
48+
border-radius: 2px;
49+
font-size: 13px;
50+
cursor: pointer;
51+
52+
&:hover {
53+
background: black;
54+
}
55+
56+
&:active {
57+
background: getColor(elephant)
58+
}
59+
}
60+
61+
img {
62+
vertical-align: middle;
63+
height: 25px;
64+
padding-left: 5px;
65+
}
66+
}
67+
3168
&__self-info {
3269
margin-top: 10px;
3370
}

components/vote/app.jsx

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import SidebarItem from '../sidebar-item/sidebar-item';
44
import * as api from "./api";
55
import VoteButton from './button/button';
66
import Influence from './influence.jsx';
7+
import GithubMark from '../../assets/github-mark-32.png';
78

89
function updateByProperty(array, property, propertyValue, update) {
910
return array.map(item => {
@@ -178,15 +179,19 @@ export default class VoteApp extends React.Component {
178179
return (
179180
<div className="vote-app">
180181
<div className="vote-app__influence">
181-
<div className="vote-app__influence-descriptions">
182-
<Influence className="vote-app__influence-section" type="normal"/>
183-
<Influence className="vote-app__influence-section" type="golden"/>
184-
</div>
185182
<div className="vote-app__influence-disclaimer">
186183
DISCLAIMER: Since this feature is its Alpha stages, the formula for calculating influence may change.
187184
</div>
185+
<div className="vote-app__top">
186+
<div className="vote-app__influence-description">
187+
<Influence className="vote-app__influence-section" type="normal"/>
188+
<Influence className="vote-app__influence-section" type="golden"/>
189+
</div>
190+
<div className="vote-app__user-section">
191+
{this.renderSelf()}
192+
</div>
193+
</div>
188194
</div>
189-
{this.renderSelf()}
190195
{ listInfo && <div>
191196
{voteAppToken && <button className="vote-app__update-button" disabled={inProgress} onClick={() => {
192197
this.updateSelf();
@@ -266,9 +271,9 @@ export default class VoteApp extends React.Component {
266271
if(isFetchingSelf) {
267272
return <div className="vote-app__self-info">Loading user info...</div>;
268273
}
269-
return <div className="vote-app__self-info">You are not logged in. <button onClick={() => {
274+
return <div className="vote-app__login-button"><button onClick={() => {
270275
api.startLogin(window.location + "");
271-
}}>Login with Github</button></div>;
276+
}}>Login with Github <img src={GithubMark}/> </button></div>;
272277
} else {
273278
return <div className="vote-app__self-info">
274279
You are logged in as {selfInfo.login}. <button onClick={() => {

0 commit comments

Comments
 (0)