Skip to content

Commit

Permalink
DEV: Update for glimmer header
Browse files Browse the repository at this point in the history
  • Loading branch information
jancernik committed Mar 21, 2024
1 parent f90a07e commit 8ef59f8
Show file tree
Hide file tree
Showing 8 changed files with 49 additions and 103 deletions.
2 changes: 1 addition & 1 deletion common/common.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
.b-header,
.brand-header-widgetized {
.brand-header-contents {
#brand-logo {
max-height: 32px;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
import Component from "@glimmer/component";
import { service } from "@ember/service";
import { not, and } from "truth-helpers";
import MountWidget from "discourse/components/mount-widget";
import DMenu from "float-kit/components/d-menu";
import BrandHeaderContents from "../../components/brand-header-contents";
import dIcon from "discourse-common/helpers/d-icon";

export default class BrandHeaderContainer extends Component {
@service site;

<template>
{{#if (and (not settings.show_bar_on_mobile) this.site.mobileView)}}
<DMenu
@icon="bars"
title="hamburger_brand_menu"
id="toggle-hamburger-brand-menu"
class="brand-header-toggle icon btn-flat"
>
<:content>
<div class="brand-header-contents">
<BrandHeaderContents />
</div>
</:content>
</DMenu>
{{/if}}
</template>
}
4 changes: 2 additions & 2 deletions javascripts/discourse/initializers/initialize-brand-header.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ export default {

initialize() {
registerWidgetShim(
"brand-header-widgetized",
"div.brand-header-widgetized",
"brand-header-contents",
"div.brand-header-contents",
hbs`<BrandHeaderContents />`
);

Expand Down
17 changes: 0 additions & 17 deletions javascripts/discourse/initializers/initialize-mobile-decorator.js

This file was deleted.

39 changes: 0 additions & 39 deletions javascripts/discourse/widgets/brand-header-container.js

This file was deleted.

20 changes: 0 additions & 20 deletions javascripts/discourse/widgets/brand-header-icon.js

This file was deleted.

23 changes: 0 additions & 23 deletions javascripts/discourse/widgets/hamburger-brand-menu.js

This file was deleted.

19 changes: 18 additions & 1 deletion mobile/mobile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,15 @@
}
}

.home-logo-wrapper-outlet {
display: flex;
.brand-header-container {
display: flex;
justify-content: center;
align-items: center;
}
}

// applies when show_bar_on_mobile is unchecked
.d-header .brand-header-toggle {
list-style: none;
Expand All @@ -19,7 +28,14 @@
}
}

.brand-header-widgetized {
.brand-header-contents {
padding: 0.5em;
width: 320px;
ul {
list-style: none;
margin: 0;
}

.nav {
border-top: 1px solid var(--primary-low);
border-bottom: 1px solid var(--primary-low);
Expand All @@ -45,6 +61,7 @@

.icons {
display: flex;
height: 26px;
a {
padding: 0.33em 0.6em;
.d-icon {
Expand Down

0 comments on commit 8ef59f8

Please sign in to comment.