Skip to content

Commit

Permalink
DEV: Update component outlet ordering (discourse#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
keegangeorge authored Oct 4, 2022
1 parent e4e3c22 commit c0aae99
Show file tree
Hide file tree
Showing 5 changed files with 40 additions and 35 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ Following setting changes are required for this theme to render properly:
In the options for the `discourse-search-banner` theme component, following changes are required for this theme to render properly:

- `show-on` options needs to be set to **homepage**
- `plugin-outlet` options needs to be set to **below-site-header**
- ~~`plugin-outlet` options needs to be set to **below-site-header**~~
> As of Oct. 4th, 2022: The outlet will be auto-set by the Mint theme
- `background image` can be set as per your requirement

### Discourse Showcased Categories
Expand Down
16 changes: 16 additions & 0 deletions common/common.scss
Original file line number Diff line number Diff line change
Expand Up @@ -386,3 +386,19 @@ summary.select-kit-header.single-select-header.dropdown-select-box-header {
border: 1px dashed var(--tertiary);
}
}

// Control order of plugin connectors
.search-banner {
display: none;
}

.showcased-topic-list {
display: none;
}

.mint-component-extensions {
.search-banner,
.showcased-topic-list {
display: block;
}
}
34 changes: 0 additions & 34 deletions javascripts/discourse/api-initializers/discourse-mint-theme.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{{#if searchBannerInstalled}}
<div class="search-banner">
<SearchBanner />
</div>
{{/if}}

{{#if showcasedCategoriesInstalled}}
<TwoTopicList />
{{/if}}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import { getOwner } from "discourse-common/lib/get-owner";

export default {
setupComponent(attrs, component) {
if (getOwner(this).resolveRegistration("component:two-topic-list")) {
component.set("showcasedCategoriesInstalled", true);
}

if (getOwner(this).resolveRegistration("component:search-banner")) {
component.set("searchBannerInstalled", true);
}
},
};

0 comments on commit c0aae99

Please sign in to comment.