Skip to content
This repository has been archived by the owner on May 31, 2023. It is now read-only.

Commit

Permalink
Update rococo (#1085)
Browse files Browse the repository at this point in the history
* fix: account encoding for copy on click (#1075)

* Updated trade form / pools form copy (#1078)

* adjust metadata

* added multi environments

* remove console log

* disable xyk

* env urls

* metadata & env builds

* docker build rococo

Co-authored-by: dexterslabor <dexterslabor@users.noreply.github.com>
Co-authored-by: lumir-mrkva <mrq@mrq.cz>
  • Loading branch information
3 people committed Jul 27, 2022
1 parent f828d8b commit e12bd5e
Show file tree
Hide file tree
Showing 8 changed files with 96 additions and 44 deletions.
1 change: 1 addition & 0 deletions .env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_ENV='development'
2 changes: 2 additions & 0 deletions .env.production
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_ENV='production'
REACT_APP_NODE_URL='wss://rpc.basilisk.cloud'
2 changes: 2 additions & 0 deletions .env.rococo
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
REACT_APP_ENV='rococo'
REACT_APP_NODE_URL=wss://rpc-01.basilisk-rococo.hydradx.io
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ COPY . .
ARG GITHUB_SHA
ENV PUBLIC_URL /
ENV REACT_APP_NODE_URL "wss://rpc-01.basilisk-rococo.hydradx.io"
RUN yarn && yarn run build
RUN yarn && yarn run build:rococo

FROM node:lts-slim

Expand Down
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -92,10 +92,13 @@
"web-vitals": "^1.0.1"
},
"scripts": {
"start": "export NODE_OPTIONS=--openssl-legacy-provider && craco start --openssl-legacy-provider",
"start:rococo": "REACT_APP_NODE_URL=wss://rpc-01.basilisk-rococo.hydradx.io craco start",
"build": "export NODE_OPTIONS=--openssl-legacy-provider && craco build",
"build:deployment": "export REACT_APP_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) && craco build",
"start:development": "env-cmd -f .env.development craco start --openssl-legacy-provider",
"start:rococo": "env-cmd -f .env.rococo craco start --openssl-legacy-provider",
"start:production": "env-cmd -f .env.production craco start --openssl-legacy-provider",
"build": "craco build",
"build:development": "export REACT_APP_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) && env-cmd -f .env.development craco build",
"build:rococo": "export REACT_APP_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) && env-cmd -f .env.rococo craco build",
"build:production": "export REACT_APP_GIT_BRANCH=$(git rev-parse --abbrev-ref HEAD) && env-cmd -f .env.production craco build",
"test": "craco test",
"test:ci": "CI=true craco test",
"test:debug": "craco --inspect-brk test --runInBand --no-cache",
Expand Down
3 changes: 2 additions & 1 deletion src/components/Pools/PoolsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1251,7 +1251,8 @@ export const PoolsForm = ({
// },
},
})}
disabled={!isValid || tradeLoading || !isDirty}
// disabled={!isValid || tradeLoading || !isDirty}
disabled={true}
value={getSubmitText()}
/>
</form>
Expand Down
3 changes: 2 additions & 1 deletion src/components/Trade/TradeForm/TradeForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -1000,7 +1000,8 @@ export const TradeForm = ({
},
},
})}
disabled={!isValid || tradeLoading || !isDirty}
// disabled={!isValid || tradeLoading || !isDirty}
disabled={true}
value={getSubmitText()}
/>
</form>
Expand Down
116 changes: 79 additions & 37 deletions src/pages/TradePage/TradePage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,46 +63,88 @@ export interface TradeChartProps {

// TODO EXTRACT
export const idToAsset = (id: string | null) => {
const assetMetadata: Record<string, any> = {
'0': {
id: '0',
symbol: 'BSX',
fullName: 'Basilisk',
icon: BSX,
},
'5': {
id: '5',
symbol: 'KSM',
fullName: 'Kusama',
icon: KSM,
},
'4': {
id: '4',
symbol: 'aUSD',
fullName: 'Acala USD',
icon: AUSD,
},
'6': {
id: '6',
symbol: 'LP BSX/KSM',
fullName: 'BSX/KSM Share token',
icon: Unknown,
},
'7': {
id: '7',
symbol: 'LP BSX/aUSD',
fullName: 'BSX/aUSD Share token',
icon: Unknown,
},
'8': {
id: '8',
symbol: 'LP KSM/aUSD',
fullName: 'KSM/aUSD Share token',
icon: Unknown,
const assetMetadata: any = {
rococo: {
'0': {
id: '0',
symbol: 'BSX',
fullName: 'Basilisk',
icon: BSX,
},
'5': {
id: '5',
symbol: 'KSM',
fullName: 'Kusama',
icon: KSM,
},
'4': {
id: '4',
symbol: 'aUSD',
fullName: 'Acala USD',
icon: AUSD,
},
'6': {
id: '6',
symbol: 'LP BSX/KSM',
fullName: 'BSX/KSM Share token',
icon: Unknown,
},
'7': {
id: '7',
symbol: 'LP BSX/aUSD',
fullName: 'BSX/aUSD Share token',
icon: Unknown,
},
'8': {
id: '8',
symbol: 'LP KSM/aUSD',
fullName: 'KSM/aUSD Share token',
icon: Unknown,
},
},
production: {
'0': {
id: '0',
symbol: 'BSX',
fullName: 'Basilisk',
icon: BSX,
},
'1': {
id: '1',
symbol: 'KSM',
fullName: 'Kusama',
icon: KSM,
},
'2': {
id: '2',
symbol: 'aUSD',
fullName: 'Acala USD',
icon: AUSD,
},
'3': {
id: '3',
symbol: 'LP BSX/aUSD',
fullName: 'BSX/aUSD Share token',
icon: Unknown,
},
'4': {
id: '4',
symbol: 'LP BSX/KSM',
fullName: 'BSX/KSM Share token',
icon: Unknown,
},
'5': {
id: '5',
symbol: 'LP KSM/aUSD',
fullName: 'KSM/aUSD Share token',
icon: Unknown,
},
}
};

return assetMetadata[id!] as any || id && {
assetMetadata['development'] = assetMetadata['rococo'];

return assetMetadata[process.env.REACT_APP_ENV || 'production'][id!] as any || id && {
id,
symbol: horizontalBar,
fullName: `Unknown asset ${id}`,
Expand Down

0 comments on commit e12bd5e

Please sign in to comment.