@@ -7,80 +7,68 @@ export default class BrandHeaderContents extends Component {
77 @service site;
88
99 get shouldShow () {
10- return ! this .site .mobileView || settings .show_bar_on_mobile ;
10+ return this .site .desktopView || settings .show_bar_on_mobile ;
1111 }
1212
13- get brandLogo () {
14- const mobileView = this .site .mobileView ;
15- const mobileLogoUrl = settings .mobile_logo_url || " " ;
16- const showMobileLogo = mobileView && mobileLogoUrl .length > 0 ;
17- const logoUrl = settings .logo_url || " " ;
18- const logoDarkUrl = settings .logo_dark_url || " " ;
19- const title = settings .brand_name ;
20-
21- return {
22- mobileUrl: showMobileLogo ? mobileLogoUrl : null ,
23- lightImg: {
24- url: logoUrl,
25- },
26- darkImg: {
27- url: logoDarkUrl,
28- },
29- title,
30- };
13+ get mobileLogoUrl () {
14+ return this .site .mobileView ? settings .mobile_logo_url : null ;
3115 }
3216
33- get hasIcons () {
34- return settings . icons && settings .icons . length > 0 ;
17+ get lightLogo () {
18+ return { url : settings .logo_url || " " } ;
3519 }
3620
37- get hasLinks () {
38- return settings . links && settings .links . length > 0 ;
21+ get darkLogo () {
22+ return { url : settings .logo_dark_url || " " } ;
3923 }
4024
4125 <template >
4226 <div class =" title" >
4327 <a href ={{settings.website_url }} >
44- {{#if this . brandLogo.mobileUrl }}
28+ {{#if this . mobileLogoUrl }}
4529 <img
4630 id =" brand-logo"
4731 class =" logo-big"
48- src ={{this .brandLogo.mobileUrl }}
49- title ={{this .brandLogo.title }}
32+ src ={{this .mobileLogoUrl }}
33+ title ={{settings.brand_name }}
5034 />
51- {{else }}
35+ {{else if this . lightLogo.url }}
5236 <LightDarkImg
5337 id =" brand-logo"
5438 class =" logo-big"
55- @ lightImg ={{this .brandLogo.lightImg }}
56- @ darkImg ={{this .brandLogo.darkImg }}
57- title ={{this .brandLogo.title }}
39+ @ lightImg ={{this .lightLogo }}
40+ @ darkImg ={{this .darkLogo }}
41+ title ={{settings.brand_name }}
5842 />
43+ {{else }}
44+ <h2 id =" brand-text-logo" class =" text-logo" >
45+ {{settings.brand_name }}
46+ </h2 >
5947 {{/if }}
6048 </a >
6149 </div >
6250
63- {{#if this . hasLinks }}
51+ {{#if settings.links }}
6452 <nav class =" links" >
6553 <ul class =" nav {{if this . shouldShow ' nav-pills' }} " >
66- {{#each settings.links as | tl | }}
54+ {{#each settings.links as | link | }}
6755 <li >
68- <a href ={{tl .url }} target ={{tl .target }} >
69- {{tl .text }}
56+ <a href ={{link .url }} target ={{link .target }} >
57+ {{link .text }}
7058 </a >
7159 </li >
7260 {{/each }}
7361 </ul >
7462 </nav >
7563 {{/if }}
7664
77- {{#if this . hasIcons }}
65+ {{#if settings.icons }}
7866 <div class =" panel" >
7967 <ul class =" icons" >
80- {{#each settings.icons as | il | }}
68+ {{#each settings.icons as | iconLink | }}
8169 <li >
82- <a href ={{il .url }} target ={{il .target }} >
83- {{dIcon il .icon_name}}
70+ <a href ={{iconLink .url }} target ={{iconLink .target }} >
71+ {{dIcon iconLink .icon_name}}
8472 </a >
8573 </li >
8674 {{/each }}
0 commit comments