Skip to content
This repository was archived by the owner on Feb 6, 2024. It is now read-only.

Commit 5f980c0

Browse files
feat(#196): add a placeholder
1 parent 844b97b commit 5f980c0

File tree

3 files changed

+40
-1
lines changed

3 files changed

+40
-1
lines changed

studio/src/app/modals/editor/app-custom-images/app-custom-images.scss

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,30 @@ app-custom-images {
3232
}
3333
}
3434
}
35+
36+
div.photos-placeholder {
37+
position: absolute;
38+
top: 50%;
39+
left: 50%;
40+
transform: translate(-50%, -50%);
41+
42+
> div {
43+
display: flex;
44+
flex-direction: column;
45+
justify-content: center;
46+
align-items: center;
47+
48+
position: relative;
49+
50+
ion-icon {
51+
font-size: 10rem;
52+
}
53+
54+
ion-label, ion-icon {
55+
color: var(--ion-color-medium);
56+
}
57+
}
58+
}
3559
}
3660

3761
ion-alert.custom-images {

studio/src/app/modals/editor/app-custom-images/app-custom-images.tsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -229,6 +229,8 @@ export class AppCustomImages {
229229
onSelectImage={($event: CustomEvent) => this.selectImage($event)}>
230230
</app-image-columns>
231231

232+
{this.renderImagesPlaceHolder()}
233+
232234
<input type="file" accept="image/x-png,image/jpeg,image/gif" onChange={() => this.upload()}/>
233235

234236
<ion-infinite-scroll threshold="100px" disabled={this.disableInfiniteScroll}
@@ -249,6 +251,19 @@ export class AppCustomImages {
249251
];
250252
}
251253

254+
private renderImagesPlaceHolder() {
255+
if ((!this.imagesOdd || this.imagesOdd.length <= 0) && (!this.imagesEven || this.imagesEven.length <= 0)) {
256+
return <div class="photos-placeholder">
257+
<div>
258+
<ion-icon name="images"></ion-icon>
259+
<ion-label class="ion-text-center">Your collection of images is empty</ion-label>
260+
</div>
261+
</div>
262+
} else {
263+
return undefined;
264+
}
265+
}
266+
252267
private renderToolbarAction() {
253268
if (!this.uploading) {
254269
return <ion-button onClick={() => this.uploadNewImage()} shape="round" color="tertiary">

studio/src/app/modals/editor/app-photo/app-photo.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -227,7 +227,7 @@ export class AppPhoto {
227227
return <div class="photos-placeholder">
228228
<div>
229229
<ion-icon name="images"></ion-icon>
230-
<ion-label>Photos by Unsplash</ion-label>
230+
<ion-label class="ion-text-center">Photos by Unsplash</ion-label>
231231
{this.renderPlaceHolderSearching()}
232232
</div>
233233
</div>

0 commit comments

Comments
 (0)