feat: export complete Discourse themes ecosystem (16 themes, SCSS, JS components and color schemes)
This commit is contained in:
@@ -0,0 +1,40 @@
|
||||
import Component from "@glimmer/component";
|
||||
import { tracked } from "@glimmer/tracking";
|
||||
import { action } from "@ember/object";
|
||||
import { service } from "@ember/service";
|
||||
import bodyClass from "discourse/helpers/body-class";
|
||||
import DButton from "discourse/ui-kit/d-button";
|
||||
|
||||
export default class ComposerPeekModeToggle extends Component {
|
||||
@service composer;
|
||||
@service keyValueStore;
|
||||
|
||||
@tracked
|
||||
peekModeActive = this.keyValueStore.getItem("peekModeActive") === "true";
|
||||
|
||||
get bodyCssClass() {
|
||||
return this.peekModeActive && !this.composer.isPreviewVisible
|
||||
? "peek-mode-active"
|
||||
: "";
|
||||
}
|
||||
|
||||
@action
|
||||
togglePeekMode() {
|
||||
this.peekModeActive = !this.peekModeActive;
|
||||
this.keyValueStore.setItem("peekModeActive", this.peekModeActive);
|
||||
if (this.composer.showPreview) {
|
||||
this.composer.togglePreview();
|
||||
}
|
||||
}
|
||||
|
||||
<template>
|
||||
{{bodyClass this.bodyCssClass}}
|
||||
<DButton
|
||||
@action={{this.togglePeekMode}}
|
||||
@preventFocus={{true}}
|
||||
@icon="discourse-sidebar"
|
||||
@title="composer.peek_mode_toggle"
|
||||
class="btn-small no-text peek-mode-toggle btn-transparent"
|
||||
/>
|
||||
</template>
|
||||
}
|
||||
Reference in New Issue
Block a user