DEV: removes caret from notifications-tracking on mobile (#30369)
We never want to show this caret on mobile.
This commit is contained in:
parent
9ca8f706bf
commit
1f39ce87a5
|
@ -1,6 +1,7 @@
|
||||||
import Component from "@glimmer/component";
|
import Component from "@glimmer/component";
|
||||||
import { fn, hash } from "@ember/helper";
|
import { fn, hash } from "@ember/helper";
|
||||||
import { action } from "@ember/object";
|
import { action } from "@ember/object";
|
||||||
|
import { service } from "@ember/service";
|
||||||
import DButton from "discourse/components/d-button";
|
import DButton from "discourse/components/d-button";
|
||||||
import DropdownMenu from "discourse/components/dropdown-menu";
|
import DropdownMenu from "discourse/components/dropdown-menu";
|
||||||
import PluginOutlet from "discourse/components/plugin-outlet";
|
import PluginOutlet from "discourse/components/plugin-outlet";
|
||||||
|
@ -21,12 +22,14 @@ function constructKey(prefix, level, suffix, key) {
|
||||||
}
|
}
|
||||||
|
|
||||||
class NotificationsTrackingTrigger extends Component {
|
class NotificationsTrackingTrigger extends Component {
|
||||||
|
@service site;
|
||||||
|
|
||||||
get showFullTitle() {
|
get showFullTitle() {
|
||||||
return this.args.showFullTitle ?? true;
|
return this.args.showFullTitle ?? true;
|
||||||
}
|
}
|
||||||
|
|
||||||
get showCaret() {
|
get showCaret() {
|
||||||
return this.args.showCaret ?? true;
|
return this.site.desktopView && (this.args.showCaret ?? true);
|
||||||
}
|
}
|
||||||
|
|
||||||
get title() {
|
get title() {
|
||||||
|
@ -48,7 +51,7 @@ class NotificationsTrackingTrigger extends Component {
|
||||||
{{/if}}
|
{{/if}}
|
||||||
|
|
||||||
{{#if this.showCaret}}
|
{{#if this.showCaret}}
|
||||||
{{icon "angle-down"}}
|
{{icon "angle-down" class="notifications-tracking-btn__caret"}}
|
||||||
{{/if}}
|
{{/if}}
|
||||||
</template>
|
</template>
|
||||||
}
|
}
|
||||||
|
|
|
@ -78,4 +78,22 @@ module("Integration | Component | TopicTracking", function (hooks) {
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
test("caret", async function (assert) {
|
||||||
|
await render(<template><TopicNotificationsTracking /></template>);
|
||||||
|
|
||||||
|
assert.dom(".notifications-tracking-btn__caret").exists();
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
|
module("Integration | Component | TopicTracking - Mobile", function (hooks) {
|
||||||
|
setupRenderingTest(hooks);
|
||||||
|
|
||||||
|
test("no caret", async function (assert) {
|
||||||
|
this.site.desktopView = false;
|
||||||
|
|
||||||
|
await render(<template><TopicNotificationsTracking /></template>);
|
||||||
|
|
||||||
|
assert.dom(".notifications-tracking-btn__caret").doesNotExist();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue