mirror of
https://github.com/discourse/discourse.git
synced 2025-02-25 18:55:32 -06:00
DEV: Convert color-scheme-select-base modal to component-based API (#23234)
<img width="560" alt="Screenshot 2023-08-24 at 2 12 38 PM" src="https://github.com/discourse/discourse/assets/50783505/9180f090-2142-4818-bb40-78cf7c25e9fe">
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
<DModal
|
||||
@title={{i18n "admin.customize.colors.select_base.title"}}
|
||||
@closeModal={{@closeModal}}
|
||||
>
|
||||
<:body>
|
||||
{{i18n "admin.customize.colors.select_base.description"}}
|
||||
<ComboBox
|
||||
@content={{@model.baseColorSchemes}}
|
||||
@value={{this.selectedBaseThemeId}}
|
||||
@onChange={{action (mut this.selectedBaseThemeId)}}
|
||||
@valueProperty="base_scheme_id"
|
||||
/>
|
||||
</:body>
|
||||
<:footer>
|
||||
<DButton
|
||||
class="btn-primary"
|
||||
@action={{this.selectBase}}
|
||||
@icon="plus"
|
||||
@label="admin.customize.new"
|
||||
/>
|
||||
</:footer>
|
||||
</DModal>
|
||||
@@ -0,0 +1,14 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { action } from "@ember/object";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
|
||||
export default class ColorSchemeSelectBase extends Component {
|
||||
@tracked
|
||||
selectedBaseThemeId = this.args.model.baseColorSchemes?.[0]?.base_scheme_id;
|
||||
|
||||
@action
|
||||
selectBase() {
|
||||
this.args.model.newColorSchemeWithBase(this.selectedBaseThemeId);
|
||||
this.args.closeModal();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user