diff --git a/app/routes/demos/12-mini-game/interface/index.tsx b/app/routes/demos/12-mini-game/interface/index.tsx index d1df131..084b3c4 100644 --- a/app/routes/demos/12-mini-game/interface/index.tsx +++ b/app/routes/demos/12-mini-game/interface/index.tsx @@ -6,6 +6,8 @@ import useGame from "../use-game"; import styles from "./styles.module.css"; +import { EnvConfig } from "~/utils/env"; + export function Interface() { const timeRef = useRef(null); @@ -61,7 +63,7 @@ export function Interface() {

New Version

-

You can try new beta version 2 here. But beware, it's in progress, so it might not be perfect yet.

+

You can try new beta version 2 here. But beware, it's in progress, so it might not be perfect yet.

; } \ No newline at end of file diff --git a/app/types/env.d.ts b/app/types/env.d.ts new file mode 100644 index 0000000..41801a9 --- /dev/null +++ b/app/types/env.d.ts @@ -0,0 +1,9 @@ +/// + +interface ImportMetaEnv { + readonly VITE_NEXT_VERSION: string +} + +interface ImportMeta { + readonly env: ImportMetaEnv +} diff --git a/app/utils/env.ts b/app/utils/env.ts new file mode 100644 index 0000000..db86337 --- /dev/null +++ b/app/utils/env.ts @@ -0,0 +1,9 @@ +/** + * Environment configuration with proper typing + */ +export class EnvConfig { + static get next_version(): string { + console.log(import.meta.env); + return import.meta.env.VITE_NEXT_VERSION; + } +}