Add theme selection (#2428)
* fix: 🐛 remove theme from main menu bar and move to settings pag * chore: 🤖 move toggletheme to app controller
This commit is contained in:
1 parent
25b3a940a3
commit
777380e19f
8 files changed
+132
-110
No files matched your search
@@ -3,6 +3,46 @@
|
||||
* SPDX-License-Identifier: BUSL-1.1
|
||||
*/
|
||||
|
||||
import Controller from '@ember/controller';
|
||||
import Controller, { inject as controller } from '@ember/controller';
|
||||
import { inject as service } from '@ember/service';
|
||||
import { action } from '@ember/object';
|
||||
|
||||
export default class ScopesScopeProjectsSettingsIndexController extends Controller {}
|
||||
const THEMES = [
|
||||
{
|
||||
label: 'system',
|
||||
value: 'system-default-theme',
|
||||
},
|
||||
{
|
||||
label: 'light',
|
||||
value: 'light',
|
||||
},
|
||||
{
|
||||
label: 'dark',
|
||||
value: 'dark',
|
||||
},
|
||||
];
|
||||
|
||||
export default class ScopesScopeProjectsSettingsIndexController extends Controller {
|
||||
@controller('application') application;
|
||||
// Services
|
||||
|
||||
@service session;
|
||||
|
||||
// Methods
|
||||
|
||||
/**
|
||||
* Returns available themes
|
||||
*/
|
||||
get themes() {
|
||||
return THEMES;
|
||||
}
|
||||
|
||||
/**
|
||||
* Calls the Application controller's toggleTheme method
|
||||
* @param {string} theme - "light", "dark", or nullish (system default)
|
||||
*/
|
||||
@action
|
||||
toggleTheme({ target: { value: theme } }) {
|
||||
return this.application.toggleTheme(theme);
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user