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

Commit e61e86a

Browse files
style: replace segment buttons with anchor
1 parent a3a91c1 commit e61e86a

File tree

3 files changed

+40
-14
lines changed

3 files changed

+40
-14
lines changed

studio/src/app/components/feed/app-demo/app-demo.scss

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,27 @@
44
div.container {
55
display: var(--demo-display);
66
width: 100%;
7+
8+
div.type-selection {
9+
display: flex;
10+
justify-content: center;
11+
align-items: center;
12+
flex-wrap: wrap;
13+
14+
padding-bottom: 16px;
15+
16+
ion-anchor {
17+
padding: 8px 16px;
18+
cursor: pointer;
19+
color: var(--ion-color-medium);
20+
21+
&.selected {
22+
background: var(--ion-color-primary);
23+
color: white;
24+
border-radius: 16px;
25+
}
26+
}
27+
}
728
}
829
}
930

@@ -183,8 +204,11 @@ div.tablet-container {
183204
}
184205

185206
div.beamer-container {
186-
height: 200px;
187-
padding: 8px 16px;
207+
height: 240px;
208+
}
209+
210+
div.beamer-container, div.laptop-container, div.tablet-container, div.smartphone-container {
211+
min-height: 240px;
188212
}
189213

190214
iframe {

studio/src/app/components/feed/app-demo/app-demo.tsx

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,26 +17,26 @@ export class AppDemo {
1717
@State()
1818
private type: DemoType = DemoType.MOBILE;
1919

20-
private switchType(e: CustomEvent) {
21-
this.type = DemoType[e.detail.value.toUpperCase()] as DemoType;
20+
private switchType(type: DemoType) {
21+
this.type = type;
2222
}
2323

2424
render() {
2525
return <div class="container">
26-
<ion-segment onIonChange={(e: CustomEvent) => this.switchType(e)}>
27-
<ion-segment-button value="mobile" checked={this.type === DemoType.MOBILE}>
26+
<div class="type-selection">
27+
<ion-anchor class={this.type === DemoType.MOBILE ? 'selected' : ''} onClick={() => this.switchType(DemoType.MOBILE)}>
2828
<ion-label>Mobile</ion-label>
29-
</ion-segment-button>
30-
<ion-segment-button value="tablet" checked={this.type === DemoType.TABLET}>
29+
</ion-anchor>
30+
<ion-anchor class={this.type === DemoType.TABLET ? 'selected' : ''} onClick={() => this.switchType(DemoType.TABLET)}>
3131
<ion-label>Tablet</ion-label>
32-
</ion-segment-button>
33-
<ion-segment-button value="desktop" checked={this.type === DemoType.DESKTOP}>
32+
</ion-anchor>
33+
<ion-anchor class={this.type === DemoType.DESKTOP ? 'selected' : ''} onClick={() => this.switchType(DemoType.DESKTOP)}>
3434
<ion-label>Desktop</ion-label>
35-
</ion-segment-button>
36-
<ion-segment-button value="beamer" checked={this.type === DemoType.BEAMER}>
35+
</ion-anchor>
36+
<ion-anchor class={this.type === DemoType.BEAMER ? 'selected' : ''} onClick={() => this.switchType(DemoType.BEAMER)}>
3737
<ion-label>Beamer</ion-label>
38-
</ion-segment-button>
39-
</ion-segment>
38+
</ion-anchor>
39+
</div>
4040

4141
{this.renderMobile()}
4242
{this.renderTablet()}

studio/src/app/components/feed/app-popular/app-popular.scss

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ app-popular {
33
--background: white;
44
color: black;
55
padding: 16px;
6+
7+
width: 350px;
68
}
79

810
ion-card.demo {

0 commit comments

Comments
 (0)