Skip to content

Commit 0d8aeed

Browse files
committed
Convert user account pages to use Button
1 parent 428fee2 commit 0d8aeed

File tree

6 files changed

+28
-31
lines changed

6 files changed

+28
-31
lines changed

Diff for: client/common/Icon.jsx

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import lodash from 'lodash';
77
const icons = {
88
github: require('../images/github.svg'),
99
google: require('../images/google.svg'),
10+
plusIcon: require('../images/plus-icon.svg'),
1011
};
1112

1213
/*

Diff for: client/modules/User/components/APIKeyForm.jsx

+8-7
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,12 @@ import PropTypes from 'prop-types';
22
import React from 'react';
33
import InlineSVG from 'react-inlinesvg';
44

5+
import Button from '../../../common/Button';
6+
import Icon from '../../../common/Icon';
57
import CopyableInput from '../../IDE/components/CopyableInput';
68

79
import APIKeyList from './APIKeyList';
810

9-
const plusIcon = require('../../../images/plus-icon.svg');
10-
1111
export const APIKeyPropType = PropTypes.shape({
1212
id: PropTypes.object.isRequired,
1313
token: PropTypes.object,
@@ -81,14 +81,15 @@ class APIKeyForm extends React.Component {
8181
type="text"
8282
value={this.state.keyLabel}
8383
/>
84-
<button
85-
className="api-key-form__create-button"
84+
<Button
85+
8686
disabled={this.state.keyLabel === ''}
8787
type="submit"
88+
label="Create new key"
8889
>
89-
<InlineSVG src={plusIcon} className="api-key-form__create-icon" />
90-
Create
91-
</button>
90+
<Icon name={Icon.names.plusIcon} />
91+
<span>Create</span>
92+
</Button>
9293
</form>
9394

9495
{

Diff for: client/modules/User/components/AccountForm.jsx

+6-7
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import PropTypes from 'prop-types';
22
import React from 'react';
33
import { domOnlyProps } from '../../../utils/reduxFormUtils';
4+
import Button from '../../../common/Button';
45

56
function AccountForm(props) {
67
const {
@@ -44,11 +45,10 @@ function AccountForm(props) {
4445
<span className="form__status"> Confirmation sent, check your email.</span>
4546
) :
4647
(
47-
<button
48-
className="form__action"
48+
<Button
4949
onClick={handleInitiateVerification}
5050
>Resend confirmation email
51-
</button>
51+
</Button>
5252
)
5353
}
5454
</p>
@@ -92,12 +92,11 @@ function AccountForm(props) {
9292
/>
9393
{newPassword.touched && newPassword.error && <span className="form-error">{newPassword.error}</span>}
9494
</p>
95-
<input
95+
<Button
9696
type="submit"
9797
disabled={submitting || invalid || pristine}
98-
value="Save All Settings"
99-
aria-label="updateSettings"
100-
/>
98+
>Save All Settings
99+
</Button>
101100
</form>
102101
);
103102
}

Diff for: client/modules/User/pages/AccountView.jsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,10 @@ function SocialLoginPanel(props) {
2323
<p className="account__social-text">
2424
Use your GitHub or Google account to log into the p5.js Web Editor.
2525
</p>
26-
<SocialAuthButton service={SocialAuthButton.services.github} />
27-
<SocialAuthButton service={SocialAuthButton.services.google} />
26+
<div className="account__social-stack">
27+
<SocialAuthButton service={SocialAuthButton.services.github} />
28+
<SocialAuthButton service={SocialAuthButton.services.google} />
29+
</div>
2830
</React.Fragment>
2931
);
3032
}

Diff for: client/styles/components/_account.scss

+9
Original file line numberDiff line numberDiff line change
@@ -20,3 +20,12 @@
2020
.account__social-text {
2121
padding-bottom: #{15 / $base-font-size}rem;
2222
}
23+
24+
25+
.account__social-stack {
26+
display: flex;
27+
}
28+
29+
.account__social-stack > * {
30+
margin-right: #{15 / $base-font-size}rem;
31+
}

Diff for: client/styles/components/_api-key.scss

-15
Original file line numberDiff line numberDiff line change
@@ -17,21 +17,6 @@
1717
color: getThemifyVariable('heading-text-color');
1818
}
1919
}
20-
21-
.api-key-form__create-button {
22-
display: flex;
23-
justify-content: center;
24-
align-items: center;
25-
}
26-
27-
.api-key-form__create-icon {
28-
display: flex;
29-
}
30-
31-
.api-key-form__create-button .isvg {
32-
padding-right: 10px;
33-
}
34-
3520
.api-key-list {
3621
display: block;
3722
max-width: 900px;

0 commit comments

Comments
 (0)