Skip to content

Added styled component to AddToCollectionList component #2368

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions client/modules/IDE/components/AddToCollectionList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Helmet } from 'react-helmet';
import { connect } from 'react-redux';
import { bindActionCreators } from 'redux';
import { withTranslation } from 'react-i18next';

import styled from 'styled-components';
import * as ProjectActions from '../actions/project';
import * as ProjectsActions from '../actions/projects';
import * as CollectionsActions from '../actions/collections';
Expand All @@ -13,10 +13,24 @@ import * as SortingActions from '../actions/sorting';
import getSortedCollections from '../selectors/collections';
import Loader from '../../App/components/loader';
import QuickAddList from './QuickAddList';
import { remSize } from '../../../theme';

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

export const CollectionAddSketchWrapper = styled.div`
width: ${remSize(600)};
max-width: 100%;
overflow: auto;
`;

export const QuickAddWrapper = styled.div`
width: ${remSize(600)};
max-width: 100%;
padding: ${remSize(24)};
height: 100%;
`;

class CollectionList extends React.Component {
constructor(props) {
super(props);
Expand Down Expand Up @@ -85,15 +99,14 @@ class CollectionList extends React.Component {
}

return (
<div className="collection-add-sketch">
<div className="quick-add-wrapper">
<CollectionAddSketchWrapper>
<QuickAddWrapper>
<Helmet>
<title>{this.getTitle()}</title>
</Helmet>

{content}
</div>
</div>
</QuickAddWrapper>
</CollectionAddSketchWrapper>
);
}
}
Expand Down
12 changes: 8 additions & 4 deletions client/modules/IDE/components/AddToCollectionSketchList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ import * as SortingActions from '../actions/sorting';
import getSortedSketches from '../selectors/projects';
import Loader from '../../App/components/loader';
import QuickAddList from './QuickAddList';
import {
CollectionAddSketchWrapper,
QuickAddWrapper
} from './AddToCollectionList';

class SketchList extends React.Component {
constructor(props) {
Expand Down Expand Up @@ -81,14 +85,14 @@ class SketchList extends React.Component {
}

return (
<div className="collection-add-sketch">
<div className="quick-add-wrapper">
<CollectionAddSketchWrapper>
<QuickAddWrapper>
<Helmet>
<title>{this.getSketchesTitle()}</title>
</Helmet>
{content}
</div>
</div>
</QuickAddWrapper>
</CollectionAddSketchWrapper>
);
}
}
Expand Down
5 changes: 0 additions & 5 deletions client/styles/components/_collection.scss
Original file line number Diff line number Diff line change
Expand Up @@ -84,11 +84,6 @@
width: 100%;
}

.collection-add-sketch {
min-width: #{600 / $base-font-size}rem;
overflow: auto;
}

.collection-share {
text-align: right;
position: relative;
Expand Down
6 changes: 0 additions & 6 deletions client/styles/components/_quick-add.scss
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
.quick-add-wrapper {
min-width: #{600 / $base-font-size}rem;
padding: #{24 / $base-font-size}rem;
height: 100%;
}

.quick-add {
width: auto;
overflow-y: auto;
Expand Down