Skip to content

Commit

Permalink
Merge pull request processing#2368 from adityagarg06/add_styled_compo…
Browse files Browse the repository at this point in the history
…nent_collection_list

Added styled component to AddToCollectionList component
  • Loading branch information
lindapaiste authored Aug 13, 2023
2 parents e668ae4 + 9c30c30 commit 0bd139b
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 21 deletions.
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

0 comments on commit 0bd139b

Please sign in to comment.