Skip to content

Commit

Permalink
Merge pull request #401 from jiep/400-add-version-to-frontend
Browse files Browse the repository at this point in the history
Add version to frontend
  • Loading branch information
jiep authored Dec 28, 2024
2 parents e93c106 + 7b935d0 commit ff0634b
Show file tree
Hide file tree
Showing 7 changed files with 29 additions and 5 deletions.
2 changes: 2 additions & 0 deletions env.d.ts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
/// <reference types="vite/client" />

declare const __APP_VERSION__: string
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ts-metro",
"version": "1.5.0",
"version": "1.5.1",
"type": "module",
"scripts": {
"dev": "vite",
Expand Down
3 changes: 3 additions & 0 deletions src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,18 @@
.app.flex.flex-col.bg-gray-300.bg-contain.bg-center.overflow-x-auto.h-screen(class="md:w-screen")
NavBar/
router-view/
FooterVersion/
</template>

<script lang="ts">
import NavBar from '@/components/NavBar.vue'
import FooterVersion from '@/components/Footer.vue'
export default {
name: 'HomeView',
components: {
NavBar,
FooterVersion,
},
}
</script>
16 changes: 16 additions & 0 deletions src/components/Footer.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
<template lang="pug">
footer.text-center.text-white
p.text-xs v{{version}}
</template>

<script lang="ts">
import { defineComponent } from 'vue'
export default defineComponent({
name: 'NavBar',
setup() {
const version = __APP_VERSION__
return { version }
},
})
</script>
4 changes: 2 additions & 2 deletions src/components/MetroMadrid.vue
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<template lang="pug">
.opacity-90.h-full(class="md:flex md:overflow-y-auto")
.opacity-90(class="md:flex md:overflow-y-auto")
section.flex.m-4.justify-center.items-center
form.bg-gray-50.shadow-xl.rounded-lg.p-4.w-full(class="md:p-8")
label.block.mb-4
Expand All @@ -20,7 +20,7 @@
LoadingIcon.fill-white.w-4.animate-spin(v-if="isLoading")

section.flex.flex-1.m-4
.bg-gray-50.shadow-xl.rounded-lg.p-4.w-full.mb-4(class="md:h-full md:p-8")
.bg-gray-50.shadow-xl.rounded-lg.p-4.w-full(class="md:h-full md:p-8")
template(v-if="clicked")
.flex.flex-col(class="md:h-full md:overflow-y-auto")
StatsItem.bg-gray-50(:from="metro.getStationById(selectedOrigin).getName()",
Expand Down
3 changes: 3 additions & 0 deletions vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,4 +94,7 @@ export default defineConfig({
'@': fileURLToPath(new URL('./src', import.meta.url))
},
},
define: {
__APP_VERSION__: JSON.stringify(version),
},
})

0 comments on commit ff0634b

Please sign in to comment.