Skip to content

Commit 93523cd

Browse files
authored
Merge pull request #175 from lightninglabs/pool-ui
Pool UI (preview)
2 parents 2380c01 + 024e270 commit 93523cd

File tree

224 files changed

+20638
-4874
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

224 files changed

+20638
-4874
lines changed

.github/workflows/main.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,11 @@ jobs:
7777
os: [ubuntu-latest, windows-latest, macOS-latest]
7878

7979
steps:
80+
- name: Set git to use LF
81+
run: |
82+
git config --global core.eol lf
83+
git config --global core.autocrlf false
84+
8085
- name: git checkout
8186
uses: actions/checkout@v2
8287

.vscode/settings.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,5 +66,5 @@
6666
"eslint.workingDirectories": [
6767
"./app"
6868
],
69-
"eslint.enable": true
69+
"typescript.tsdk": "./app/node_modules/typescript/lib"
7070
}

app/.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
"@typescript-eslint/explicit-function-return-type": "off",
2525
"@typescript-eslint/explicit-member-accessibility": "off",
2626
"@typescript-eslint/no-explicit-any": 0,
27-
"@typescript-eslint/explicit-module-boundary-types": "off"
27+
"@typescript-eslint/explicit-module-boundary-types": "off",
28+
"prettier/prettier": ["error", { "endOfLine": "auto" }]
2829
}
2930
}

app/.storybook/preview.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import React from 'react';
2-
import 'mobx-react-lite/batchingForReactDom';
32
import { addDecorator } from '@storybook/react';
43
import '../src/App.scss';
54
import '../src/i18n';

app/package.json

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,25 +23,27 @@
2323
"big.js": "5.2.2",
2424
"bootstrap": "4.5.0",
2525
"copy-to-clipboard": "3.3.1",
26+
"d3": "6.3.1",
2627
"date-fns": "2.14.0",
2728
"debug": "4.1.1",
2829
"emotion-theming": "10.0.27",
2930
"file-saver": "2.0.2",
31+
"history": "4.10.1",
3032
"http-proxy-middleware": "1.0.4",
3133
"i18next": "19.5.1",
3234
"i18next-browser-languagedetector": "5.0.0",
3335
"lodash": "4.17.19",
3436
"lottie-web": "5.7.0",
35-
"mobx": "5.15.4",
36-
"mobx-react-lite": "2.0.7",
37-
"mobx-react-router": "4.1.0",
37+
"mobx": "6.0.2",
38+
"mobx-react-lite": "3.0.1",
3839
"mobx-utils": "5.6.1",
40+
"rc-select": "11.5.0",
3941
"rc-tooltip": "4.2.1",
40-
"react": "16.13.1",
41-
"react-dom": "16.13.1",
42+
"react": "17.0.1",
43+
"react-dom": "17.0.1",
4244
"react-i18next": "11.7.0",
4345
"react-router": "5.2.0",
44-
"react-scripts": "3.4.1",
46+
"react-scripts": "4.0.0",
4547
"react-toastify": "6.0.6",
4648
"react-virtualized": "9.21.2",
4749
"reactour": "1.18.0",
@@ -54,35 +56,36 @@
5456
"@storybook/addons": "5.3.19",
5557
"@storybook/preset-create-react-app": "3.1.2",
5658
"@storybook/react": "5.3.19",
57-
"@testing-library/jest-dom": "5.11.0",
58-
"@testing-library/react": "10.4.3",
59-
"@testing-library/user-event": "12.0.11",
59+
"@testing-library/jest-dom": "5.11.5",
60+
"@testing-library/react": "11.1.1",
61+
"@testing-library/user-event": "12.2.0",
6062
"@types/big.js": "4.0.5",
63+
"@types/d3": "6.2.0",
6164
"@types/debug": "4.1.5",
6265
"@types/file-saver": "2.0.1",
6366
"@types/google-protobuf": "3.7.2",
6467
"@types/history": "4.7.6",
6568
"@types/jest": "26.0.3",
6669
"@types/lodash": "4.14.157",
6770
"@types/node": "14.0.14",
68-
"@types/react": "16.9.41",
69-
"@types/react-dom": "16.9.8",
71+
"@types/react": "16.9.56",
72+
"@types/react-dom": "16.9.9",
7073
"@types/react-router": "5.1.8",
7174
"@types/react-virtualized": "9.21.10",
7275
"@types/reactour": "1.17.1",
73-
"@typescript-eslint/eslint-plugin": "3.5.0",
74-
"@typescript-eslint/parser": "3.5.0",
76+
"@typescript-eslint/eslint-plugin": "4.7.0",
77+
"@typescript-eslint/parser": "4.7.0",
7578
"cross-env": "7.0.2",
76-
"eslint-config-prettier": "6.11.0",
79+
"eslint-config-prettier": "6.15.0",
7780
"eslint-plugin-prettier": "3.1.4",
78-
"eslint-plugin-react": "7.20.2",
81+
"eslint-plugin-react": "7.21.5",
7982
"google-protobuf": "3.12.2",
80-
"jest-canvas-mock": "2.2.0",
83+
"jest-canvas-mock": "2.3.0",
8184
"jest-environment-jsdom-sixteen": "1.0.3",
8285
"node-sass": "4.14.1",
83-
"prettier": "2.0.5",
86+
"prettier": "2.1.2",
8487
"ts-protoc-gen": "0.12.0",
85-
"typescript": "~3.9.5"
88+
"typescript": "4.0.5"
8689
},
8790
"eslintConfig": {
8891
"extends": "react-app",
@@ -92,6 +95,7 @@
9295
},
9396
"jest": {
9497
"globalSetup": "./src/setupTestsGlobal.ts",
98+
"resetMocks": false,
9599
"collectCoverageFrom": [
96100
"src/**/*.{js,jsx,ts,tsx}",
97101
"!src/**/*.d.ts",

app/public/index.html

Lines changed: 8 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -4,54 +4,33 @@
44
<meta charset="utf-8" />
55
<link rel="icon" href="%PUBLIC_URL%/icons/favicon-32x32.png" />
66
<meta name="theme-color" content="#000000" />
7-
<link rel="apple-touch-icon" sizes="48x48" href="%PUBLID_URL%/icons/icon-48x48.png" />
8-
<link rel="apple-touch-icon" sizes="72x72" href="%PUBLID_URL%/icons/icon-72x72.png" />
9-
<link rel="apple-touch-icon" sizes="96x96" href="%PUBLID_URL%/icons/icon-96x96.png" />
7+
<link rel="apple-touch-icon" sizes="48x48" href="%PUBLIC_URL%/icons/icon-48x48.png" />
8+
<link rel="apple-touch-icon" sizes="72x72" href="%PUBLIC_URL%/icons/icon-72x72.png" />
9+
<link rel="apple-touch-icon" sizes="96x96" href="%PUBLIC_URL%/icons/icon-96x96.png" />
1010
<link
1111
rel="apple-touch-icon"
1212
sizes="144x144"
13-
href="%PUBLID_URL%/icons/icon-144x144.png"
13+
href="%PUBLIC_URL%/icons/icon-144x144.png"
1414
/>
1515
<link
1616
rel="apple-touch-icon"
1717
sizes="192x192"
18-
href="%PUBLID_URL%/icons/icon-192x192.png"
18+
href="%PUBLIC_URL%/icons/icon-192x192.png"
1919
/>
2020
<link
2121
rel="apple-touch-icon"
2222
sizes="256x256"
23-
href="%PUBLID_URL%/icons/icon-256x256.png"
23+
href="%PUBLIC_URL%/icons/icon-256x256.png"
2424
/>
2525
<link
2626
rel="apple-touch-icon"
2727
sizes="384x384"
28-
href="%PUBLID_URL%/icons/icon-384x384.png"
28+
href="%PUBLIC_URL%/icons/icon-384x384.png"
2929
/>
3030
<link
3131
rel="apple-touch-icon"
3232
sizes="512x512"
33-
href="%PUBLID_URL%/icons/icon-512x512.png"
34-
/>
35-
<link
36-
rel="preload"
37-
href="%PUBLIC_URL%/fonts/OpenSans-Regular.ttf"
38-
as="font"
39-
type="font/ttf"
40-
crossorigin="anonymous"
41-
/>
42-
<link
43-
rel="preload"
44-
href="%PUBLIC_URL%/fonts/WorkSans-Light.ttf"
45-
as="font"
46-
type="font/ttf"
47-
crossorigin="anonymous"
48-
/>
49-
<link
50-
rel="preload"
51-
href="%PUBLIC_URL%/fonts/WorkSans-Medium.ttf"
52-
as="font"
53-
type="font/ttf"
54-
crossorigin="anonymous"
33+
href="%PUBLIC_URL%/icons/icon-512x512.png"
5534
/>
5635
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
5736
<title>Lightning Terminal</title>

app/scripts/build-protos.js

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ const appPath = join(__dirname, '..');
1313
*/
1414
const LND_VERSION_PATTERN = /^\tgithub\.com\/lightningnetwork\/lnd (v[\d.]+-beta)/ms;
1515
const LOOP_VERSION_PATTERN = /^\tgithub\.com\/lightninglabs\/loop (v[\d.]+-beta)/ms;
16+
const POOL_VERSION_PATTERN = /^\tgithub\.com\/lightninglabs\/pool (v[\d.]+-alpha)/ms;
1617

1718
/** mapping of proto files to the github url to download each from */
1819
const protoSources = async () => {
@@ -24,23 +25,32 @@ const protoSources = async () => {
2425
if (!lndVersion || lndVersion.length !== 2) {
2526
throw new Error(`go.mod did not match pattern ${LND_VERSION_PATTERN}`);
2627
}
27-
28+
2829
const loopVersion = goModSource.match(LOOP_VERSION_PATTERN);
2930
if (!loopVersion || loopVersion.length !== 2) {
3031
throw new Error(`go.mod did not match pattern ${LOOP_VERSION_PATTERN}`);
3132
}
3233

34+
const poolVersion = goModSource.match(POOL_VERSION_PATTERN);
35+
if (!poolVersion || poolVersion.length !== 2) {
36+
throw new Error(`go.mod did not match pattern ${POOL_VERSION_PATTERN}`);
37+
}
38+
3339
console.log(`Found lnd version ${lndVersion[1]} and loop version ${loopVersion[1]}.`);
3440
return {
3541
lnd: `lightningnetwork/lnd/${lndVersion[1]}/lnrpc/rpc.proto`,
3642
loop: `lightninglabs/loop/${loopVersion[1]}/looprpc/client.proto`,
43+
trader: `lightninglabs/pool/${poolVersion[1]}/poolrpc/trader.proto`,
44+
auctioneer: `lightninglabs/pool/${poolVersion[1]}/poolrpc/auctioneer.proto`,
3745
};
3846
};
3947

4048
/** list of proto files and patches to apply */
4149
const filePatches = {
4250
lnd: 'lnrpc: {}',
4351
loop: 'looprpc: {}',
52+
trader: 'poolrpc: {}',
53+
auctioneer: 'poolrpc: {}',
4454
'google/api/annotations': 'google: { api: {} }',
4555
'google/api/http': 'google: { api: {} }',
4656
};

app/src/App.scss

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,65 +14,66 @@
1414
@import '../node_modules/bootstrap/scss/grid';
1515
@import '../node_modules/bootstrap/scss/custom-forms';
1616

17-
// rc-tooltip component styles
17+
// react-component component styles
1818
@import '../node_modules/rc-tooltip/assets/bootstrap_white.css';
19+
@import './assets/styles/rc-select.scss';
1920

2021
// react-toastify styles
2122
@import '../node_modules/react-toastify/dist/ReactToastify.css';
2223

2324
@font-face {
2425
font-family: 'OpenSans Light';
25-
src: url('/fonts/OpenSans-Light.ttf') format('truetype');
26+
src: url('./assets/fonts/OpenSans-Light.ttf') format('truetype');
2627
font-style: normal;
2728
font-weight: 300;
2829
font-display: swap;
2930
}
3031
@font-face {
3132
font-family: 'OpenSans Regular';
32-
src: url('/fonts/OpenSans-Regular.ttf') format('truetype');
33+
src: url('./assets/fonts/OpenSans-Regular.ttf') format('truetype');
3334
font-style: normal;
3435
font-weight: 400;
3536
font-display: swap;
3637
}
3738
@font-face {
3839
font-family: 'OpenSans SemiBold';
39-
src: url('/fonts/OpenSans-SemiBold.ttf') format('truetype');
40+
src: url('./assets/fonts/OpenSans-SemiBold.ttf') format('truetype');
4041
font-style: normal;
4142
font-weight: 600;
4243
font-display: swap;
4344
}
4445
@font-face {
4546
font-family: 'OpenSans Bold';
46-
src: url('/fonts/OpenSans-Bold.ttf') format('truetype');
47+
src: url('./assets/fonts/OpenSans-Bold.ttf') format('truetype');
4748
font-style: normal;
4849
font-weight: 700;
4950
font-display: swap;
5051
}
5152
@font-face {
5253
font-family: 'OpenSans ExtraBold';
53-
src: url('/fonts/OpenSans-ExtraBold.ttf') format('truetype');
54+
src: url('./assets/fonts/OpenSans-ExtraBold.ttf') format('truetype');
5455
font-style: normal;
5556
font-weight: 800;
5657
font-display: swap;
5758
}
5859

5960
@font-face {
6061
font-family: 'WorkSans Light';
61-
src: url('/fonts/WorkSans-Light.ttf') format('truetype');
62+
src: url('./assets/fonts/WorkSans-Light.ttf') format('truetype');
6263
font-style: normal;
6364
font-weight: 300;
6465
font-display: swap;
6566
}
6667
@font-face {
6768
font-family: 'WorkSans Medium';
68-
src: url('/fonts/WorkSans-Medium.ttf') format('truetype');
69+
src: url('./assets/fonts/WorkSans-Medium.ttf') format('truetype');
6970
font-style: normal;
7071
font-weight: 500;
7172
font-display: swap;
7273
}
7374
@font-face {
7475
font-family: 'WorkSans SemiBold';
75-
src: url('/fonts/WorkSans-SemiBold.ttf') format('truetype');
76+
src: url('./assets/fonts/WorkSans-SemiBold.ttf') format('truetype');
7677
font-style: normal;
7778
font-weight: 600;
7879
font-display: swap;
@@ -81,7 +82,7 @@
8182
html,
8283
body,
8384
#root {
84-
min-height: 100vh;
85+
background-color: #252f4a;
8586
width: 100%;
8687
min-width: 1024px;
8788
}

app/src/App.tsx

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ import React from 'react';
22
import './App.scss';
33
import { createStore, StoreProvider } from 'store';
44
import AlertContainer from 'components/common/AlertContainer';
5+
import FullHeight from 'components/common/FullHeight';
56
import { ThemeProvider } from 'components/theme';
67
import TourHost from 'components/tour/TourHost';
78
import Routes from './Routes';
@@ -10,13 +11,15 @@ const App = () => {
1011
const store = createStore();
1112

1213
return (
13-
<StoreProvider store={store}>
14-
<ThemeProvider>
15-
<Routes />
16-
<AlertContainer />
17-
<TourHost />
18-
</ThemeProvider>
19-
</StoreProvider>
14+
<FullHeight>
15+
<StoreProvider store={store}>
16+
<ThemeProvider>
17+
<Routes />
18+
<AlertContainer />
19+
<TourHost />
20+
</ThemeProvider>
21+
</StoreProvider>
22+
</FullHeight>
2023
);
2124
};
2225

app/src/Routes.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import { Layout } from 'components/layout';
77
const LazyAuthPage = React.lazy(() => import('components/auth/AuthPage'));
88
const LazyLoopPage = React.lazy(() => import('components/loop/LoopPage'));
99
const LazyHistoryPage = React.lazy(() => import('components/history/HistoryPage'));
10+
const LazyPoolPage = React.lazy(() => import('components/pool/PoolPage'));
1011
const LazySettingsPage = React.lazy(() => import('components/settings/SettingsPage'));
1112

1213
const Routes: React.FC = () => {
@@ -23,6 +24,7 @@ const Routes: React.FC = () => {
2324
<Suspense fallback={<Loading delay={500} />}>
2425
<Route path="/loop" component={LazyLoopPage} />
2526
<Route path="/history" component={LazyHistoryPage} />
27+
<Route path="/pool" component={LazyPoolPage} />
2628
<Route path="/settings" component={LazySettingsPage} />
2729
</Suspense>
2830
</Switch>

0 commit comments

Comments
 (0)