Skip to content
This repository was archived by the owner on Dec 18, 2022. It is now read-only.

Commit 82a3c21

Browse files
committed
add footer
1 parent b88c7cc commit 82a3c21

File tree

9 files changed

+150
-3
lines changed

9 files changed

+150
-3
lines changed

assets/images/logo_landscape.png

-5.43 KB
Binary file not shown.
-5.52 KB
Binary file not shown.

assets/images/logo_portrait.png

-1.53 KB
Binary file not shown.
-1.53 KB
Binary file not shown.

assets/locales/en.json

Lines changed: 0 additions & 3 deletions
This file was deleted.

components/layout/Footer.vue

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
<template>
2+
<footer class="relative bg-primary-500 pt-8 pb-6 mt-20">
3+
<div
4+
class="bottom-auto top-0 left-0 right-0 w-full absolute pointer-events-none overflow-hidden -mt-20"
5+
style="height: 80px"
6+
>
7+
<svg
8+
class="absolute bottom-0 overflow-hidden"
9+
xmlns="http://www.w3.org/2000/svg"
10+
preserveAspectRatio="none"
11+
version="1.1"
12+
viewBox="0 0 2560 100"
13+
x="0"
14+
y="0"
15+
>
16+
<polygon
17+
class="text-primary-500 fill-current"
18+
points="2560 0 2560 100 0 100"
19+
></polygon>
20+
</svg>
21+
</div>
22+
<div class="container mx-auto px-4">
23+
<div class="flex flex-wrap">
24+
<div class="w-full lg:w-6/12 px-4">
25+
<h4 class="text-3xl font-semibold text-white">
26+
{{ $t('footer.title') }}
27+
</h4>
28+
<h5 class="text-lg mt-1 mb-2 text-primary-100">
29+
{{ $t('footer.subtitle') }}
30+
</h5>
31+
<div class="mt-6" v-if="items">
32+
<a
33+
v-for="item in items"
34+
:key="item.icon"
35+
:class="`bg-white shadow-lg font-normal items-center justify-center align-center rounded-full outline-none focus:outline-none mr-2 p-3 inline-block hover:fill-child-white hover:bg-social-${item.icon}`"
36+
target="_blank"
37+
:href="item.link.url || item.link.cached_url"
38+
>
39+
<social-icon :icon-name="item.icon" />
40+
</a>
41+
</div>
42+
</div>
43+
<div class="w-full lg:w-6/12 pt-3 lg:pt-0 lg:px-4">
44+
<div class="flex flex-wrap items-top mb-6">
45+
<div class="w-full lg:w-6/12 px-4 ml-auto">
46+
<h5 class="text-2xl font-semibold text-white">
47+
{{ $t('footer.thanks') }}
48+
</h5>
49+
50+
<a
51+
href="https://helpdev.org"
52+
alt="Helpdev"
53+
target="_blank"
54+
rel="nofollow"
55+
>
56+
<img
57+
class="h-10 w-auto mt-2"
58+
src="@/assets/images/helpdev.png"
59+
alt="Logo Helpdev"
60+
/>
61+
</a>
62+
63+
<a
64+
href="https://www.storyblok.com/"
65+
alt="Storyblok"
66+
target="_blank"
67+
rel="nofollow"
68+
>
69+
<img
70+
class="h-10 w-auto"
71+
src="@/assets/images/storyblok.png"
72+
alt="Logo Storyblok"
73+
/>
74+
</a>
75+
</div>
76+
</div>
77+
</div>
78+
</div>
79+
</div>
80+
</footer>
81+
</template>
82+
83+
<script>
84+
export default {
85+
data(context) {
86+
return {
87+
items: context.$store.state.social.items
88+
};
89+
},
90+
watch: {
91+
$route() {
92+
this.items = this.$store.state.social.items;
93+
}
94+
}
95+
};
96+
</script>

helpers/common-page.helper.js

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,44 @@ export function loadMenuFromApi(context) {
8686
});
8787
}
8888

89+
export function loadSocialFromApi(context) {
90+
if (
91+
context.store.state.social.locale === context.i18n.locale &&
92+
context.store.state.social.items.length !== 0
93+
) {
94+
return Promise.resolve(context.store.state.social.items);
95+
}
96+
97+
return context.app.$storyapi
98+
.get(`cdn/stories/`, {
99+
starts_with: context.localePath('social'),
100+
version: 'published'
101+
})
102+
.then((response) => {
103+
const stories = response.data.stories;
104+
const items = stories && stories[0].content.items;
105+
106+
context.store.commit('social/setSocial', items);
107+
108+
return items;
109+
})
110+
.catch((res) => {
111+
if (!res.response) {
112+
console.error(res);
113+
context.error({
114+
statusCode: 404,
115+
message: 'Failed to receive content form api'
116+
});
117+
} else {
118+
console.error(res.response.data);
119+
context.error({
120+
statusCode: res.response.status,
121+
message: res.response.data
122+
});
123+
}
124+
});
125+
}
126+
89127
export function loadDonationsFromApi(context) {
90128
if (
91129
context.store.state.donations.locale === context.i18n.locale &&
@@ -128,6 +166,7 @@ export function loadDonationsFromApi(context) {
128166
export function loadPageContent(context, path) {
129167
return Promise.all([
130168
loadMenuFromApi(context),
169+
loadSocialFromApi(context),
131170
loadDonationsFromApi(context)
132171
]).then(([menu]) => {
133172
const item = menu.find(

plugins/common-stores.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import * as donationsStore from '../store/donations';
22
import * as menuStore from '../store/menu';
3+
import * as socialStore from '../store/social';
34

45
export function registerStore(name, store, storeModule) {
56
const module = {
@@ -16,5 +17,6 @@ export default async (context) => {
1617
const { store } = context;
1718

1819
registerStore('menu', store, menuStore);
20+
registerStore('social', store, socialStore);
1921
registerStore('donations', store, donationsStore);
2022
};

store/social.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
export const state = () => ({
2+
locale: null,
3+
items: []
4+
});
5+
6+
export const mutations = {
7+
setLocale(state, locale) {
8+
state.locale = locale;
9+
},
10+
setSocial(state, items) {
11+
state.items = items;
12+
}
13+
};

0 commit comments

Comments
 (0)