Skip to content

Commit b1cfd15

Browse files
committed
Move "Toggle Design" button into new /settings/appearance route
1 parent 516f473 commit b1cfd15

File tree

8 files changed

+31
-27
lines changed

8 files changed

+31
-27
lines changed

app/components/settings-page.hbs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
<div local-class="page" ...attributes>
22
<SideMenu as |menu|>
33
<menu.Item @link={{link "settings.profile"}}>Profile</menu.Item>
4+
{{#if this.design.showToggleButton}}
5+
<menu.Item @link={{link "settings.appearance"}}>Appearance</menu.Item>
6+
{{/if}}
47
<menu.Item @link={{link "settings.email-notifications"}}>Email Notifications</menu.Item>
58
<menu.Item @link={{link "settings.tokens"}}>API Tokens</menu.Item>
69
</SideMenu>

app/components/settings-page.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import { inject as service } from '@ember/service';
2+
import Component from '@glimmer/component';
3+
4+
export default class SettingsPage extends Component {
5+
@service design;
6+
}
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import Controller from '@ember/controller';
2+
import { inject as service } from '@ember/service';
3+
4+
export default class AppearanceSettingsController extends Controller {
5+
@service design;
6+
}

app/router.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ Router.map(function () {
3232
this.route('pending-invites');
3333
});
3434
this.route('settings', function () {
35+
this.route('appearance');
3536
this.route('email-notifications');
3637
this.route('profile');
3738
this.route('tokens');

app/styles/application.module.css

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -122,23 +122,3 @@ noscript {
122122
margin: 15px 0;
123123
padding: 0 15px;
124124
}
125-
126-
.toggle-design-button {
127-
position: fixed;
128-
bottom: 30px;
129-
left: 30px;
130-
z-index: 100;
131-
padding: 10px;
132-
border: none;
133-
border-radius: 5px;
134-
background: white;
135-
box-shadow: 0 0 3px rgba(0, 0, 0, 0.2);
136-
color: black;
137-
font-family: sans-serif;
138-
cursor: pointer;
139-
140-
&:hover {
141-
background: #f7f7f7;
142-
box-shadow: 0 0 6px rgba(0, 0, 0, 0.2);
143-
}
144-
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.toggle-button {
2+
composes: yellow-button from '../shared/buttons.module.css';
3+
}

app/templates/application.hbs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,4 @@
1414
</div>
1515
</main>
1616

17-
<Footer/>
18-
19-
{{#if this.design.showToggleButton}}
20-
<button type="button" local-class="toggle-design-button" {{on "click" this.design.toggle}}>
21-
Toggle Design
22-
</button>
23-
{{/if}}
17+
<Footer/>

app/templates/settings/appearance.hbs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{{page-title 'Settings'}}
2+
3+
<PageHeader @title="Account Settings" @icon="gear"/>
4+
5+
<SettingsPage>
6+
<h2>Appearance</h2>
7+
8+
<button type="button" local-class="toggle-button" {{on "click" this.design.toggle}}>
9+
Toggle Design
10+
</button>
11+
</SettingsPage>

0 commit comments

Comments
 (0)