Skip to content

Commit 8fc6ded

Browse files
committed
Added styled component to AddToCollectionSketchList and updated the css code for responsiveness
1 parent d99e25a commit 8fc6ded

File tree

4 files changed

+26
-25
lines changed

4 files changed

+26
-25
lines changed

client/modules/IDE/components/AddToCollectionList.jsx

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,18 +19,16 @@ const projectInCollection = (project, collection) =>
1919
collection.items.find((item) => item.projectId === project.id) != null;
2020

2121
const CollectionAddSketchWrapper = styled.div`
22-
&&& {
23-
min-width: ${remSize(600)};
24-
overflow: auto;
25-
}
22+
width: ${remSize(600)};
23+
max-width: 100%;
24+
overflow: auto;
2625
`;
2726

2827
const QuickAddWrapper = styled.div`
29-
&&& {
30-
min-width: ${remSize(600)};
31-
padding: ${remSize(24)};
32-
height: 100%;
33-
}
28+
width: ${remSize(600)};
29+
max-width: 100%;
30+
padding: ${remSize(24)};
31+
height: 100%;
3432
`;
3533

3634
class CollectionList extends React.Component {
@@ -106,7 +104,6 @@ class CollectionList extends React.Component {
106104
<Helmet>
107105
<title>{this.getTitle()}</title>
108106
</Helmet>
109-
110107
{content}
111108
</QuickAddWrapper>
112109
</CollectionAddSketchWrapper>

client/modules/IDE/components/AddToCollectionSketchList.jsx

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,28 @@ import { connect } from 'react-redux';
55
import { bindActionCreators } from 'redux';
66
import { withTranslation } from 'react-i18next';
77
// import find from 'lodash/find';
8+
import styled from 'styled-components';
89
import * as ProjectsActions from '../actions/projects';
910
import * as CollectionsActions from '../actions/collections';
1011
import * as ToastActions from '../actions/toast';
1112
import * as SortingActions from '../actions/sorting';
1213
import getSortedSketches from '../selectors/projects';
1314
import Loader from '../../App/components/loader';
1415
import QuickAddList from './QuickAddList';
16+
import { remSize } from '../../../theme';
17+
18+
const CollectionAddSketchWrapper = styled.div`
19+
width: ${remSize(600)};
20+
max-width: 100%;
21+
overflow: auto;
22+
`;
23+
24+
const QuickAddWrapper = styled.div`
25+
width: ${remSize(600)};
26+
max-width: 100%;
27+
padding: ${remSize(24)};
28+
height: 100%;
29+
`;
1530

1631
class SketchList extends React.Component {
1732
constructor(props) {
@@ -81,14 +96,14 @@ class SketchList extends React.Component {
8196
}
8297

8398
return (
84-
<div className="collection-add-sketch">
85-
<div className="quick-add-wrapper">
99+
<CollectionAddSketchWrapper>
100+
<QuickAddWrapper>
86101
<Helmet>
87102
<title>{this.getSketchesTitle()}</title>
88103
</Helmet>
89104
{content}
90-
</div>
91-
</div>
105+
</QuickAddWrapper>
106+
</CollectionAddSketchWrapper>
92107
);
93108
}
94109
}

client/styles/components/_collection.scss

Lines changed: 0 additions & 5 deletions
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

Lines changed: 0 additions & 6 deletions
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)