Skip to content

Commit 4783e88

Browse files
committed
update new app header
1 parent 2056502 commit 4783e88

File tree

4 files changed

+57
-11
lines changed

4 files changed

+57
-11
lines changed

components/Toolbar/Energy/Narrow.vue

+3-3
Original file line numberDiff line numberDiff line change
@@ -308,17 +308,17 @@ export default {
308308
.header-dropdowns {
309309
display: flex;
310310
align-items: center;
311-
padding: 6px;
311+
padding: 10px;
312312
313313
.dropdown {
314314
font-size: 1rem;
315315
}
316316
}
317317
318318
.options {
319-
padding: 6px 12px 6px;
319+
padding: 10px;
320320
display: flex;
321-
gap: 6px;
321+
gap: 10px;
322322
}
323323
324324
.export-bar {

components/layout/NewAppHeader.vue

+40-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<OpenElectricityLogo />
77
</a>
88

9-
<nav>
9+
<nav :class="{ active: mobileNavActive }">
1010
<a
1111
v-for="link in links"
1212
:key="link.name"
@@ -64,10 +64,20 @@ export default {
6464
6565
data() {
6666
return {
67-
links: topLevelLinks,
68-
mobileNavActive: false
67+
links: topLevelLinks
6968
};
7069
},
70+
71+
computed: {
72+
mobileNavActive: {
73+
get() {
74+
return this.$store.state.app.mobileNavActive;
75+
},
76+
set(value) {
77+
this.$store.commit('app/mobileNavActive', value);
78+
}
79+
}
80+
}
7181
}
7282
</script>
7383

@@ -89,6 +99,16 @@ header {
8999
display: flex;
90100
align-items: center;
91101
}
102+
103+
@media screen and (max-width: 1036px) {
104+
position: sticky;
105+
top: 0;
106+
left: 0;
107+
right: 0;
108+
padding: 20px;
109+
border-bottom: 0;
110+
z-index: 1000;
111+
}
92112
}
93113
94114
nav {
@@ -97,7 +117,24 @@ nav {
97117
gap: 2rem;
98118
99119
@media screen and (max-width: 1036px) {
120+
flex-direction: column;
121+
gap: 20px;
122+
position: fixed;
123+
justify-content: flex-start;
124+
top: 70px;
125+
left: 0;
126+
right: 0;
127+
bottom: 0;
128+
z-index: 1001;
129+
background-color: #fff;
130+
font-weight: 500;
131+
font-size: 20px;
132+
padding: 20px;
100133
display: none;
134+
135+
&.active {
136+
display: flex;
137+
}
101138
}
102139
103140
a {

layouts/main.vue

+7-3
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,13 @@
3030
</transition>
3131

3232
<NewAppHeader />
33-
<Toolbar />
34-
<!-- <app-header /> -->
35-
<nuxt />
33+
34+
<div style="border-top: 1px solid #e5e5e5">
35+
<Toolbar />
36+
<!-- <app-header /> -->
37+
<nuxt />
38+
</div>
39+
3640
<app-footer v-if="!tabletBreak" />
3741
</div>
3842
</template>

store/app.js

+7-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@ export const state = () => ({
99
dashboardView: 'discrete-time', // 'time-of-day'
1010
facilitiesQuery: null,
1111
showFeatureToggle: false,
12-
siteAnnouncement: process.env.SITEWIDE_ANNOUNCEMENT
12+
siteAnnouncement: process.env.SITEWIDE_ANNOUNCEMENT,
13+
mobileNavActive: false
1314
})
1415

1516
export const getters = {
@@ -28,7 +29,8 @@ export const getters = {
2829
dashboardView: (state) => state.dashboardView,
2930
facilitiesQuery: (state) => state.facilitiesQuery,
3031
showFeatureToggle: (state) => state.showFeatureToggle,
31-
siteAnnouncement: (state) => state.siteAnnouncement
32+
siteAnnouncement: (state) => state.siteAnnouncement,
33+
mobileNavActive: (state) => state.mobileNavActive
3234
}
3335

3436
export const mutations = {
@@ -61,6 +63,9 @@ export const mutations = {
6163
},
6264
showFeatureToggle(state, showFeatureToggle) {
6365
state.showFeatureToggle = showFeatureToggle
66+
},
67+
mobileNavActive(state, mobileNavActive) {
68+
state.mobileNavActive = mobileNavActive
6469
}
6570
}
6671

0 commit comments

Comments
 (0)