UX: Change placement of welcome cta (#18806)
This commit is contained in:
parent
167181f4b7
commit
208d22cfc2
|
@ -2,6 +2,7 @@ import Controller, { inject as controller } from "@ember/controller";
|
|||
import { alias, equal, not } from "@ember/object/computed";
|
||||
import { action } from "@ember/object";
|
||||
import Category from "discourse/models/category";
|
||||
import discourseComputed from "discourse-common/utils/decorators";
|
||||
import DiscourseURL from "discourse/lib/url";
|
||||
import { inject as service } from "@ember/service";
|
||||
|
||||
|
@ -21,6 +22,24 @@ export default Controller.extend({
|
|||
|
||||
loadedAllItems: not("discoveryTopics.model.canLoadMore"),
|
||||
|
||||
@discourseComputed(
|
||||
"router.currentRouteName",
|
||||
"router.currentRoute.queryParams.f",
|
||||
"site.show_welcome_topic_banner"
|
||||
)
|
||||
showEditWelcomeTopicBanner(
|
||||
currentRouteName,
|
||||
hasParams,
|
||||
showWelcomeTopicBanner
|
||||
) {
|
||||
return (
|
||||
this.currentUser?.staff &&
|
||||
currentRouteName === "discovery.latest" &&
|
||||
showWelcomeTopicBanner &&
|
||||
!hasParams
|
||||
);
|
||||
},
|
||||
|
||||
@action
|
||||
loadingBegan() {
|
||||
this.set("loading", true);
|
||||
|
|
|
@ -24,20 +24,6 @@ const controllerOpts = {
|
|||
showTopicPostBadges: not("new"),
|
||||
redirectedReason: alias("currentUser.redirected_to_top.reason"),
|
||||
|
||||
@discourseComputed(
|
||||
"model.filter",
|
||||
"site.show_welcome_topic_banner",
|
||||
"model.listParams.f"
|
||||
)
|
||||
showEditWelcomeTopicBanner(filter, showWelcomeTopicBanner, hasListParams) {
|
||||
return (
|
||||
this.currentUser?.staff &&
|
||||
filter === "latest" &&
|
||||
showWelcomeTopicBanner &&
|
||||
!hasListParams
|
||||
);
|
||||
},
|
||||
|
||||
expandGloballyPinned: false,
|
||||
expandAllPinned: false,
|
||||
|
||||
|
|
|
@ -18,6 +18,10 @@
|
|||
|
||||
<PluginOutlet @name="discovery-above" @tagName="span" @connectorTagName="div" />
|
||||
|
||||
{{#if this.showEditWelcomeTopicBanner}}
|
||||
<WelcomeTopicBanner />
|
||||
{{/if}}
|
||||
|
||||
<div class="container list-container {{if this.loading "hidden"}}">
|
||||
<div class="row">
|
||||
<div class="full-width">
|
||||
|
|
|
@ -2,10 +2,6 @@
|
|||
<div class="alert alert-info">{{this.redirectedReason}}</div>
|
||||
{{/if}}
|
||||
|
||||
{{#if this.showEditWelcomeTopicBanner}}
|
||||
<WelcomeTopicBanner />
|
||||
{{/if}}
|
||||
|
||||
<TopicDismissButtons @position="top" @selectedTopics={{this.selected}} @model={{this.model}} @showResetNew={{this.showResetNew}} @showDismissRead={{this.showDismissRead}} @resetNew={{action "resetNew"}} />
|
||||
|
||||
{{#if this.model.sharedDrafts}}
|
||||
|
|
|
@ -269,9 +269,6 @@
|
|||
display: flex;
|
||||
flex-direction: row;
|
||||
justify-content: space-between;
|
||||
position: absolute;
|
||||
top: 48px;
|
||||
width: calc(100% - 40px);
|
||||
z-index: z("usercard");
|
||||
&__content {
|
||||
width: 70%;
|
||||
|
|
Loading…
Reference in New Issue