Merge pull request #8 from doiim/feat/app-footer
feat: add footer with app version
This commit is contained in:
commit
b27b07fe47
2
env.d.ts
vendored
2
env.d.ts
vendored
@ -1 +1,3 @@
|
||||
/// <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 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" />
|
||||
</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>
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user