Skip to content

Commit ca4de1e

Browse files
committed
Added env and version
1 parent dc9eb9b commit ca4de1e

6 files changed

Lines changed: 29 additions & 6 deletions

File tree

Lines changed: 5 additions & 0 deletions
Loading

‎frontend/swap-ui/src/environments/index.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
const env = import.meta.env;
2-
32
const PROXY_ENV = env.VITE_PROXY_ENV;
43
const SOLANA_URL = env.VITE_SOLANA_URL;
54
const NEON_CORE_API_RPC_URL = env.VITE_NEON_CORE_API_RPC_URL;

‎frontend/swap-ui/src/layout/Footer.tsx‎

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,19 @@
11
import React from 'react';
2+
declare const APP_VERSION: string;
23

34
const Footer = () => {
45
return (
56
<footer className={'p-2'}>
67
<div className={'flex flex-row items-center justify-between'}>
78
<div className={'flex flex-row items-center'}>
9+
<a href="https://github.com/neonlabsorg/neon-solana-signature-demo" target="_blank"
10+
className={'github-link'}>
11+
<img src="/assets/icons/github.svg" alt="Github" />
12+
<span>v{APP_VERSION}</span>
13+
</a>
814
</div>
9-
<div className={'text-gray-800'}>
10-
NeonLabs &copy; {new Date().getFullYear()}
15+
<div className={'flex flex-row items-center gap-[6px] text-gray-700'}>
16+
<span>NeonLabs &copy; {new Date().getFullYear()}</span>
1117
</div>
1218
</div>
1319
</footer>

‎frontend/swap-ui/src/layout/Header.tsx‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import { WalletMultiButton } from '@solana/wallet-adapter-react-ui';
22
import { LAMPORTS_PER_SOL } from '@solana/web3.js';
33
import { useProxyConnection } from '../wallet/Connection.tsx';
4+
import { PROXY_ENV } from '../environments';
45
import './layout.css';
56

67
const Header = () => {
@@ -10,7 +11,7 @@ const Header = () => {
1011
<div className={'flex flex-row items-left justify-between w-full max-w-2xl p-2'}>
1112
<div className="logo">
1213
<img src="/assets/logo.svg" width="32" height="32" alt="Neon" />
13-
<span><strong>Swap</strong> Demo</span>
14+
<span><strong>Swap</strong> Demo (<span className='capitalize'>{PROXY_ENV}</span>)</span>
1415
</div>
1516
<div className={'flex flex-row gap-[8px] items-center'}>
1617
<div className="balance">{walletBalance > 0 && `${(walletBalance / LAMPORTS_PER_SOL).toFixed(6)} SOL`}</div>

‎frontend/swap-ui/src/layout/layout.css‎

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,3 +3,11 @@
33
.logo {
44
@apply flex flex-row items-center gap-[8px] text-lg;
55
}
6+
7+
.github-link {
8+
@apply flex flex-row items-center gap-[4px] text-gray-700;
9+
10+
&:hover {
11+
@apply text-gray-600;
12+
}
13+
}

‎frontend/swap-ui/vite.config.ts‎

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@ import { nodePolyfills } from 'vite-plugin-node-polyfills';
33
import tailwindcss from '@tailwindcss/vite';
44
import react from '@vitejs/plugin-react';
55
import commonjs from 'vite-plugin-commonjs';
6-
import dynamicImport from 'vite-plugin-dynamic-import'
6+
import dynamicImport from 'vite-plugin-dynamic-import';
7+
78

89
export default defineConfig({
910
plugins: [
@@ -12,5 +13,8 @@ export default defineConfig({
1213
nodePolyfills({ include: ['fs', 'stream', 'buffer', 'util', 'http', 'https'] }),
1314
commonjs(),
1415
dynamicImport()
15-
]
16+
],
17+
define: {
18+
APP_VERSION: JSON.stringify(process.env.npm_package_version)
19+
}
1620
});

0 commit comments

Comments
 (0)