@@ -7,80 +7,68 @@ export default class BrandHeaderContents extends Component {
7
7
@service site;
8
8
9
9
get shouldShow () {
10
- return ! this .site .mobileView || settings .show_bar_on_mobile ;
10
+ return this .site .desktopView || settings .show_bar_on_mobile ;
11
11
}
12
12
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 ;
31
15
}
32
16
33
- get hasIcons () {
34
- return settings . icons && settings .icons . length > 0 ;
17
+ get lightLogo () {
18
+ return { url : settings .logo_url || " " } ;
35
19
}
36
20
37
- get hasLinks () {
38
- return settings . links && settings .links . length > 0 ;
21
+ get darkLogo () {
22
+ return { url : settings .logo_dark_url || " " } ;
39
23
}
40
24
41
25
<template >
42
26
<div class =" title" >
43
27
<a href ={{settings.website_url }} >
44
- {{#if this . brandLogo.mobileUrl }}
28
+ {{#if this . mobileLogoUrl }}
45
29
<img
46
30
id =" brand-logo"
47
31
class =" logo-big"
48
- src ={{this .brandLogo.mobileUrl }}
49
- title ={{this .brandLogo.title }}
32
+ src ={{this .mobileLogoUrl }}
33
+ title ={{settings.brand_name }}
50
34
/>
51
- {{else }}
35
+ {{else if this . lightLogo.url }}
52
36
<LightDarkImg
53
37
id =" brand-logo"
54
38
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 }}
58
42
/>
43
+ {{else }}
44
+ <h2 id =" brand-text-logo" class =" text-logo" >
45
+ {{settings.brand_name }}
46
+ </h2 >
59
47
{{/if }}
60
48
</a >
61
49
</div >
62
50
63
- {{#if this . hasLinks }}
51
+ {{#if settings.links }}
64
52
<nav class =" links" >
65
53
<ul class =" nav {{if this . shouldShow ' nav-pills' }} " >
66
- {{#each settings.links as | tl | }}
54
+ {{#each settings.links as | link | }}
67
55
<li >
68
- <a href ={{tl .url }} target ={{tl .target }} >
69
- {{tl .text }}
56
+ <a href ={{link .url }} target ={{link .target }} >
57
+ {{link .text }}
70
58
</a >
71
59
</li >
72
60
{{/each }}
73
61
</ul >
74
62
</nav >
75
63
{{/if }}
76
64
77
- {{#if this . hasIcons }}
65
+ {{#if settings.icons }}
78
66
<div class =" panel" >
79
67
<ul class =" icons" >
80
- {{#each settings.icons as | il | }}
68
+ {{#each settings.icons as | iconLink | }}
81
69
<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}}
84
72
</a >
85
73
</li >
86
74
{{/each }}
0 commit comments