Skip to content

Commit

Permalink
Merge branch 'main' into discord-bot_switch-to-goerli
Browse files Browse the repository at this point in the history
  • Loading branch information
Sascha5 committed Nov 8, 2023
2 parents 2e239a2 + c094db1 commit b99ab23
Show file tree
Hide file tree
Showing 290 changed files with 231,653 additions and 23,906 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/deploy-infrastructure-and-website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ jobs:
- name: Checkout current branch
uses: actions/checkout@v3

- uses: actions/setup-node@v3
with:
node-version: 16

- name: Cache Modules
id: cache-modules
uses: actions/cache@v2
Expand All @@ -47,6 +51,7 @@ jobs:
run: yarn turbo run build --filter=@diva/infrastructure --filter=@diva/app --cache-dir="./.turbo"
env:
CI: false
REACT_APP_INFURA_KEY: ${{ secrets.REACT_APP_INFURA_KEY }}

- name: Deploy Infra
run: yarn turbo run deploy --scope="@diva/infrastructure"
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/deploy-subgraphs-prod.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,10 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}

- uses: actions/setup-node@v3
with:
node-version: 16

- name: Cache Modules
id: cache-modules
uses: actions/cache@v2
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/deploy-subgraphs-staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}

- uses: actions/setup-node@v3
with:
node-version: 16

- name: Cache Modules
id: cache-modules
uses: actions/cache@v2
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/pull-request-checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ jobs:
with:
ref: ${{ github.event.pull_request.head.ref }}

- uses: actions/setup-node@v3
with:
node-version: 16

- name: Install dependencies
run: yarn

Expand Down
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

*.pyc
*.xml
*.iml


# dependencies
node_modules
.pnp
Expand Down Expand Up @@ -47,3 +52,6 @@ generated
tsconfig.tsbuildinfo
dist
cdktf.out

# python
log.txt
2 changes: 1 addition & 1 deletion .nvmrc
Original file line number Diff line number Diff line change
@@ -1 +1 @@
16.6
16.14
8 changes: 2 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Optional:

## Getting started

1. Run `yarn` in this repository to install all dependencies.
1. Run `yarn` in this repository to install all dependencies.
2. Run `yarn dev` to start the application and development server at localhost:3000

This runs the application located at packages/diva-app.
Expand All @@ -28,8 +28,4 @@ To work on the app go there and make the changes you want.
- `yarn format` Runs prettier on all packages
- `yarn build` Builds packages for development

## Troubleshooting

### Missing abis

If typescript or the subgraphs don't compile because they're missing abis from the @diva/contracts package, go to packages/diva-contract and run `yarn build`.
## Troubleshooting
1 change: 1 addition & 0 deletions packages/diva-app/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
REACT_APP_INFURA_KEY=
6 changes: 6 additions & 0 deletions packages/diva-app/config-overrides.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@ module.exports = function override(config, env) {
Buffer: ['buffer', 'Buffer'],
}),
])
config.module.rules.push({
test: /\.m?js/,
resolve: {
fullySpecified: false,
},
})
return config
}
20 changes: 12 additions & 8 deletions packages/diva-app/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
"version": "0.1.0",
"private": true,
"dependencies": {
"@0x/contract-addresses": "^6.8.0",
"@0x/contract-addresses": "^6.20.1",
"@0x/contract-wrappers": "^13.18.1",
"@0x/protocol-utils": "^1.9.3",
"@0x/subproviders": "6.5.4",
"@diva/contracts": "*",
"@emotion/react": "^11.5.0",
"@emotion/styled": "^11.3.0",
"@ethersproject/providers": "^5.6.4",
Expand All @@ -27,21 +26,24 @@
"@testing-library/user-event": "^12.8.3",
"@types/jest": "^27.0.2",
"@types/node": "^16.11.7",
"@types/react": "^17.0.34",
"@types/react": "^18.2.14",
"@types/react-dom": "^17.0.11",
"@types/react-vis": "^1.11.10",
"axios": "^0.21.4",
"@walletconnect/client": "^1.8.0",
"@walletconnect/qrcode-modal": "^1.8.0",
"@walletconnect/web3-provider": "^1.8.0",
"axios": "^1.1.3",
"coingecko-api": "^1.0.10",
"core-js": "^3.22.1",
"d3": "^7.0.1",
"date-fns": "^2.25.0",
"ethers": "^5.5.1",
"formik": "^2.2.9",
"formik": "^2.4.2",
"graphql": "^16.1.0",
"graphql-tag": "^2.12.6",
"react": "^17.0.2",
"react": "^18.2.0",
"react-app-polyfill": "^3.0.0",
"react-dom": "^17.0.2",
"react-dom": "^18.2.0",
"react-query": "^3.34.2",
"react-redux": "^7.2.4",
"react-router-dom": "^5.3.0",
Expand All @@ -51,13 +53,14 @@
"use-local-storage": "^2.3.6",
"web-vitals": "^1.1.2",
"web3": "^1.6.0",
"websocket": "^1.0.34",
"ws": "^8.2.2"
},
"scripts": {
"deploy": "",
"dev": "react-app-rewired start",
"start": "CHOKIDAR_USEPOLLING=true react-scripts start",
"build": "react-app-rewired build",
"build": "react-app-rewired --max_old_space_size=8192 build",
"test": "start-server-and-test 'yarn dev' http-get://localhost:3000 'synpress run --configFile synpress.json'",
"lint": "eslint src --ext .ts,.tsx,.js,.jsx && tsc --noEmit",
"fmt": "prettier . -w"
Expand All @@ -84,6 +87,7 @@
"@types/coingecko-api": "^1.0.10",
"@types/react-router-dom": "^5.3.2",
"@types/styled-components": "^5.1.15",
"@types/websocket": "^1.0.5",
"@typescript-eslint/eslint-plugin": "^5.3.1",
"@typescript-eslint/parser": "^5.3.1",
"assert": "^2.0.0",
Expand Down
91 changes: 36 additions & 55 deletions packages/diva-app/src/App.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Header from './component/Header/Header'
import Underlying from './component/Trade/Underlying'

import {
BrowserRouter as Router,
Switch,
Expand All @@ -9,68 +7,51 @@ import {
} from 'react-router-dom'
import { CreatePool } from './component/CreatePool/CreatePool'
import Markets from './component/Markets/Markets'
import MenuItems from './component/Header/MenuItems'
import { useAppSelector } from './Redux/hooks'
import { LoadingBox } from './component/LoadingBox'
import Container from '@mui/material/Container'
import Divider from '@mui/material/Divider'
import Stack from '@mui/material/Stack'
import { config, divaGovernanceAddress } from './constants'

import { config, DEFAULT_MARKETS_CREATED_BY } from './constants'
import { WrongChain } from './component/Wallet/WrongChain'
import { Tasks } from './component/Tasks/Tasks'
import Dashboard from './component/Dashboard/Dashboard'
import { useCustomMediaQuery } from './hooks/useCustomMediaQuery'
import { Offer } from './component/CreatePool/Offer'
import Layout from './component/Layout'

export const App = () => {
const chainId = useAppSelector((state) => state.appSlice.chainId)
const { isMobile } = useCustomMediaQuery()

return (
<Router>
<Stack height="100%" direction="row" justifyContent="space-between">
{!isMobile && (
<>
<MenuItems />
<Divider orientation="vertical" />
</>
)}

<Container
disableGutters
sx={{ alignItems: 'left', height: '100%', overflow: 'auto' }}
maxWidth={false}
>
<Header />
{chainId == null ? (
<LoadingBox />
) : config[chainId]?.isSupported ? (
<Switch>
<Route exact path="/tasks">
<Layout>
{chainId == null ? (
<LoadingBox />
) : config[chainId]?.isSupported ? (
<Switch>
{/* <Route exact path="/tasks">
<Tasks />
</Route>
<Route
exact
path="/dashboard/:page?"
render={(props) => <Dashboard {...props} />}
/>
<Route path="/markets/:creatorAddress?">
<Markets />
</Route>
<Route path="/:poolId/:tokenType">
<Underlying />
</Route>
<Route path="/create">
<CreatePool />
</Route>
<Route path="/">
<Redirect from="/" to={`/markets/${divaGovernanceAddress}`} />
</Route>
</Switch>
) : (
<WrongChain />
)}
</Container>
</Stack>
</Router>
</Route> */}
<Route
exact
path="/dashboard/:page?"
render={(props) => <Dashboard {...props} />}
/>
<Route path="/markets/:creatorAddress?">
<Markets />
</Route>
<Route path="/offer/:chain/:hash">
<Offer />
</Route>
<Route path="/:poolId/:tokenType">
<Underlying />
</Route>
<Route path="/create">
<CreatePool />
</Route>
<Route path="/">
<Redirect from="/" to={`/markets/${DEFAULT_MARKETS_CREATED_BY}`} />
</Route>
</Switch>
) : (
<WrongChain />
)}
</Layout>
)
}
Loading

0 comments on commit b99ab23

Please sign in to comment.