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

Commit 87c0cf8

Browse files
merge: set deck title (name) from first slide or publish modal
2 parents 96134d1 + a5e284f commit 87c0cf8

File tree

23 files changed

+518
-531
lines changed

23 files changed

+518
-531
lines changed

studio/src/app/components/core/app-footer/app-footer.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export class AppFooter {
1010
render() {
1111
return [
1212
<hr margin/>,
13-
<div padding-start padding-end margin-bottom>
13+
<div class="ion-padding-start ion-padding-end ion-margin-bottom">
1414
<ion-anchor href="/about" routerDirection="forward">
1515
<ion-label>About</ion-label>
1616
</ion-anchor>

studio/src/app/components/core/app-menu-user/app-menu-user.scss

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ ion-split-pane {
44
ion-menu {
55
ion-content {
66
ion-list {
7+
ion-searchbar[class*="sc-ion-searchbar"] {
8+
display: none;
9+
}
10+
711
ion-item {
812
&.user {
913
* {
@@ -28,6 +32,7 @@ ion-split-pane {
2832

2933
--cancel-button-color: var(--ion-color-medium);
3034
--clear-button-color: var(--ion-color-medium);
35+
--icon-color: var(--ion-color-medium);
3136

3237
input.searchbar-input[class*="sc-ion-searchbar"] {
3338
box-shadow: none;
@@ -53,3 +58,20 @@ ion-split-pane {
5358
}
5459
}
5560
}
61+
62+
@media (prefers-color-scheme: dark) {
63+
ion-split-pane {
64+
ion-menu {
65+
ion-content {
66+
ion-list {
67+
ion-searchbar[class*="sc-ion-searchbar"] {
68+
--cancel-button-color: white;
69+
--clear-button-color: white;
70+
--icon-color: white;
71+
color: white;
72+
}
73+
}
74+
}
75+
}
76+
}
77+
}

studio/src/app/components/core/app-menu-user/app-menu-user.tsx

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Component, State} from '@stencil/core';
1+
import {Component, Element, State} from '@stencil/core';
22

33
import {Subscription} from 'rxjs';
44
import {filter} from 'rxjs/operators';
@@ -22,6 +22,8 @@ import {DeckEditorService} from '../../../services/deck/deck-editor.service';
2222
})
2323
export class AppMenuUser {
2424

25+
@Element() el: HTMLElement;
26+
2527
private authService: AuthService;
2628
private authSubscription: Subscription;
2729

@@ -81,6 +83,9 @@ export class AppMenuUser {
8183
componentDidLoad() {
8284
this.deckSubscription = this.deckEditorService.watch().subscribe(async (deck: Deck) => {
8385
await this.updateDeckList(deck);
86+
87+
const filter: string = await this.getCurrentFilter();
88+
await this.filterDecks(filter);
8489
});
8590
}
8691

@@ -159,14 +164,14 @@ export class AppMenuUser {
159164
private filterDecks(value: string): Promise<void> {
160165
return new Promise<void>((resolve) => {
161166
if (!value || value === undefined || value === '') {
162-
this.filteredDecks = [...this.decks];
167+
this.filteredDecks = this.decks ? [...this.decks] : null;
163168

164169
resolve();
165170
return;
166171
}
167172

168173
if (!this.decks || this.decks.length <= 0) {
169-
this.filteredDecks = [...this.decks];
174+
this.filteredDecks = this.decks ? [...this.decks] : null;
170175

171176
resolve();
172177
return;
@@ -182,14 +187,33 @@ export class AppMenuUser {
182187
});
183188
}
184189

190+
private getCurrentFilter(): Promise<string> {
191+
return new Promise<string>(async (resolve) => {
192+
const searchBar: HTMLIonSearchbarElement = this.el.querySelector('ion-searchbar');
193+
194+
if (!searchBar) {
195+
resolve(null);
196+
return;
197+
}
198+
199+
const input: HTMLInputElement = await searchBar.getInputElement();
200+
201+
if (!input) {
202+
resolve(null);
203+
return;
204+
}
205+
206+
resolve(input.value);
207+
});
208+
}
209+
185210
render() {
186211
return <ion-list>
187212
{this.renderUser()}
188213

189214
<ion-item-divider>
190215
<ion-label>Presentations</ion-label>
191-
<ion-button size="small" slot="end" shape="round" margin-end onClick={() => this.navigateNewDeck()}
192-
class="new">
216+
<ion-button size="small" slot="end" shape="round" onClick={() => this.navigateNewDeck()} class="new ion-margin-end">
193217
<ion-icon name="book" slot="start"></ion-icon>
194218
<ion-label>New</ion-label>
195219
</ion-button>
@@ -241,7 +265,7 @@ export class AppMenuUser {
241265
private renderDecksFilter() {
242266
return <ion-searchbar debounce={500} animated placeholder="Filter your presentations"
243267
onIonChange={(e: CustomEvent) => this.filterDecksOnChange(e)}
244-
ion-no-padding ion-margin-top ion-margin-bottom></ion-searchbar>;
268+
class="ion-no-padding ion-margin-top ion-margin-bottom"></ion-searchbar>;
245269
}
246270

247271
private renderDecks() {

studio/src/app/components/core/app-navigation-actions/app-navigation-actions.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,15 +79,15 @@ export class AppNavigationActions {
7979
if (Utils.isLoggedIn(this.authUser) || !this.signIn) {
8080
return undefined;
8181
} else if (this.presentation || this.publish) {
82-
return <a padding-start padding-end class="signin" onClick={() => this.navigateSignIn()}>
82+
return <a class="signin ion-padding-start ion-padding-end" onClick={() => this.navigateSignIn()}>
8383
<ion-label>Sign in</ion-label>
8484
</a>;
8585
}
8686
}
8787

8888
private renderLoggedIn() {
8989
if (Utils.isLoggedIn(this.authUser)) {
90-
return <a padding-end onClick={(e: UIEvent) => this.openMenu(e)}>
90+
return <a class="ion-padding-end" onClick={(e: UIEvent) => this.openMenu(e)}>
9191
<app-avatar src={this.authUser.photo_url}></app-avatar>
9292
</a>;
9393
} else {
@@ -97,7 +97,7 @@ export class AppNavigationActions {
9797

9898
private renderPresentationButton() {
9999
if (this.presentation) {
100-
return <ion-button class="presentation" shape="round" href="/editor" routerDirection="forward" padding-end>
100+
return <ion-button class="presentation ion-padding-end" shape="round" href="/editor" routerDirection="forward">
101101
<ion-label class="ion-text-uppercase">Write a presentation</ion-label>
102102
</ion-button>;
103103
} else {
@@ -107,7 +107,7 @@ export class AppNavigationActions {
107107

108108
private renderPublishButton() {
109109
if (this.publish) {
110-
return <ion-button class="publish" shape="round" onClick={() => this.actionPublish.emit()} padding-end>
110+
return <ion-button class="publish ion-padding-end" shape="round" onClick={() => this.actionPublish.emit()}>
111111
<ion-label class="ion-text-uppercase">Ready to publish?</ion-label>
112112
</ion-button>;
113113
} else {

studio/src/app/components/feed/card/app-feed-card-content/app-feed-card-content.scss

Lines changed: 0 additions & 76 deletions
This file was deleted.

0 commit comments

Comments
 (0)