Skip to content

Commit 5686504

Browse files
committed
Collection primary buttons
1 parent 6465a30 commit 5686504

File tree

8 files changed

+30
-38
lines changed

8 files changed

+30
-38
lines changed

Diff for: client/common/Icon.jsx

+4-1
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,12 @@ import React from 'react';
55
import lodash from 'lodash';
66

77
const icons = {
8+
sortArrowUp: require('../images/sort-arrow-up.svg'),
9+
sortArrowDown: require('../images/sort-arrow-down.svg'),
810
github: require('../images/github.svg'),
911
google: require('../images/google.svg'),
10-
plusIcon: require('../images/plus-icon.svg'),
12+
plus: require('../images/plus-icon.svg'),
13+
close: require('../images/close.svg'),
1114
};
1215

1316
/*

Diff for: client/images/sort-arrow-down.svg

+4-5
Loading

Diff for: client/images/sort-arrow-up.svg

+4-5
Loading

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ class APIKeyForm extends React.Component {
8787
type="submit"
8888
label="Create new key"
8989
>
90-
<Icon name={Icon.names.plusIcon} />
90+
<Icon name={Icon.names.plus} />
9191
<span>Create</span>
9292
</Button>
9393
</form>

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

+10-10
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ import { connect } from 'react-redux';
77
import { Link } from 'react-router';
88
import { bindActionCreators } from 'redux';
99
import classNames from 'classnames';
10+
11+
import Button from '../../../common/Button';
12+
import Icon from '../../../common/Icon';
1013
import * as ProjectActions from '../../IDE/actions/project';
1114
import * as ProjectsActions from '../../IDE/actions/projects';
1215
import * as CollectionsActions from '../../IDE/actions/collections';
@@ -20,7 +23,6 @@ import Overlay from '../../App/components/Overlay';
2023
import AddToCollectionSketchList from '../../IDE/components/AddToCollectionSketchList';
2124
import CopyableInput from '../../IDE/components/CopyableInput';
2225
import { SketchSearchbar } from '../../IDE/components/Searchbar';
23-
import dropdownArrow from '../../../images/down-arrow.svg';
2426

2527
const arrowUp = require('../../../images/sort-arrow-up.svg');
2628
const arrowDown = require('../../../images/sort-arrow-down.svg');
@@ -51,13 +53,11 @@ const ShareURL = ({ value }) => {
5153

5254
return (
5355
<div className="collection-share" ref={node}>
54-
<button
55-
className="collection-share__button"
56+
<Button
5657
onClick={() => setShowURL(!showURL)}
57-
>
58-
<span>Share</span>
59-
<InlineSVG className="collection-share__arrow" src={dropdownArrow} />
60-
</button>
58+
><span>Share</span>
59+
<Icon name={Icon.names.sortArrowDown} />
60+
</Button>
6161
{ showURL &&
6262
<div className="collection__share-dropdown">
6363
<CopyableInput value={value} label="Link to Collection" />
@@ -263,9 +263,9 @@ class Collection extends React.Component {
263263
</p>
264264
{
265265
this.isOwner() &&
266-
<button className="collection-metadata__add-button" onClick={this.showAddSketches}>
266+
<Button onClick={this.showAddSketches}>
267267
Add Sketch
268-
</button>
268+
</Button>
269269
}
270270
</div>
271271
</div>
@@ -299,7 +299,7 @@ class Collection extends React.Component {
299299
_renderFieldHeader(fieldName, displayName) {
300300
const { field, direction } = this.props.sorting;
301301
const headerClass = classNames({
302-
'sketches-table__header': true,
302+
'arrowDown': true,
303303
'sketches-table__header--selected': field === fieldName
304304
});
305305
return (

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

+2-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ import { bindActionCreators } from 'redux';
66
import * as CollectionsActions from '../../IDE/actions/collections';
77

88
import { generateCollectionName } from '../../../utils/generateRandomName';
9+
import Button from '../../../common/Button';
910

1011
class CollectionCreate extends React.Component {
1112
constructor() {
@@ -81,7 +82,7 @@ class CollectionCreate extends React.Component {
8182
rows="4"
8283
/>
8384
</p>
84-
<input type="submit" disabled={invalid} value="Create collection" aria-label="create collection" />
85+
<Button type="submit" disabled={invalid}>Create collection</Button>
8586
</form>
8687
</div>
8788
</div>

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

-15
Original file line numberDiff line numberDiff line change
@@ -92,16 +92,6 @@
9292
position: relative;
9393
}
9494

95-
.collection-share__button {
96-
@extend %button;
97-
display: flex;
98-
align-items: center;
99-
}
100-
101-
.collection-share__arrow {
102-
margin-left: #{5 / $base-font-size}rem;
103-
}
104-
10595
.collection-share .copyable-input {
10696
padding-bottom: 0;
10797
}
@@ -112,11 +102,6 @@
112102
width: #{350 / $base-font-size}rem;
113103
}
114104

115-
.collection-metadata__add-button {
116-
@extend %button;
117-
flex-grow: 0;
118-
}
119-
120105
.collection-content {
121106
display: flex;
122107
flex-direction: column;

Diff for: client/styles/components/_sketch-list.scss

+5
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@
2828
display: flex;
2929
align-items: center;
3030
height: #{35 / $base-font-size}rem;
31+
32+
& .isvg {
33+
margin-left: #{8 / $base-font-size}rem;
34+
}
35+
3136
& svg {
3237
@include themify() {
3338
fill: getThemifyVariable('inactive-text-color')

0 commit comments

Comments
 (0)