Skip to content

Commit

Permalink
feat(components): use PageFooter for all pages
Browse files Browse the repository at this point in the history
  • Loading branch information
rudnovd committed Mar 4, 2022
1 parent f301fd9 commit b09951a
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 57 deletions.
4 changes: 2 additions & 2 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
</template>

<script lang="ts">
import { selectedLanguage, setLanguage } from '@/i18n'
import { useRegisterSW } from 'virtual:pwa-register/vue'
import { defineAsyncComponent, defineComponent } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRoute } from 'vue-router'
import { selectedLanguage, setLanguage } from './i18n'
export default defineComponent({
name: 'App',
components: {
BaseNotification: defineAsyncComponent(() => import('./components/base/BaseNotification.vue')),
BaseNotification: defineAsyncComponent(() => import('@/components/base/BaseNotification.vue')),
},
setup() {
const route = useRoute()
Expand Down
43 changes: 0 additions & 43 deletions src/components/damageCalculator/DamageCalculatorFooter.vue

This file was deleted.

18 changes: 14 additions & 4 deletions src/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,15 +40,25 @@
"3": "Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:",
"4": "The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.",
"5": "THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE."
},
"sendErrorForm": {
"button": "Send Error",
"placeholder": "Describe error or paste links to screenshots (for example from https://imgur.com)"
}
},
"damageCalculatorFooter": {
"about": "About",
"homePage": {
"data": {
"1": "Heroes 3 tools",
"2": "Heroes 3 tools - set of tools to simplify calculations in Heroes of Might and Magic III: Horn of The Abyss.",
"3": "Send ideas or improvements to {email}",
"errorForm": "this form"
"3": "Send ideas or improvements to {email}"
}
},
"damageCalculatorPage": {
"about": "About Damage Calculator",
"data": {
"1": "Heroes 3 tools",
"2": "Heroes 3 tools - set of tools to simplify calculations in Heroes of Might and Magic III: Horn of The Abyss.",
"3": "Send ideas or improvements to {email}"
}
}
},
Expand Down
13 changes: 10 additions & 3 deletions src/views/CreaturesLibraryPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@
/>
</div>
</section>

<PageFooter :about="{ hide: true }" />
</template>

<script lang="ts">
Expand All @@ -59,7 +61,7 @@ import ObjectPortrait from '@/components/ObjectPortrait.vue'
import { selectedLanguage } from '@/i18n'
import { Creature } from '@/models/Creature'
import { useStore } from '@/store'
import { computed, defineComponent, onUnmounted, ref } from 'vue'
import { computed, defineAsyncComponent, defineComponent, onUnmounted, ref } from 'vue'
import { useI18n } from 'vue-i18n'
import { useRoute, useRouter } from 'vue-router'
Expand All @@ -70,6 +72,7 @@ export default defineComponent({
components: {
CreatureCard,
ObjectPortrait,
PageFooter: defineAsyncComponent(() => import('@/components/PageFooter.vue')),
},
setup() {
const store = useStore()
Expand Down Expand Up @@ -155,11 +158,11 @@ export default defineComponent({
.creatures-library-page {
min-width: 320px;
max-width: 1920px;
padding: 0 8px;
padding: 0 8px 16px;
margin: 0 auto;
@include media-medium {
padding: 0 24px;
padding: 0 24px 16px;
}
}
Expand Down Expand Up @@ -203,6 +206,10 @@ export default defineComponent({
grid-template-columns: 100%;
margin-bottom: 3rem;
&:last-child {
margin-bottom: 0;
}
@include media-medium {
grid-template-columns: 1fr 1fr;
}
Expand Down
19 changes: 15 additions & 4 deletions src/views/DamageCalculatorPage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,18 @@
</KeepAlive>
</main>

<DamageCalculatorFooter />
<PageFooter :about="{ text: t('components.damageCalculatorPage.about') }" border="none">
<template #aboutModal>
<h2>{{ t('components.damageCalculatorPage.data.1') }}</h2>
<p>{{ t('components.damageCalculatorPage.data.2') }}</p>

<i18n-t keypath="components.damageCalculatorPage.data.3" tag="p">
<template #email>
<a href="mailto:feedback@heroes3.tools" target="_blank">feedback@heroes3.tools</a>
</template>
</i18n-t>
</template>
</PageFooter>
</section>
</template>

Expand All @@ -47,9 +58,7 @@ export default defineComponent({
name: 'DamageCalculatorPage',
components: {
DamageCalculator,
DamageCalculatorFooter: defineAsyncComponent(
() => import('@/components/damageCalculator/DamageCalculatorFooter.vue')
),
PageFooter: defineAsyncComponent(() => import('@/components/PageFooter.vue')),
},
setup() {
const { t } = useI18n()
Expand Down Expand Up @@ -114,6 +123,8 @@ export default defineComponent({
}
return {
t,
calculators,
activeIndex,
calculatorTitle,
Expand Down
17 changes: 16 additions & 1 deletion src/views/HomePage.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,19 @@
</div>
</section>
</section>

<PageFooter>
<template #aboutModal>
<h2>{{ t('components.homePage.data.1') }}</h2>
<p>{{ t('components.homePage.data.2') }}</p>

<i18n-t keypath="components.homePage.data.3" tag="p">
<template #email>
<a href="mailto:feedback@heroes3.tools" target="_blank">feedback@heroes3.tools</a>
</template>
</i18n-t>
</template>
</PageFooter>
</template>

<script lang="ts">
Expand All @@ -30,6 +43,7 @@ export default defineComponent({
name: 'HomePage',
components: {
ObjectPortrait: defineAsyncComponent(() => import('@/components/ObjectPortrait.vue')),
PageFooter: defineAsyncComponent(() => import('@/components/PageFooter.vue')),
},
setup() {
const { t } = useI18n()
Expand All @@ -55,6 +69,7 @@ export default defineComponent({
]
return {
t,
router,
pages,
Expand All @@ -69,7 +84,7 @@ export default defineComponent({
grid-auto-rows: min-content;
gap: 16px;
min-width: 300px;
height: 100%;
height: calc(100% - 30px);
margin: 0 auto;
@include media-medium {
Expand Down

0 comments on commit b09951a

Please sign in to comment.