Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
39 commits
Select commit Hold shift + click to select a range
bb12aa3
added packages
njokuScript Apr 3, 2021
4501721
add react typescript
njokuScript Apr 3, 2021
3b46315
setup gulp to watch for css changes
njokuScript Apr 3, 2021
b11d0e6
update css
njokuScript Apr 3, 2021
bfebfb3
implement routes
njokuScript Apr 3, 2021
2a50b7b
implement theming functionality
njokuScript Apr 3, 2021
d9963af
implement theming functionality
njokuScript Apr 3, 2021
a7c6b7c
working on navbar component
njokuScript Apr 3, 2021
579e469
update theming functioinality and navbar
njokuScript Apr 4, 2021
8af7bdb
refactor stylings
njokuScript Apr 4, 2021
d375955
still on refactoring styles and theme..
njokuScript Apr 4, 2021
1d6fe15
implement token modal
njokuScript Apr 5, 2021
7d850d2
still on refactoring ui..
njokuScript Apr 5, 2021
90e0137
add logo to token modal
njokuScript Apr 5, 2021
f0688b2
implementing wallet connection modal
njokuScript Apr 5, 2021
9415523
implementing connect modal
njokuScript Apr 6, 2021
535833c
added address utilities
njokuScript Apr 6, 2021
448a974
add redux thunk and implement redux store
njokuScript Apr 6, 2021
44c5487
refactor connection modal design
njokuScript Apr 6, 2021
b888ce3
still on modal design..
njokuScript Apr 6, 2021
c3adde0
remove package.lock.json
njokuScript Apr 6, 2021
e297036
implement web3 connection
njokuScript Apr 6, 2021
942de7d
abstract contract initialization
njokuScript Apr 6, 2021
655fa07
token swap ui..
njokuScript Apr 6, 2021
1e89706
implement wallet connection reducer
njokuScript Apr 6, 2021
5e667d3
implement wallet connection
njokuScript Apr 6, 2021
abd956c
implement big number converter util
njokuScript Apr 6, 2021
5d92073
implement create pool actions
njokuScript Apr 6, 2021
45d0cee
implementing create pool functionality
njokuScript Apr 7, 2021
ecc100e
add build to client project.. get netId from abi
njokuScript Apr 8, 2021
e476ac4
implement creation of pool functionality
njokuScript Apr 8, 2021
658359f
get pool details from past events
njokuScript Apr 8, 2021
b8cfe94
implement pool reducer
njokuScript Apr 8, 2021
e7aaa50
implement pool reducer and get exchange rate
njokuScript Apr 8, 2021
f5b1a15
add token balances to reducer
njokuScript Apr 8, 2021
43e73d0
fix address bug
njokuScript Apr 9, 2021
b882608
implment contract call for swappiing tokens
njokuScript Apr 9, 2021
01a437f
implement buying functionality
njokuScript Apr 9, 2021
896de8e
update readme
njokuScript Apr 9, 2021
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
Binary file added .DS_Store
Binary file not shown.
24 changes: 24 additions & 0 deletions client/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +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
build

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

npm-debug.log*
yarn-debug.log*
yarn-error.log*
57 changes: 57 additions & 0 deletions client/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@

### Styles
All .css files are concatenated and minified to one file **src/style.min.css**
The style.min.css file is not edited directly.

###### To add styles to components:
- Create or edit .css files in **public/styles/**
- Then from the root directory of this project run `gulp` on the command line to add the styles to the **style.min.css**

Also, running `gulp` watches for any changes to the **public/styles/** directory. You can check out the **gulpfile.js** for the settings.

# Getting Started with Create React App

This project was bootstrapped with [Create React App](https://github.com/facebook/create-react-app).

## Available Scripts

In the project directory, you can run:

### `yarn start`

Runs the app in the development mode.\
Open [http://localhost:3000](http://localhost:3000) to view it in the browser.

The page will reload if you make edits.\
You will also see any lint errors in the console.

### `yarn test`

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.

### `yarn 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.

### `yarn 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/).
21 changes: 21 additions & 0 deletions client/gulpfile.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
const { watch, src, dest } = require('gulp');
const ugly = require('gulp-uglifycss');
const concat = require('gulp-concat');


function minifyCss(done) {
src('public/styles/*.css')
.pipe(concat('style.min.css'))
.pipe(ugly())
.pipe(dest('src'))

done()
}

exports.default = function (done) {

watch('public/styles/*.css', { ignoreInitial: false }, minifyCss)

done()

}
63 changes: 63 additions & 0 deletions client/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
{
"name": "client",
"version": "0.1.0",
"private": true,
"dependencies": {
"@ant-design/icons": "^4.6.2",
"@testing-library/jest-dom": "^5.11.4",
"@testing-library/react": "^11.1.0",
"@testing-library/user-event": "^12.1.10",
"@types/cleave.js": "^1.4.4",
"@types/jest": "^26.0.15",
"@types/node": "^12.0.0",
"@types/react": "^17.0.0",
"@types/react-dom": "^17.0.0",
"@types/react-redux": "^7.1.16",
"@types/react-router-dom": "^5.1.7",
"@types/redux": "^3.6.0",
"cleave.js": "^1.6.0",
"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-redux": "^7.2.3",
"react-router-dom": "^5.2.0",
"react-scripts": "4.0.3",
"redux": "^4.0.5",
"redux-devtools-extension": "^2.13.9",
"redux-thunk": "^2.3.0",
"sweetalert2": "^10.15.7",
"typescript": "^4.1.2",
"web-vitals": "^1.0.1",
"web3": "^1.3.4",
"web3modal": "^1.9.3"
},
"scripts": {
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test",
"eject": "react-scripts eject"
},
"eslintConfig": {
"extends": [
"react-app",
"react-app/jest"
]
},
"browserslist": {
"production": [
">0.2%",
"not dead",
"not op_mini all"
],
"development": [
"last 1 chrome version",
"last 1 firefox version",
"last 1 safari version"
]
},
"devDependencies": {
"file-loader": "^6.1.1",
"gulp": "^4.0.2",
"gulp-concat": "^2.6.1",
"gulp-uglifycss": "^1.1.0"
}
}
Binary file added client/public/favicon.ico
Binary file not shown.
44 changes: 44 additions & 0 deletions client/public/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/logo.png" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<meta
name="description"
content="Web site created using create-react-app"
/>
<link rel="apple-touch-icon" href="%PUBLIC_URL%/logo.png" />
<link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet">
<!--
manifest.json provides metadata used when your web app is installed on a
user's mobile device or desktop. See https://developers.google.com/web/fundamentals/web-app-manifest/
-->
<link rel="manifest" href="%PUBLIC_URL%/manifest.json" />
<!--
Notice the use of %PUBLIC_URL% in the tags above.
It will be replaced with the URL of the `public` folder during the build.
Only files inside the `public` folder can be referenced from the HTML.

Unlike "/favicon.ico" or "favicon.ico", "%PUBLIC_URL%/favicon.ico" will
work correctly both with client-side routing and a non-root public URL.
Learn how to configure a non-root public URL by running `npm run build`.
-->
<title>Z Swap</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
<!--
This HTML file is a template.
If you open it directly in the browser, you will see an empty page.

You can add webfonts, meta tags, or analytics to this file.
The build step will place the bundled scripts into the <body> tag.

To begin the development, run `npm start` or `yarn start`.
To create a production bundle, use `npm run build` or `yarn build`.
-->
</body>
</html>
Binary file added client/public/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/logo192.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added client/public/logo512.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
25 changes: 25 additions & 0 deletions client/public/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"short_name": "Z Swap",
"name": "Swap Tokens",
"icons": [
{
"src": "favicon.ico",
"sizes": "64x64 32x32 24x24 16x16",
"type": "image/x-icon"
},
{
"src": "logo.png",
"type": "image/png",
"sizes": "192x192"
},
{
"src": "logo.png",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": ".",
"display": "standalone",
"theme_color": "#000000",
"background_color": "#ffffff"
}
3 changes: 3 additions & 0 deletions client/public/robots.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# https://www.robotstxt.org/robotstxt.html
User-agent: *
Disallow:
82 changes: 82 additions & 0 deletions client/public/styles/Modal.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@


.modal-styles {
display: none;
width: 100%;
max-width: 600;
height: 100%;
top:0;
left:0;
position:fixed;
z-index: 10;
}


.modal-styles.open {
display: block;
}


.modal-body {
width:100%;
height: 100%;
opacity: 0;
overflow: auto;
background-color: rgba(0,0,0,0.7);
transition: all 500ms ease-in-out;
}



.modal-body.show {
opacity:1;
}

.modal-body.show {
opacity: 1;
}

.modal-body > div {
display: flex;
justify-content: center;
padding-top: 20vh;
}

.modal-content {
position: relative;
background: var(--appBackground);
border-radius: 5px;
box-shadow: 0 10px 20px #0000002f;
padding:30px;
width:100%;
min-height: 100vh;
bottom: -100vh;
transition: all 500ms ease-in-out;
}

.modal-content.open {
bottom: 0;
}

.modal-content .modal-title {
font-size: 18px;
}

.close-modal {
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
}

@media (min-width:768px){
.modal-body > div {
align-items: center;
}

.modal-content {
max-width: 30%;
min-height: 300px;
bottom: -10vh;
}
}
Loading