mirror of
https://github.com/theoludwig/theoludwig.git
synced 2024-12-08 00:44:30 +01:00
fix(footer): show 0.0.0-development
version in Footer in development
This commit is contained in:
parent
cd5e92b64a
commit
0eb780485c
@ -1,9 +1,10 @@
|
||||
import { getVersion } from "@/utils/getVersion"
|
||||
|
||||
import { FooterText } from "./FooterText"
|
||||
import { FooterVersion } from "./FooterVersion"
|
||||
|
||||
export const Footer = async (): Promise<JSX.Element> => {
|
||||
const { readPackage } = await import("read-pkg")
|
||||
const { version } = await readPackage()
|
||||
const version = await getVersion()
|
||||
|
||||
return (
|
||||
<footer className="flex flex-col items-center justify-center border-t-2 border-gray-600 bg-white py-6 text-lg dark:border-gray-400 dark:bg-black">
|
||||
|
8
utils/getVersion.ts
Normal file
8
utils/getVersion.ts
Normal file
@ -0,0 +1,8 @@
|
||||
export const getVersion = async (): Promise<string> => {
|
||||
if (process.env.NODE_ENV === "development") {
|
||||
return "0.0.0-development"
|
||||
}
|
||||
const { readPackage } = await import("read-pkg")
|
||||
const { version } = await readPackage()
|
||||
return version
|
||||
}
|
Loading…
Reference in New Issue
Block a user