Skip to content

Commit 7ae02be

Browse files
committed
Update styling of Github and Google Buttons, updating styling of Account Settings
1 parent 6931741 commit 7ae02be

File tree

3 files changed

+27
-42
lines changed

3 files changed

+27
-42
lines changed

client/modules/User/pages/AccountView.jsx

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,27 @@ import { updateSettings, initiateVerification, createApiKey, removeApiKey } from
99
import AccountForm from '../components/AccountForm';
1010
import { validateSettings } from '../../../utils/reduxFormUtils';
1111
import GithubButton from '../components/GithubButton';
12+
import GoogleButton from '../components/GoogleButton';
1213
import APIKeyForm from '../components/APIKeyForm';
1314
import Nav from '../../../components/Nav';
1415

1516
const __process = (typeof global !== 'undefined' ? global : window).process;
1617
const ROOT_URL = __process.env.API_URL;
1718

19+
function SocialLoginPanel(props) {
20+
return (
21+
<React.Fragment>
22+
<AccountForm {...props} />
23+
<h2 className="form-container__divider">Social Login</h2>
24+
<p className="account__social-text">
25+
Use your GitHub or Google account to log into the p5.js Web Editor.
26+
</p>
27+
<GithubButton buttonText="Login with GitHub" />
28+
<GoogleButton buttonText="Login with Google" />
29+
</React.Fragment>
30+
);
31+
}
32+
1833
class AccountView extends React.Component {
1934
componentDidMount() {
2035
document.body.className = this.props.theme;
@@ -44,28 +59,14 @@ class AccountView extends React.Component {
4459
</div>
4560
</TabList>
4661
<TabPanel>
47-
<AccountForm {...this.props} />
48-
<h2 className="form-container__divider">Social Login</h2>
49-
<p className="account__social-text">
50-
Link this account with your GitHub account to allow login from both.
51-
</p>
52-
<GithubButton buttonText="Login with GitHub" />
62+
<SocialLoginPanel {...this.props} />
5363
</TabPanel>
5464
<TabPanel>
5565
<APIKeyForm {...this.props} />
5666
</TabPanel>
5767
</Tabs>
5868
}
59-
{!accessTokensUIEnabled &&
60-
<div>
61-
<AccountForm {...this.props} />
62-
<h2 className="form-container__divider">Social Login</h2>
63-
<p className="account__social-text">
64-
Link this account with your GitHub account to allow login from both.
65-
</p>
66-
<GithubButton buttonText="Login with GitHub" />
67-
</div>
68-
}
69+
{ !accessTokensUIEnabled && <SocialLoginPanel {...this.props} /> }
6970
</section>
7071
</div>
7172
);

client/styles/components/_account.scss

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
color: getThemifyVariable('primary-text-color');
44
background-color: getThemifyVariable('background-color');
55
}
6+
height: 100%;
67
}
78

89
.account-settings {

client/styles/components/_github-button.scss

Lines changed: 9 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
.github-button {
1+
.github-button,
2+
.google-button {
23
@include themify() {
34
@extend %button;
45
& path {
@@ -8,43 +9,25 @@
89
fill: $white;
910
}
1011
&:hover, &:active {
11-
background-color: getThemifyVariable('secondary-text-color');
12-
border-color: getThemifyVariable('secondary-text-color');
12+
color: getThemifyVariable('button-hover-color');
13+
background-color: getThemifyVariable('button-background-hover-color');
14+
border-color: getThemifyVariable('button-background-hover-color');
1315
}
1416
}
1517
width: #{300 / $base-font-size}rem;
1618
display: flex;
1719
justify-content: center;
1820
align-items: center;
21+
22+
& + & {
23+
margin-top: #{10 / $base-font-size}rem;
24+
}
1925
}
2026

2127
.github-icon {
2228
margin-right: #{10 / $base-font-size}rem;
2329
}
2430

25-
26-
.google-button {
27-
@include themify() {
28-
@extend %button;
29-
& path {
30-
color: getThemifyVariable('primary-text-color');
31-
}
32-
&:hover path, &:active path {
33-
fill: $white;
34-
}
35-
&:hover, &:active {
36-
background-color: getThemifyVariable('secondary-text-color');
37-
border-color: getThemifyVariable('secondary-text-color');
38-
}
39-
}
40-
margin-top: #{4 / $base-font-size}rem;
41-
display: flex;
42-
flex-direction: row;
43-
justify-content: center;
44-
align-items: center;
45-
width: #{300 / $base-font-size}rem;
46-
}
47-
4831
.google-icon {
4932
width: #{32 / $base-font-size}rem;
5033
height: #{32 / $base-font-size}rem;

0 commit comments

Comments
 (0)