feat: add footer with app version

This commit is contained in:
Jefferson Mantovani 2025-10-31 07:14:44 -03:00
parent 57714fac9b
commit d33d7f8538
3 changed files with 24 additions and 2 deletions

2
env.d.ts vendored
View File

@ -1 +1,3 @@
/// <reference types="vite/client" />
declare const __APP_VERSION__: string;

View File

@ -12,6 +12,9 @@ const route = useRoute();
const injected = injectedModule();
const targetNetwork = ref(DEFAULT_NETWORK);
const currentYear = new Date().getFullYear();
const appVersion = __APP_VERSION__;
const web3Onboard = init({
wallets: [injected],
chains: Object.values(Networks).map((network) => ({
@ -32,7 +35,7 @@ if (!connectedWallet) {
</script>
<template>
<div class="p-3 sm:p-4 md:p-8">
<main class="p-3 sm:p-4 md:p-8">
<TopBar />
<RouterView v-slot="{ Component }">
<template v-if="Component">
@ -53,5 +56,10 @@ if (!connectedWallet) {
</template>
</RouterView>
<ToasterComponent :targetNetwork="targetNetwork" />
</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>

View File

@ -1,16 +1,28 @@
import { fileURLToPath, URL } from "node:url";
import { execSync } from "node:child_process";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
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/
export default defineConfig({
base: "./",
build: {
target: "esnext",
},
define: {
__APP_VERSION__: JSON.stringify(getGitCommitHash()),
},
optimizeDeps: {
esbuildOptions: {
target: "esnext",