Skip to content

Commit

Permalink
feat: Show Explorer client version from package.json in Footer (next …
Browse files Browse the repository at this point in the history
…to Explorer section label)
  • Loading branch information
msarcev committed Jan 24, 2024
1 parent c7af50a commit 632471a
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 2 deletions.
3 changes: 2 additions & 1 deletion client/src/app/components/footer/Footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -179,8 +179,9 @@ class Footer extends AsyncComponent<FooterProps, FooterState> {
url: string;
}[];
} {
const explorerVersion = EXPLORER_VERSION ?? "";
return {
label: "Explorer",
label: `Explorer${explorerVersion ? ` v${explorerVersion}` : ""}`,
items: this.props.dynamic.map((n) => ({
label: n.label,
url: `local://${n.url}`,
Expand Down
3 changes: 2 additions & 1 deletion client/src/app/components/footer/ShimmerFooter.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,9 @@ class ShimmerFooter extends AsyncComponent<FooterProps, FooterState> {
url: string;
}[];
} {
const explorerVersion = EXPLORER_VERSION ?? "";
return {
label: "Explorer",
label: `Explorer${explorerVersion ? ` v${explorerVersion}` : ""}`,
items: this.props.dynamic.map((n) => ({
label: n.label,
url: `local://${n.url}`,
Expand Down
1 change: 1 addition & 0 deletions client/vite-env.d.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/// <reference types="vite/client" />
/// <reference types="vite-plugin-svgr/client" />
declare const EXPLORER_VERSION: string;

3 changes: 3 additions & 0 deletions client/vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,9 @@ export default defineConfig(() => {
}),
nodePolyfills()
],
define: {
EXPLORER_VERSION: JSON.stringify(process.env.npm_package_version)
},
test: {
globals: true,
teardownTimeout: 100
Expand Down

0 comments on commit 632471a

Please sign in to comment.