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

Commit 2f75419

Browse files
Merge pull request #731 from deckgo/toggle-to-transform
feat: replace "toggle" with "transform"
2 parents bffddfa + 80e5083 commit 2f75419

File tree

5 files changed

+45
-14
lines changed

5 files changed

+45
-14
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1163,8 +1163,8 @@ export class AppActionsElement {
11631163
<ion-label>Options</ion-label>
11641164
</ion-tab-button>,
11651165
<ion-tab-button onClick={() => this.openSlotType()} aria-label="Toggle element type" color="primary" mode="md" class={classToggle}>
1166-
<ion-icon src="/assets/icons/ionicons/add.svg"></ion-icon>
1167-
<ion-label>Toggle</ion-label>
1166+
<ion-icon src="/assets/icons/ionicons/color-wand.svg"></ion-icon>
1167+
<ion-label>Transform</ion-label>
11681168
</ion-tab-button>,
11691169
];
11701170
}

studio/src/app/popovers/editor/app-slot-type/app-slot-type.scss

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,29 @@ app-slot-type {
1818
ion-list {
1919
ion-item {
2020
h1,
21-
h2,
22-
h3 {
21+
h2 {
2322
font-weight: 500;
2423
}
2524

25+
h3 {
26+
font-weight: 400;
27+
}
28+
29+
h1,
30+
h2,
31+
h3,
2632
p {
2733
margin: 0;
2834
}
35+
36+
ion-icon {
37+
color: var(--ion-color-dark);
38+
}
39+
40+
span.placeholder {
41+
width: 26px;
42+
margin: 12px 32px 12px 0;
43+
}
2944
}
3045
}
3146

studio/src/app/popovers/editor/app-slot-type/app-slot-type.tsx

Lines changed: 23 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import {SlotUtils} from '../../../utils/editor/slot.utils';
55

66
@Component({
77
tag: 'app-slot-type',
8-
styleUrl: 'app-slot-type.scss'
8+
styleUrl: 'app-slot-type.scss',
99
})
1010
export class AppSlideAdd {
1111
@Element() el: HTMLElement;
@@ -68,14 +68,14 @@ export class AppSlideAdd {
6868

6969
private async closePopover(type?: SlotType) {
7070
await (this.el.closest('ion-popover') as HTMLIonPopoverElement).dismiss({
71-
type: this.currentType !== type ? type : null
71+
type: this.currentType !== type ? type : null,
7272
});
7373
}
7474

7575
render() {
7676
return [
7777
<ion-toolbar>
78-
<h2>Toggle section</h2>
78+
<h2>Transform element</h2>
7979
<ion-router-link slot="end" onClick={() => this.closePopover()}>
8080
<ion-icon aria-label="Close" src="/assets/icons/ionicons/close.svg"></ion-icon>
8181
</ion-router-link>
@@ -84,26 +84,36 @@ export class AppSlideAdd {
8484
<ion-list>
8585
<a onClick={() => this.closePopover(SlotType.H1)} class={this.currentType === SlotType.H1 ? 'current' : ''}>
8686
<ion-item>
87+
<ion-icon name="text-outline" slot="start"></ion-icon>
8788
<h1>Huge title</h1>
8889
</ion-item>
8990
</a>
9091
<a onClick={() => this.closePopover(SlotType.H2)} class={this.currentType === SlotType.H2 ? 'current' : ''}>
9192
<ion-item>
93+
<span class="placeholder" slot="start">
94+
&nbsp;
95+
</span>
9296
<h2>Large title</h2>
9397
</ion-item>
9498
</a>
9599
<a onClick={() => this.closePopover(SlotType.H3)} class={this.currentType === SlotType.H3 ? 'current' : ''}>
96100
<ion-item>
101+
<span class="placeholder" slot="start">
102+
&nbsp;
103+
</span>
97104
<h3>Small title</h3>
98105
</ion-item>
99106
</a>
100107
<a onClick={() => this.closePopover(SlotType.SECTION)} class={this.currentType === SlotType.SECTION ? 'current' : ''}>
101108
<ion-item>
109+
<span class="placeholder" slot="start">
110+
&nbsp;
111+
</span>
102112
<p>Paragraph</p>
103113
</ion-item>
104114
</a>
105115
{this.renderComplexTypes()}
106-
</ion-list>
116+
</ion-list>,
107117
];
108118
}
109119

@@ -115,24 +125,28 @@ export class AppSlideAdd {
115125
return [
116126
<a onClick={() => this.closePopover(SlotType.OL)} class={this.currentType === SlotType.OL ? 'current' : ''}>
117127
<ion-item>
118-
<p>List</p>
128+
<ion-icon src="/assets/icons/ionicons/list.svg" slot="start"></ion-icon>
129+
<ion-label>List</ion-label>
119130
</ion-item>
120131
</a>,
121132
<a onClick={() => this.closePopover(SlotType.IMG)} class={this.currentType === SlotType.IMG ? 'current' : ''}>
122133
<ion-item>
123-
<p>Image</p>
134+
<ion-icon src="/assets/icons/ionicons/images.svg" slot="start"></ion-icon>
135+
<ion-label>Image</ion-label>
124136
</ion-item>
125137
</a>,
126138
<a onClick={() => this.closePopover(SlotType.CODE)} class={this.currentType === SlotType.CODE ? 'current' : ''}>
127139
<ion-item>
128-
<p>Code</p>
140+
<ion-icon src="/assets/icons/ionicons/code.svg" slot="start"></ion-icon>
141+
<ion-label>Code</ion-label>
129142
</ion-item>
130143
</a>,
131144
<a onClick={() => this.closePopover(SlotType.MATH)} class={this.currentType === SlotType.MATH ? 'current' : ''}>
132145
<ion-item>
133-
<p>Math</p>
146+
<ion-icon src="/assets/icons/math.svg" slot="start"></ion-icon>
147+
<ion-label>Math</ion-label>
134148
</ion-item>
135-
</a>
149+
</a>,
136150
];
137151
}
138152
}

studio/src/assets/assets.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -239,6 +239,7 @@
239239
{"src": "/icons/align-center.svg", "ariaLabel": "Align center"},
240240
{"src": "/icons/align-left.svg", "ariaLabel": "Align left"},
241241
{"src": "/icons/align-right.svg", "ariaLabel": "Align right"},
242-
{"src": "/icons/math.svg", "ariaLabel": "Math"}
242+
{"src": "/icons/math.svg", "ariaLabel": "Math"},
243+
{"src": "/icons/ionicons/color-wand.svg", "ariaLabel": "Transform element"}
243244
]
244245
}
Lines changed: 1 addition & 0 deletions
Loading

0 commit comments

Comments
 (0)