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

Commit 979738e

Browse files
feat(#347): hide fullscreen and platform color picker on iPad
1 parent 71711a8 commit 979738e

File tree

4 files changed

+33
-9
lines changed

4 files changed

+33
-9
lines changed

studio/package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

studio/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
"@deckdeckgo/slide-split": "^1.0.0-rc.1",
2828
"@deckdeckgo/slide-title": "^1.0.0-rc.1",
2929
"@deckdeckgo/slide-youtube": "^1.0.0-rc.1-1",
30-
"@deckdeckgo/utils": "^1.0.0-rc.1-1",
30+
"@deckdeckgo/utils": "^1.0.0-rc.1-2",
3131
"@ionic/core": "^4.8.1",
3232
"firebase": "^6.6.0",
3333
"idb-keyval": "^3.2.0",

studio/src/app/components/editor/actions/app-editor-actions/app-editor-actions.tsx

Lines changed: 21 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
1-
import {Component, Element, Event, EventEmitter, h, JSX, Listen, Prop} from '@stencil/core';
1+
import {Component, Element, Event, EventEmitter, h, JSX, Listen, Prop, State} from '@stencil/core';
22
import {OverlayEventDetail} from '@ionic/core';
33

4+
import {isIPad} from '@deckdeckgo/utils';
5+
46
import {get, set} from 'idb-keyval';
57

68
import {SlideTemplate} from '../../../../models/data/slide';
@@ -45,10 +47,17 @@ export class AppEditorActions {
4547

4648
@Event() private openShare: EventEmitter<void>;
4749

50+
@State()
51+
private fullscreenEnable: boolean = true;
52+
4853
constructor() {
4954
this.anonymousService = AnonymousService.getInstance();
5055
}
5156

57+
componentWillLoad() {
58+
this.fullscreenEnable = !isIPad();
59+
}
60+
5261
async onActionOpenSlideAdd($event: CustomEvent) {
5362
if (!$event || !$event.detail) {
5463
return;
@@ -250,9 +259,7 @@ export class AppEditorActions {
250259
<ion-label>Slides</ion-label>
251260
</ion-tab-button>
252261

253-
<ion-tab-button onClick={() => this.toggleFullScreenMode()} color="primary" class="wider-devices" mode="md">
254-
{this.renderFullscreen()}
255-
</ion-tab-button>
262+
{this.renderFullscreenButton()}
256263

257264
<ion-tab-button onClick={() => this.openRemoteControl()} color="primary" class="wider-devices"
258265
mode="md">
@@ -275,6 +282,16 @@ export class AppEditorActions {
275282
</ion-toolbar>
276283
}
277284

285+
private renderFullscreenButton() {
286+
if (this.fullscreenEnable) {
287+
return <ion-tab-button onClick={() => this.toggleFullScreenMode()} color="primary" class="wider-devices" mode="md">
288+
{this.renderFullscreen()}
289+
</ion-tab-button>;
290+
} else {
291+
return undefined;
292+
}
293+
}
294+
278295
private renderFullscreen() {
279296
if (this.fullscreen) {
280297
return [

studio/src/app/popovers/editor/app-color/app-color.tsx

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
import {Component, Element, Event, EventEmitter, h, Prop, State} from '@stencil/core';
22

3+
import {isIPad} from '@deckdeckgo/utils';
4+
35
@Component({
46
tag: 'app-color',
57
styleUrl: 'app-color.scss'
@@ -27,8 +29,13 @@ export class AppColor {
2729
@State()
2830
private background: string;
2931

32+
@State()
33+
private moreColors: boolean = true;
34+
3035
async componentWillLoad() {
3136
await this.initCurrentColors(this.selectedElement);
37+
38+
this.moreColors = !isIPad();
3239
}
3340

3441
private async closePopover() {
@@ -174,7 +181,7 @@ export class AppColor {
174181
</ion-item>
175182
</ion-radio-group>
176183
</ion-list>,
177-
<deckgo-color class="ion-padding" onColorChange={($event: CustomEvent) => this.selectColor($event)} color-hex={this.applyToText ? this.color : this.background}>
184+
<deckgo-color class="ion-padding" more={this.moreColors} onColorChange={($event: CustomEvent) => this.selectColor($event)} color-hex={this.applyToText ? this.color : this.background}>
178185
<ion-icon name="more" ios="md-mode" md="md-more" slot="more" aria-label="More" class="more"></ion-icon>
179186
</deckgo-color>
180187
]

0 commit comments

Comments
 (0)