Jelajahi Sumber

feat: display app version (#98)

Lucas Neves Pereira 4 minggu lalu
induk
melakukan
4bd816b036
3 mengubah file dengan 16 tambahan dan 0 penghapusan
  1. 3 0
      app/[locale]/layout.tsx
  2. 10 0
      src/components/version.tsx
  3. 3 0
      src/shared/lib/version.ts

+ 3 - 0
app/[locale]/layout.tsx

@@ -10,6 +10,7 @@ import { WorkoutSessionsSynchronizer } from "@/features/workout-session/ui/worko
 import { ThemeSynchronizer } from "@/features/theme/ui/ThemeSynchronizer";
 import { Header } from "@/features/layout/Header";
 import { Footer } from "@/features/layout/Footer";
+import { Version } from "@/components/version";
 import { TailwindIndicator } from "@/components/utils/TailwindIndicator";
 import { NextTopLoader } from "@/components/ui/next-top-loader";
 import { ServiceWorkerRegistration } from "@/components/pwa/ServiceWorkerRegistration";
@@ -217,6 +218,8 @@ export default async function RootLayout({ params, children }: RootLayoutProps)
               <Footer />
             </div>
 
+            <Version />
+
             <TailwindIndicator />
           </Providers>
         </body>

+ 10 - 0
src/components/version.tsx

@@ -0,0 +1,10 @@
+import { appVersion } from "@/shared/lib/version";
+
+export const Version = () => (
+  <div className="absolute bottom-2 right-4">
+    <span className="text-xs text-gray-500 dark:text-gray-600/50">
+      v{appVersion}
+    </span>
+  </div>
+
+);

+ 3 - 0
src/shared/lib/version.ts

@@ -0,0 +1,3 @@
+import pkg from "../../../package.json";
+
+export const appVersion = pkg.version;