Skip to content

Commit 0bd139b

Browse files
authored
Merge pull request #2368 from adityagarg06/add_styled_component_collection_list
Added styled component to AddToCollectionList component
2 parents e668ae4 + 9c30c30 commit 0bd139b

File tree

4 files changed

+27
-21
lines changed

4 files changed

+27
-21
lines changed

client/modules/IDE/components/AddToCollectionList.jsx

+19-6
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Helmet } from 'react-helmet';
44
import { connect } from 'react-redux';
55
import { bindActionCreators } from 'redux';
66
import { withTranslation } from 'react-i18next';
7-
7+
import styled from 'styled-components';
88
import * as ProjectActions from '../actions/project';
99
import * as ProjectsActions from '../actions/projects';
1010
import * as CollectionsActions from '../actions/collections';
@@ -13,10 +13,24 @@ import * as SortingActions from '../actions/sorting';
1313
import getSortedCollections from '../selectors/collections';
1414
import Loader from '../../App/components/loader';
1515
import QuickAddList from './QuickAddList';
16+
import { remSize } from '../../../theme';
1617

1718
const projectInCollection = (project, collection) =>
1819
collection.items.find((item) => item.projectId === project.id) != null;
1920

21+
export const CollectionAddSketchWrapper = styled.div`
22+
width: ${remSize(600)};
23+
max-width: 100%;
24+
overflow: auto;
25+
`;
26+
27+
export const QuickAddWrapper = styled.div`
28+
width: ${remSize(600)};
29+
max-width: 100%;
30+
padding: ${remSize(24)};
31+
height: 100%;
32+
`;
33+
2034
class CollectionList extends React.Component {
2135
constructor(props) {
2236
super(props);
@@ -85,15 +99,14 @@ class CollectionList extends React.Component {
8599
}
86100

87101
return (
88-
<div className="collection-add-sketch">
89-
<div className="quick-add-wrapper">
102+
<CollectionAddSketchWrapper>
103+
<QuickAddWrapper>
90104
<Helmet>
91105
<title>{this.getTitle()}</title>
92106
</Helmet>
93-
94107
{content}
95-
</div>
96-
</div>
108+
</QuickAddWrapper>
109+
</CollectionAddSketchWrapper>
97110
);
98111
}
99112
}

client/modules/IDE/components/AddToCollectionSketchList.jsx

+8-4
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ import * as SortingActions from '../actions/sorting';
1212
import getSortedSketches from '../selectors/projects';
1313
import Loader from '../../App/components/loader';
1414
import QuickAddList from './QuickAddList';
15+
import {
16+
CollectionAddSketchWrapper,
17+
QuickAddWrapper
18+
} from './AddToCollectionList';
1519

1620
class SketchList extends React.Component {
1721
constructor(props) {
@@ -81,14 +85,14 @@ class SketchList extends React.Component {
8185
}
8286

8387
return (
84-
<div className="collection-add-sketch">
85-
<div className="quick-add-wrapper">
88+
<CollectionAddSketchWrapper>
89+
<QuickAddWrapper>
8690
<Helmet>
8791
<title>{this.getSketchesTitle()}</title>
8892
</Helmet>
8993
{content}
90-
</div>
91-
</div>
94+
</QuickAddWrapper>
95+
</CollectionAddSketchWrapper>
9296
);
9397
}
9498
}

client/styles/components/_collection.scss

-5
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,6 @@
8484
width: 100%;
8585
}
8686

87-
.collection-add-sketch {
88-
min-width: #{600 / $base-font-size}rem;
89-
overflow: auto;
90-
}
91-
9287
.collection-share {
9388
text-align: right;
9489
position: relative;

client/styles/components/_quick-add.scss

-6
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,3 @@
1-
.quick-add-wrapper {
2-
min-width: #{600 / $base-font-size}rem;
3-
padding: #{24 / $base-font-size}rem;
4-
height: 100%;
5-
}
6-
71
.quick-add {
82
width: auto;
93
overflow-y: auto;

0 commit comments

Comments
 (0)