Skip to content
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

Added styled component to AddToCollectionList component #2368

Merged
Changes from 1 commit
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
26 changes: 21 additions & 5 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,26 @@ 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;

const CollectionAddSketchWrapper = styled.div`
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const CollectionAddSketchWrapper = styled.div`
export const CollectionAddSketchWrapper = styled.div`

&&& {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It doesn't really matter but I suspect that you'd be fine without the &&&?

min-width: ${remSize(600)};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
min-width: ${remSize(600)};
width: ${remSize(600)};
max-width: 100%;

overflow: auto;
}
`;

const QuickAddWrapper = styled.div`
&&& {
min-width: ${remSize(600)};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
min-width: ${remSize(600)};
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 +101,15 @@ 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