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

Commit a5e284f

Browse files
refactor: app-deck-actions to app-editor-actions
1 parent ae6587f commit a5e284f

File tree

6 files changed

+45
-45
lines changed

6 files changed

+45
-45
lines changed

studio/src/app/pages/editor/app-editor/app-editor.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ import {AuthService} from '../../../services/auth/auth.service';
1818
import {GuestService} from '../../../services/guest/guest.service';
1919
import {NavDirection, NavService} from '../../../services/nav/nav.service';
2020
import {DeckEditorService} from '../../../services/deck/deck-editor.service';
21-
import {DeckAction} from '../../../popovers/editor/app-deck-actions/deck-action';
21+
import {EditorAction} from '../../../popovers/editor/app-editor-actions/editor-action';
2222

2323
@Component({
2424
tag: 'app-editor',
@@ -532,16 +532,16 @@ export class AppEditor {
532532
}
533533

534534
const popover: HTMLIonPopoverElement = await this.popoverController.create({
535-
component: 'app-deck-actions',
535+
component: 'app-editor-actions',
536536
event: $event,
537537
mode: 'ios'
538538
});
539539

540540
popover.onDidDismiss().then(async (detail: OverlayEventDetail) => {
541541
if (detail && detail.data) {
542-
if (detail.data.action === DeckAction.FULLSCREEN) {
542+
if (detail.data.action === EditorAction.FULLSCREEN) {
543543
await this.toggleFullScreen();
544-
} else if (detail.data.action === DeckAction.JUMP_TO) {
544+
} else if (detail.data.action === EditorAction.JUMP_TO) {
545545
await this.openSlideNavigate();
546546
}
547547
}

studio/src/app/popovers/editor/app-deck-actions/app-deck-actions.tsx

Lines changed: 0 additions & 27 deletions
This file was deleted.
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
import {Component, Element} from '@stencil/core';
2+
3+
import {EditorAction} from './editor-action';
4+
5+
@Component({
6+
tag: 'app-editor-actions',
7+
styleUrl: 'app-editor-actions.scss'
8+
})
9+
export class AppEditorActions {
10+
11+
@Element() el: HTMLElement;
12+
13+
async closePopover(action: EditorAction) {
14+
await (this.el.closest('ion-popover') as HTMLIonModalElement).dismiss({
15+
action: action
16+
});
17+
}
18+
19+
render() {
20+
// TODO: Share when published
21+
22+
return <div padding>
23+
<a onClick={() => this.closePopover(EditorAction.JUMP_TO)}><p>Jump to slide</p></a>
24+
<a onClick={() => this.closePopover(EditorAction.FULLSCREEN)}><p>Fullscreen</p></a>
25+
</div>
26+
}
27+
}
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
export enum DeckAction {
1+
export enum EditorAction {
22
FULLSCREEN,
33
JUMP_TO
44
}

studio/src/components.d.ts

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -174,12 +174,12 @@ export namespace Components {
174174
interface AppUserMenu {}
175175
interface AppUserMenuAttributes extends StencilHTMLAttributes {}
176176

177-
interface AppDeckActions {}
178-
interface AppDeckActionsAttributes extends StencilHTMLAttributes {}
179-
180177
interface AppDeckOrSlide {}
181178
interface AppDeckOrSlideAttributes extends StencilHTMLAttributes {}
182179

180+
interface AppEditorActions {}
181+
interface AppEditorActionsAttributes extends StencilHTMLAttributes {}
182+
183183
interface AppSlideType {}
184184
interface AppSlideTypeAttributes extends StencilHTMLAttributes {}
185185

@@ -221,8 +221,8 @@ declare global {
221221
'AppSignin': Components.AppSignin;
222222
'AppEditor': Components.AppEditor;
223223
'AppUserMenu': Components.AppUserMenu;
224-
'AppDeckActions': Components.AppDeckActions;
225224
'AppDeckOrSlide': Components.AppDeckOrSlide;
225+
'AppEditorActions': Components.AppEditorActions;
226226
'AppSlideType': Components.AppSlideType;
227227
'AppSlotType': Components.AppSlotType;
228228
}
@@ -256,8 +256,8 @@ declare global {
256256
'app-signin': Components.AppSigninAttributes;
257257
'app-editor': Components.AppEditorAttributes;
258258
'app-user-menu': Components.AppUserMenuAttributes;
259-
'app-deck-actions': Components.AppDeckActionsAttributes;
260259
'app-deck-or-slide': Components.AppDeckOrSlideAttributes;
260+
'app-editor-actions': Components.AppEditorActionsAttributes;
261261
'app-slide-type': Components.AppSlideTypeAttributes;
262262
'app-slot-type': Components.AppSlotTypeAttributes;
263263
}
@@ -431,18 +431,18 @@ declare global {
431431
new (): HTMLAppUserMenuElement;
432432
};
433433

434-
interface HTMLAppDeckActionsElement extends Components.AppDeckActions, HTMLStencilElement {}
435-
var HTMLAppDeckActionsElement: {
436-
prototype: HTMLAppDeckActionsElement;
437-
new (): HTMLAppDeckActionsElement;
438-
};
439-
440434
interface HTMLAppDeckOrSlideElement extends Components.AppDeckOrSlide, HTMLStencilElement {}
441435
var HTMLAppDeckOrSlideElement: {
442436
prototype: HTMLAppDeckOrSlideElement;
443437
new (): HTMLAppDeckOrSlideElement;
444438
};
445439

440+
interface HTMLAppEditorActionsElement extends Components.AppEditorActions, HTMLStencilElement {}
441+
var HTMLAppEditorActionsElement: {
442+
prototype: HTMLAppEditorActionsElement;
443+
new (): HTMLAppEditorActionsElement;
444+
};
445+
446446
interface HTMLAppSlideTypeElement extends Components.AppSlideType, HTMLStencilElement {}
447447
var HTMLAppSlideTypeElement: {
448448
prototype: HTMLAppSlideTypeElement;
@@ -484,8 +484,8 @@ declare global {
484484
'app-signin': HTMLAppSigninElement
485485
'app-editor': HTMLAppEditorElement
486486
'app-user-menu': HTMLAppUserMenuElement
487-
'app-deck-actions': HTMLAppDeckActionsElement
488487
'app-deck-or-slide': HTMLAppDeckOrSlideElement
488+
'app-editor-actions': HTMLAppEditorActionsElement
489489
'app-slide-type': HTMLAppSlideTypeElement
490490
'app-slot-type': HTMLAppSlotTypeElement
491491
}
@@ -519,8 +519,8 @@ declare global {
519519
'app-signin': HTMLAppSigninElement;
520520
'app-editor': HTMLAppEditorElement;
521521
'app-user-menu': HTMLAppUserMenuElement;
522-
'app-deck-actions': HTMLAppDeckActionsElement;
523522
'app-deck-or-slide': HTMLAppDeckOrSlideElement;
523+
'app-editor-actions': HTMLAppEditorActionsElement;
524524
'app-slide-type': HTMLAppSlideTypeElement;
525525
'app-slot-type': HTMLAppSlotTypeElement;
526526
}

0 commit comments

Comments
 (0)