From 223ca0cb67cbbcb245109ecda5574fc00d16284e Mon Sep 17 00:00:00 2001 From: Oscar Lafarga Date: Thu, 27 Oct 2022 16:14:27 -0400 Subject: [PATCH] Add LND version label to UI --- app/src/components/layout/Layout.tsx | 19 +++++++++++++++++++ app/src/store/stores/nodeStore.ts | 3 +++ 2 files changed, 22 insertions(+) diff --git a/app/src/components/layout/Layout.tsx b/app/src/components/layout/Layout.tsx index 853a6bf36..3bd393add 100644 --- a/app/src/components/layout/Layout.tsx +++ b/app/src/components/layout/Layout.tsx @@ -106,6 +106,24 @@ const Styled = { Fluid: styled.div` height: 100%; `, + Versions: styled.div` + position: absolute; + font-size: ${props => props.theme.sizes.xs}; + bottom: 0; + padding: 15px; + `, +}; + +const VersionInfo = () => { + const { nodeStore } = useStore(); + const { Versions } = Styled; + const shortVersion = nodeStore.version.split(' commit=')[0]; + + return ( + +
{`LND: v${shortVersion}`}
+
+ ); }; export const Layout: React.FC = ({ children }) => { @@ -123,6 +141,7 @@ export const Layout: React.FC = ({ children }) => { {children} diff --git a/app/src/store/stores/nodeStore.ts b/app/src/store/stores/nodeStore.ts index 61046ef7d..da699eed2 100644 --- a/app/src/store/stores/nodeStore.ts +++ b/app/src/store/stores/nodeStore.ts @@ -18,6 +18,8 @@ export default class NodeStore { */ private _knownTxns: string[] = []; + /** the version of the LND node */ + version = ''; /** the pubkey of the LND node */ pubkey = ''; /** the alias of the LND node */ @@ -71,6 +73,7 @@ export default class NodeStore { try { const info = await this._store.api.lnd.getInfo(); runInAction(() => { + this.version = info.version; this.pubkey = info.identityPubkey; this.alias = info.alias; this.blockHeight = info.blockHeight;