Skip to content

Commit 45a4e54

Browse files
authored
Merge pull request #1557 from SundeepChand/bugfix/popupstyle
Fixed "Add Sketch to Collection" Popup styling bug on Dark and High Contrast themes
2 parents 8308eda + c98fe59 commit 45a4e54

File tree

6 files changed

+35
-24
lines changed

6 files changed

+35
-24
lines changed

client/modules/IDE/components/AddToCollectionList.jsx

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import Loader from '../../App/components/loader';
1414
import QuickAddList from './QuickAddList';
1515

1616
const projectInCollection = (project, collection) =>
17-
collection.items.find(item => item.project.id === project.id) != null;
17+
collection.items.find(item => item.projectId === project.id) != null;
1818

1919
class CollectionList extends React.Component {
2020
constructor(props) {
@@ -81,12 +81,14 @@ class CollectionList extends React.Component {
8181
}
8282

8383
return (
84-
<div className="quick-add-wrapper">
85-
<Helmet>
86-
<title>{this.getTitle()}</title>
87-
</Helmet>
88-
89-
{content}
84+
<div className="collection-add-sketch">
85+
<div className="quick-add-wrapper">
86+
<Helmet>
87+
<title>{this.getTitle()}</title>
88+
</Helmet>
89+
90+
{content}
91+
</div>
9092
</div>
9193
);
9294
}

client/modules/IDE/components/AddToCollectionSketchList.jsx

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,13 @@ class SketchList extends React.Component {
7272
}
7373

7474
return (
75-
<div className="quick-add-wrapper">
76-
<Helmet>
77-
<title>{this.getSketchesTitle()}</title>
78-
</Helmet>
79-
{content}
75+
<div className="collection-add-sketch">
76+
<div className="quick-add-wrapper">
77+
<Helmet>
78+
<title>{this.getSketchesTitle()}</title>
79+
</Helmet>
80+
{content}
81+
</div>
8082
</div>
8183
);
8284
}

client/modules/IDE/components/CollectionList/CollectionList.jsx

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -170,12 +170,10 @@ class CollectionList extends React.Component {
170170
closeOverlay={this.hideAddSketches}
171171
isFixedHeight
172172
>
173-
<div className="collection-add-sketch">
174-
<AddToCollectionSketchList
175-
username={this.props.username}
176-
collection={find(this.props.collections, { id: this.state.addingSketchesToCollectionId })}
177-
/>
178-
</div>
173+
<AddToCollectionSketchList
174+
username={this.props.username}
175+
collection={find(this.props.collections, { id: this.state.addingSketchesToCollectionId })}
176+
/>
179177
</Overlay>
180178
)
181179
}

client/modules/User/components/Collection.jsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -398,9 +398,10 @@ class Collection extends React.Component {
398398
closeOverlay={this.hideAddSketches}
399399
isFixedHeight
400400
>
401-
<div className="collection-add-sketch">
402-
<AddToCollectionSketchList username={this.props.username} collection={this.props.collection} />
403-
</div>
401+
<AddToCollectionSketchList
402+
username={this.props.username}
403+
collection={this.props.collection}
404+
/>
404405
</Overlay>
405406
)
406407
}

client/styles/abstracts/_variables.scss

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ $themes: (
8888
nav-border-color: $middle-light,
8989
error-color: $p5js-pink,
9090
table-row-stripe-color: $medium-light,
91+
table-row-stripe-color-alternate: $medium-light,
9192
codefold-icon-open: url(../images/triangle-arrow-down.svg?byUrl),
9293
codefold-icon-closed: url(../images/triangle-arrow-right.svg?byUrl),
9394

@@ -163,6 +164,7 @@ $themes: (
163164
nav-border-color: $middle-dark,
164165
error-color: $p5js-pink,
165166
table-row-stripe-color: $dark,
167+
table-row-stripe-color-alternate: $darker,
166168
codefold-icon-open: url(../images/triangle-arrow-down-white.svg?byUrl),
167169
codefold-icon-closed: url(../images/triangle-arrow-right-white.svg?byUrl),
168170

@@ -236,6 +238,7 @@ $themes: (
236238
nav-border-color: $middle-dark,
237239
error-color: $p5-contrast-pink,
238240
table-row-stripe-color: $dark,
241+
table-row-stripe-color-alternate: $darker,
239242
codefold-icon-open: url(../images/triangle-arrow-down-white.svg?byUrl),
240243
codefold-icon-closed: url(../images/triangle-arrow-right-white.svg?byUrl),
241244

client/styles/components/_quick-add.scss

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,16 @@
11
.quick-add-wrapper {
22
min-width: #{600 / $base-font-size}rem;
3-
overflow-y: scroll;
3+
padding: #{24 / $base-font-size}rem;
4+
height: 100%;
45
}
56

67
.quick-add {
78
width: auto;
8-
padding: #{24 / $base-font-size}rem;
9+
overflow-y: scroll;
10+
height: 100%;
11+
@include themify() {
12+
border: 1px solid getThemifyVariable('modal-border-color');
13+
}
914
}
1015

1116
.quick-add__item {
@@ -23,7 +28,7 @@
2328

2429
.quick-add__item:nth-child(odd) {
2530
@include themify() {
26-
background: getThemifyVariable('table-row-stripe-color');
31+
background: getThemifyVariable('table-row-stripe-color-alternate');
2732
}
2833
}
2934

0 commit comments

Comments
 (0)