Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Develop Merge - Fully working build #1

Open
wants to merge 92 commits into
base: staging
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
92 commits
Select commit Hold shift + click to select a range
62fb044
Card component
Luigy-Lemon Sep 28, 2023
a915544
pushing current tate - mutations not connected
Luigy-Lemon Sep 29, 2023
43edf34
style: fix header padding on mobile
filoozom Sep 29, 2023
6fa7ea8
chore: avoid incorrect render at start
filoozom Sep 29, 2023
2c12ae5
wip: refactor
filoozom Sep 29, 2023
47f8242
chore: clean method / action
filoozom Sep 29, 2023
591617e
chore: simplify and optimize
filoozom Sep 29, 2023
4bb5cba
chore: remove refs
filoozom Sep 29, 2023
a62b298
fix: receiver address
filoozom Sep 29, 2023
b8639f2
chore: simplify tab logic
filoozom Sep 29, 2023
fb77a94
chore: unused import
filoozom Sep 29, 2023
dcb0fc9
feat: CSS reworks, defaulting to use withdraw instead of redeem, all …
Luigy-Lemon Sep 30, 2023
1c40a15
Merge remote-tracking branch 'gnosis/develop' into my-staging
Luigy-Lemon Sep 30, 2023
aceb0ed
style: new logo
Luigy-Lemon Sep 30, 2023
f2db873
refactor: simplify share calculation
filoozom Sep 30, 2023
5a87c62
feat: update balances after a mutation
filoozom Sep 30, 2023
38a04cb
fix: form input
filoozom Sep 30, 2023
171f338
chore: remove currentChain logic
filoozom Sep 30, 2023
76b83bd
chore: cleanup
filoozom Sep 30, 2023
32abccc
ci: deploy build folder instead of public
filoozom Sep 30, 2023
f945bd9
feat: small decimals for xDAI amount
filoozom Sep 30, 2023
93efc4e
fix: logo and text
filoozom Sep 30, 2023
595aff2
feat: add pointer cursor to currency selector
filoozom Sep 30, 2023
ab12fed
chore: replace xDAI logo
filoozom Sep 30, 2023
bf89c7c
fix: always do sDAI approval
filoozom Sep 30, 2023
a93d3dc
chore: new chiado contracts
Sep 30, 2023
2c43ed2
chore: remove useless condition
filoozom Sep 30, 2023
d1d9fa5
fix: refetch everything
filoozom Sep 30, 2023
944089c
style: adjust favicon and some strings
Sep 30, 2023
cff5576
Update CI/CD workflow
gMonty030 Oct 2, 2023
2c0dfb8
Merge branch 'staging' into develop
gMonty030 Oct 2, 2023
bd4b05d
chore: replace CRA with Vite
filoozom Oct 2, 2023
7ffff50
ci: use pnpm
filoozom Oct 2, 2023
e46dec9
chore: new Chiado deployment
filoozom Oct 2, 2023
ccf7e1d
wip: new form design
filoozom Oct 2, 2023
6d15fe3
wip: global store and cleanup
filoozom Oct 2, 2023
3b2efc6
wip: use global store for form
filoozom Oct 2, 2023
0c0ad66
wip: feature parity with old form
filoozom Oct 2, 2023
d74be21
chore: negative bigint error
filoozom Oct 2, 2023
3cbfbf8
chore: update wxdai logo
filoozom Oct 2, 2023
6cc074f
fix: negative bigint
filoozom Oct 2, 2023
b68cb68
feat: implement max redeem
filoozom Oct 2, 2023
869df78
chore: remove logs
filoozom Oct 2, 2023
2b46ac9
fix: token input amount
filoozom Oct 2, 2023
4ae993f
feat: info containers, footer, lots of UI work. TODO: wallet connecti…
Luigy-Lemon Oct 3, 2023
941a07b
style: small adjustments to the footer paragraph and margins
Oct 3, 2023
183b856
transaction overview done
Oct 3, 2023
3a051c2
style: improving screen in which wallet is not connected
Oct 3, 2023
e243976
feat: mobile ready
Luigy-Lemon Oct 3, 2023
e3e99ca
fix: approving sDAI balance when withdrawing
Luigy-Lemon Oct 3, 2023
8fa9041
fixing withdrawal flow and switching to unlimited approvals
Luigy-Lemon Oct 3, 2023
e02ad4e
fix: Exchange rate inconsistency and addTokenToWallet now adds Chiado…
Luigy-Lemon Oct 3, 2023
b5f5f4d
style: max width for the main container and better tablet support
Luigy-Lemon Oct 3, 2023
eae6e9a
handling more than one chain
Luigy-Lemon Oct 4, 2023
4a4ecd3
fix: account requiring hooks in Home page
filoozom Oct 4, 2023
a0e5e94
fix: linting
filoozom Oct 4, 2023
e870b72
refactor: simplify useLoadedAccountStore usage
filoozom Oct 4, 2023
d11939b
refactor: simplify
filoozom Oct 4, 2023
bab2c1e
perf: configure batching
filoozom Oct 4, 2023
8e00999
chore: remove unused maxWithdrawBalance
filoozom Oct 4, 2023
29393ea
fixing TransactionOverview and Cards
Luigy-Lemon Oct 4, 2023
136efd1
fix: unwatch on unmount
filoozom Oct 4, 2023
3f809dc
feat: created Main component to segregate from Home
Luigy-Lemon Oct 4, 2023
abd3edc
feat: Gnosis Chain support
Luigy-Lemon Oct 4, 2023
4005c4a
feat: fetch singleton
filoozom Oct 4, 2023
97d27b6
fix: exhaustive useAccountShareValue dependencies
filoozom Oct 4, 2023
a4981b4
fix: chain login race condition
filoozom Oct 4, 2023
f86b90e
feat: setting adapter as vault so that interface works in case adapte…
Luigy-Lemon Oct 4, 2023
4547811
style: footer text updated
Luigy-Lemon Oct 4, 2023
2ba24e9
chore: remove VaultAdapter where is isn't used
Luigy-Lemon Oct 4, 2023
c52174a
Merge pull request #9 from gnosis/Luigy-Lemon/issue4
Luigy-Lemon Oct 4, 2023
a70feb7
fix: better handling fetch loading state and using temporary adapter …
Oct 5, 2023
d719151
fix: sDAI token address on Gnosis Chain
filoozom Oct 5, 2023
6a403d0
style: fix breaking points between mobile and tablet mode (#10)
Luigy-Lemon Oct 16, 2023
1c1045f
refactor: chain data store (#11)
filoozom Oct 17, 2023
adf35d0
refactor: add vault store
filoozom Oct 18, 2023
37ec754
feat: update vault variables on events
filoozom Oct 18, 2023
2c5be55
perf: calculate vault APY locally
filoozom Oct 18, 2023
8e143be
style: formatting
filoozom Oct 18, 2023
25c86a4
feat: show layout when disconnected
filoozom Oct 18, 2023
97ed813
style: updated style to the latest figma and adjusted links to docs
Luigy-Lemon Nov 23, 2023
4713999
style: removing template footer for push
Luigy-Lemon Nov 23, 2023
53ee0f2
feat: add basic structure of footer without responsive design
Lia-4c6961 Nov 29, 2023
404a61b
feat: add responsive design on footer
Lia-4c6961 Nov 30, 2023
84f678c
fix: update wagmi to 1.4.12 to address security vulnerability
Lia-4c6961 Dec 15, 2023
d9dfc5b
Revert "fix: update wagmi to 1.4.12 to address security vulnerability"
Lia-4c6961 Dec 15, 2023
3454bc2
feat: add denylist check and disable interactions for denied users
Lia-4c6961 Dec 16, 2023
7f3580d
Merge branch 'develop' into style-update
Luigy-Lemon Dec 19, 2023
3de0c24
Merge pull request #12 from gnosis/style-update
Luigy-Lemon Dec 19, 2023
0351805
add block page
Luigy-Lemon Dec 19, 2023
a1202a4
Merge pull request #13 from gnosis/403-page
Luigy-Lemon Dec 19, 2023
88b4dc5
Move public/block.html to public/block/index.html to make it work eas…
Dec 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
31 changes: 17 additions & 14 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,25 +27,29 @@ jobs:

- uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
path: "**/node_modules"
key: ${{ runner.os }}-modules-${{ hashFiles('**/pnpm-lock.yaml') }}

- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18.17.1

- uses: pnpm/action-setup@v2
with:
version: 7

- name: Install
run: |
yarn install
pnpm install
pip install awscli --upgrade --user

- name: Build Release App
if: ( github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/develop' || github.ref == 'refs/heads/main' )
run: yarn run build
env:
run: pnpm run build
env:
CI: false # Set to True if no eslint errors

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
if: ( github.ref == 'refs/heads/staging' || github.ref == 'refs/heads/develop')
Expand All @@ -54,17 +58,16 @@ jobs:
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_DEFAULT_REGION }}


# Script to deploy to dev environment
- name: 'Deploy to S3: development'
- name: "Deploy to S3: development"
if: ( github.ref == 'refs/heads/develop' )
run: |
aws s3 sync build/ s3://${{ secrets.STAGING_BUCKET_NAME }}/development/ --delete --exclude "*.html" --cache-control max-age=86400,build
aws s3 sync build/ s3://${{ secrets.STAGING_BUCKET_NAME }}/development/ --delete --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html
aws s3 sync dist/ s3://${{ secrets.STAGING_BUCKET_NAME }}/development/ --delete --exclude "*.html" --cache-control max-age=86400,build
aws s3 sync dist/ s3://${{ secrets.STAGING_BUCKET_NAME }}/development/ --delete --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html

# Script to deploy to staging environment
- name: 'Deploy to S3: staging'
- name: "Deploy to S3: staging"
if: ( github.ref == 'refs/heads/staging' )
run: |
aws s3 sync build/ s3://${{ secrets.STAGING_BUCKET_NAME }}/staging/ --delete --exclude "*.html" --cache-control max-age=86400,build
aws s3 sync build/ s3://${{ secrets.STAGING_BUCKET_NAME }}/staging/ --delete --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html
aws s3 sync dist/ s3://${{ secrets.STAGING_BUCKET_NAME }}/staging/ --delete --exclude "*.html" --cache-control max-age=86400,build
aws s3 sync dist/ s3://${{ secrets.STAGING_BUCKET_NAME }}/staging/ --delete --exclude "*" --include "*.html" --cache-control max-age=0,no-cache,no-store,must-revalidate --content-type text/html
41 changes: 21 additions & 20 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,23 +1,24 @@
# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.

# dependencies
/node_modules
/.pnp
.pnp.js

# testing
/coverage

# production
/build

# misc
.DS_Store
.env.local
.env.development.local
.env.test.local
.env.production.local

# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
57 changes: 19 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,46 +1,27 @@
# Getting Started with Create React App
# React + TypeScript + Vite

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).
This template provides a minimal setup to get React working in Vite with HMR and some ESLint rules.

## Available Scripts
Currently, two official plugins are available:

In the project directory, you can run:
- [@vitejs/plugin-react](https://github.com/vitejs/vite-plugin-react/blob/main/packages/plugin-react/README.md) uses [Babel](https://babeljs.io/) for Fast Refresh
- [@vitejs/plugin-react-swc](https://github.com/vitejs/vite-plugin-react-swc) uses [SWC](https://swc.rs/) for Fast Refresh

### `npm start`
## Expanding the ESLint configuration

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.
If you are developing a production application, we recommend updating the configuration to enable type aware lint rules:

The page will reload if you make edits.\
You will also see any lint errors in the console.
- Configure the top-level `parserOptions` property like this:

### `npm test`
```js
parserOptions: {
ecmaVersion: 'latest',
sourceType: 'module',
project: ['./tsconfig.json', './tsconfig.node.json'],
tsconfigRootDir: __dirname,
},
```

Launches the test runner in the interactive watch mode.\
See the section about [running tests](https://facebook.github.io/create-react-app/docs/running-tests) for more information.

### `npm run build`

Builds the app for production to the `build` folder.\
It correctly bundles React in production mode and optimizes the build for the best performance.

The build is minified and the filenames include the hashes.\
Your app is ready to be deployed!

See the section about [deployment](https://facebook.github.io/create-react-app/docs/deployment) for more information.

### `npm run eject`

**Note: this is a one-way operation. Once you `eject`, you can’t go back!**

If you aren’t satisfied with the build tool and configuration choices, you can `eject` at any time. This command will remove the single build dependency from your project.

Instead, it will copy all the configuration files and the transitive dependencies (webpack, Babel, ESLint, etc) right into your project so you have full control over them. All of the commands except `eject` will still work, but they will point to the copied scripts so you can tweak them. At this point you’re on your own.

You don’t have to ever use `eject`. The curated feature set is suitable for small and middle deployments, and you shouldn’t feel obligated to use this feature. However we understand that this tool wouldn’t be useful if you couldn’t customize it when you are ready for it.

## Learn More

You can learn more in the [Create React App documentation](https://facebook.github.io/create-react-app/docs/getting-started).

To learn React, check out the [React documentation](https://reactjs.org/).
- Replace `plugin:@typescript-eslint/recommended` to `plugin:@typescript-eslint/recommended-type-checked` or `plugin:@typescript-eslint/strict-type-checked`
- Optionally add `plugin:@typescript-eslint/stylistic-type-checked`
- Install [eslint-plugin-react](https://github.com/jsx-eslint/eslint-plugin-react) and add `plugin:react/recommended` & `plugin:react/jsx-runtime` to the `extends` list
24 changes: 0 additions & 24 deletions config-overrides.js

This file was deleted.

17 changes: 17 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" href="/Savings-xDAI.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="theme-color" content="#000000" />
<meta name="Gnosis Earn" content="Earn by Depositing xDAI" />
<link rel="apple-touch-icon" href="/sDAI.jpeg" />
<link rel="manifest" href="./manifest.json" />
<title>Gnosis Earn</title>
</head>
<body>
<div id="root"></div>
<script type="module" src="src/main.tsx"></script>
</body>
</html>
61 changes: 30 additions & 31 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,36 +1,42 @@
{
"name": "frontend",
"name": "sdai-frontend",
"version": "0.1.0",
"private": true,
"type": "module",
"scripts": {
"dev": "vite",
"build": "tsc && vite build",
"lint": "eslint . --ext ts,tsx --report-unused-disable-directives --max-warnings 0",
"preview": "vite preview"
},
"dependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"@ethersproject/providers": "^5.7.2",
"@metamask/providers": "^10.2.1",
"@testing-library/jest-dom": "^5.16.5",
"@testing-library/react": "^13.4.0",
"@testing-library/user-event": "^13.5.0",
"@types/jest": "^27.5.2",
"@types/node": "^16.18.10",
"@types/react": "^18.0.26",
"@types/react-dom": "^18.0.9",
"@metamask/providers": "^13.0.0",
"@web3modal/ethereum": "^2.7.1",
"@web3modal/react": "^2.7.1",
"ethers": "^5.7.2",
"ethers": "^6.7.1",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"react-scripts": "5.0.1",
"react-toastify": "^9.1.1",
"typescript": "^4.9.4",
"usehooks-ts": "^2.9.1",
"viem": "^1.12.2",
"wagmi": "^1.4.2",
"web-vitals": "^2.1.4"
"viem": "^1.14.0",
"wagmi": "^1.4.2"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
"devDependencies": {
"@types/react": "^18.2.24",
"@types/react-dom": "^18.2.8",
"@typescript-eslint/eslint-plugin": "^6.7.3",
"@typescript-eslint/parser": "^6.7.3",
"@vitejs/plugin-react": "^4.1.0",
"autoprefixer": "^10.4.16",
"clsx": "^2.0.0",
"eslint": "^8.50.0",
"eslint-plugin-react-refresh": "^0.4.3",
"postcss": "^8.4.31",
"react": "^18.2.0",
"react-dom": "^18.2.0",
"tailwindcss": "^3.3.3",
"typescript": "^5.2.2",
"vite": "^4.4.9",
"zustand": "^4.4.2"
},
"eslintConfig": {
"extends": [
Expand All @@ -49,12 +55,5 @@
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"@typescript-eslint/eslint-plugin": "^5.47.0",
"@typescript-eslint/parser": "^5.47.0",
"eslint": "^8.30.0",
"eslint-config-typescript": "^3.0.0",
"eslint-plugin-react": "^7.31.11"
}
}
}
Loading
Loading