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

Uniswap widget #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions SchnoodleDApp/ClientApp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"private": true,
"dependencies": {
"@craco/craco": "^6.4.3",
"@uniswap/widgets": "^1.1.1",
"big-integer": "^1.6.51",
"bootstrap": "^5.1.3",
"chroma-js": "^2.4.2",
Expand All @@ -27,6 +28,7 @@
"react-globe.gl": "^2.22.0",
"react-loader-spinner": "^5.1.4",
"react-plotly.js": "^2.5.1",
"react-redux": "^7.2.8",
"react-responsive-modal": "^6.2.0",
"react-router-bootstrap": "^0.25.0",
"react-router-dom": "^5.3.1",
Expand Down
26 changes: 26 additions & 0 deletions SchnoodleDApp/ClientApp/src/components/Home.jsx
Original file line number Diff line number Diff line change
@@ -1,10 +1,27 @@
import React, { Component } from 'react';
import { general, farming } from '../resources';
import { SwapWidget } from '@uniswap/widgets';

export class Home extends Component {
static displayName = Home.name;

render () {

const uniswapTokenList = 'https://tokens.coingecko.com/uniswap/all.json';
const SNOOD = '0xd45740ab9ec920bedbd9bab2e863519e59731941';
const theme = {
primary: '#ffffff',
secondary: '#ffffff',
interactive: '#AD73B1',
container: '#702DDC',
module: '#20134E',
accent: '#9999CC',
outline: '#CC1',
dialog: '#140A2E',
fontFamily: 'Josefin Sans',
borderRadius: 1
}

return (
<div className="tw-overflow-hidden tw-antialiased tw-font-roboto tw-mx-4">
<div className="h-noheader md:tw-flex">
Expand All @@ -17,6 +34,15 @@ export class Home extends Component {
<a href="/farming">
<button className="tw-px-4 tw-py-2 tw-mt-4 tw-text-lg tw-text-accent tw-border-accent tw-duration-200 tw-transform tw-border tw-rounded-lg hover:tw-bg-purple-100 focus:tw-outline-none">{farming.START_FARMING}</button>
</a>
<div className="tw-flex tw-justify-center tw-m-10 ">
<SwapWidget
provider={window.web3.currentProvider}
jsonRpcEndpoint={process.env.REACT_APP_ETH_URL}
tokenList={uniswapTokenList}
theme={theme}
defaultInputTokenAddress={SNOOD}
/>
</div>
</div>
</div>
</div>
Expand Down