feat: add footer with app version
This commit is contained in:
parent
57714fac9b
commit
d33d7f8538
2
env.d.ts
vendored
2
env.d.ts
vendored
@ -1 +1,3 @@
|
|||||||
/// <reference types="vite/client" />
|
/// <reference types="vite/client" />
|
||||||
|
|
||||||
|
declare const __APP_VERSION__: string;
|
||||||
|
|||||||
12
src/App.vue
12
src/App.vue
@ -12,6 +12,9 @@ const route = useRoute();
|
|||||||
const injected = injectedModule();
|
const injected = injectedModule();
|
||||||
const targetNetwork = ref(DEFAULT_NETWORK);
|
const targetNetwork = ref(DEFAULT_NETWORK);
|
||||||
|
|
||||||
|
const currentYear = new Date().getFullYear();
|
||||||
|
const appVersion = __APP_VERSION__;
|
||||||
|
|
||||||
const web3Onboard = init({
|
const web3Onboard = init({
|
||||||
wallets: [injected],
|
wallets: [injected],
|
||||||
chains: Object.values(Networks).map((network) => ({
|
chains: Object.values(Networks).map((network) => ({
|
||||||
@ -32,7 +35,7 @@ if (!connectedWallet) {
|
|||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div class="p-3 sm:p-4 md:p-8">
|
<main class="p-3 sm:p-4 md:p-8">
|
||||||
<TopBar />
|
<TopBar />
|
||||||
<RouterView v-slot="{ Component }">
|
<RouterView v-slot="{ Component }">
|
||||||
<template v-if="Component">
|
<template v-if="Component">
|
||||||
@ -53,5 +56,10 @@ if (!connectedWallet) {
|
|||||||
</template>
|
</template>
|
||||||
</RouterView>
|
</RouterView>
|
||||||
<ToasterComponent :targetNetwork="targetNetwork" />
|
<ToasterComponent :targetNetwork="targetNetwork" />
|
||||||
</div>
|
</main>
|
||||||
|
<footer class="mt-20 pt-2 pb-2 border-t border-gray-700 text-center">
|
||||||
|
<div class="flex justify-center items-center">
|
||||||
|
<p class="text-gray-400 text-xs"> Versão: {{ appVersion }} | © {{ currentYear }} P2Pix. Todos os direitos reservados.</p>
|
||||||
|
</div>
|
||||||
|
</footer>
|
||||||
</template>
|
</template>
|
||||||
|
|||||||
@ -1,16 +1,28 @@
|
|||||||
import { fileURLToPath, URL } from "node:url";
|
import { fileURLToPath, URL } from "node:url";
|
||||||
|
import { execSync } from "node:child_process";
|
||||||
|
|
||||||
import { defineConfig } from "vite";
|
import { defineConfig } from "vite";
|
||||||
import vue from "@vitejs/plugin-vue";
|
import vue from "@vitejs/plugin-vue";
|
||||||
import vueJsx from "@vitejs/plugin-vue-jsx";
|
import vueJsx from "@vitejs/plugin-vue-jsx";
|
||||||
import svgLoader from "vite-svg-loader";
|
import svgLoader from "vite-svg-loader";
|
||||||
|
|
||||||
|
function getGitCommitHash(): string {
|
||||||
|
try {
|
||||||
|
return execSync("git rev-parse --short HEAD").toString().trim();
|
||||||
|
} catch (error) {
|
||||||
|
return "unknown";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// https://vitejs.dev/config/
|
// https://vitejs.dev/config/
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
base: "./",
|
base: "./",
|
||||||
build: {
|
build: {
|
||||||
target: "esnext",
|
target: "esnext",
|
||||||
},
|
},
|
||||||
|
define: {
|
||||||
|
__APP_VERSION__: JSON.stringify(getGitCommitHash()),
|
||||||
|
},
|
||||||
optimizeDeps: {
|
optimizeDeps: {
|
||||||
esbuildOptions: {
|
esbuildOptions: {
|
||||||
target: "esnext",
|
target: "esnext",
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user