Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
I
interface
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
LuckySwap
interface
Commits
b9665b3a
Commit
b9665b3a
authored
Oct 06, 2018
by
Chi Kei Chan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add Send screen and fixed react-router
parent
c5d911af
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
207 additions
and
63 deletions
+207
-63
address-input-panel.scss
src/components/AddressInputPanel/address-input-panel.scss
+19
-0
index.js
src/components/AddressInputPanel/index.js
+42
-0
index.js
src/components/Web3Status/index.js
+4
-0
index.js
src/index.js
+2
-4
App.js
src/pages/App.js
+63
-59
index.js
src/pages/Send/index.js
+71
-0
send.scss
src/pages/Send/send.scss
+6
-0
No files found.
src/components/AddressInputPanel/address-input-panel.scss
0 → 100644
View file @
b9665b3a
@import
'../../variables.scss'
;
.address-input-panel
{
@extend
%col-nowrap
;
&
__input
{
color
:
$mine-shaft-gray
;
font-size
:
.9rem
;
outline
:
none
;
border
:
none
;
flex
:
1
1
auto
;
width
:
0
;
color
:
$royal-blue
;
&
:
:
placeholder
{
color
:
$chalice-gray
;
}
}
}
src/components/AddressInputPanel/index.js
0 → 100644
View file @
b9665b3a
import
React
,
{
Component
}
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
PropTypes
from
'
prop-types
'
;
import
'
./address-input-panel.scss
'
;
class
AddressInputPanel
extends
Component
{
static
propTypes
=
{
title
:
PropTypes
.
string
,
description
:
PropTypes
.
string
,
extraText
:
PropTypes
.
string
,
};
render
()
{
const
{
title
,
description
,
extraText
,
}
=
this
.
props
;
return
(
<
div
className
=
"
currency-input-panel
"
>
<
div
className
=
"
currency-input-panel__container
"
>
<
div
className
=
"
currency-input-panel__label-row
"
>
<
div
className
=
"
currency-input-panel__label-container
"
>
<
span
className
=
"
currency-input-panel__label
"
>
Recipient
Address
<
/span
>
<
/div
>
<
/div
>
<
div
className
=
"
currency-input-panel__input-row
"
>
<
input
type
=
"
text
"
className
=
"
address-input-panel__input
"
placeholder
=
"
0x1234...
"
/>
<
/div
>
<
/div
>
<
/div
>
)
}
}
export
default
connect
()(
AddressInputPanel
);
src/components/Web3Status/index.js
View file @
b9665b3a
...
...
@@ -18,6 +18,10 @@ function Web3Status(props) {
<
div
className
=
"
web3-status__identicon
"
ref
=
{
el
=>
{
if
(
!
el
)
{
return
;
}
if
(
!
address
||
address
.
length
<
42
||
!
Web3
.
utils
.
isHexStrict
(
address
))
{
return
;
}
...
...
src/index.js
View file @
b9665b3a
import
React
from
'
react
'
;
import
ReactDOM
from
'
react-dom
'
;
import
{
BrowserRouter
}
from
'
react-router-dom
'
//
import { BrowserRouter } from 'react-router-dom'
import
App
from
'
./pages/App
'
;
import
{
Provider
}
from
'
react-redux
'
;
...
...
@@ -12,11 +12,9 @@ import registerServiceWorker from './registerServiceWorker';
// provider is going to need a store object passed into it
ReactDOM
.
render
(
<
Provider
store
=
{
store
}
>
<
BrowserRouter
>
<
App
metamask
=
{
window
.
web3
}
/
>
<
/BrowserRouter
>
<
/Provider
>
,
document
.
getElementById
(
'
root
'
)
,
document
.
getElementById
(
'
root
'
)
);
registerServiceWorker
();
src/pages/App.js
View file @
b9665b3a
import
React
,
{
Component
}
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
Switch
,
Route
}
from
'
react-router-dom
'
;
import
UniHead
from
'
../components/UniHead
'
import
Header
from
'
../components/Header
'
;
import
ConnectionHelper
from
'
../components/ConnectionHelper
'
import
Exchange
from
'
../components/Exchange
'
;
import
RateAndFee
from
'
../components/RateAndFee
'
;
import
Purchase
from
'
../components/Purchase
'
;
import
About
from
'
../components/About
'
;
import
Links
from
'
../components/Links
'
;
import
SharePurchase
from
'
../components/SharePurchase
'
;
import
{
BrowserRouter
,
Switch
,
Route
}
from
'
react-router-dom
'
;
//
import UniHead from '../components/UniHead'
//
import Header from '../components/Header';
//
import ConnectionHelper from '../components/ConnectionHelper'
//
import Exchange from '../components/Exchange';
//
import RateAndFee from '../components/RateAndFee';
//
import Purchase from '../components/Purchase';
//
import About from '../components/About';
//
import Links from '../components/Links';
//
import SharePurchase from '../components/SharePurchase';
import
Swap
from
'
./Swap
'
;
import
Send
from
'
./Send
'
;
import
'
./App.scss
'
;
class
App
extends
Component
{
renderMain
()
{
return
(
<
div
className
=
"
app
"
>
<
UniHead
/>
<
Header
metamask
=
{
this
.
props
.
metamask
}
/
>
<
ConnectionHelper
metamask
=
{
this
.
props
.
metamask
}
approveAllowance
=
{
this
.
approveAllowance
}
toggleAbout
=
{
this
.
toggleAbout
}
/
>
<
Exchange
getAccountInfo
=
{
this
.
getAccountInfo
}
getMarketInfo
=
{
this
.
getMarketInfo
}
symbolToTokenContract
=
{
this
.
symbolToTokenContract
}
symbolToExchangeAddress
=
{
this
.
symbolToExchangeAddress
}
/
>
<
RateAndFee
exchangeRate
=
{
this
.
props
.
exchange
.
rate
}
outputTokenValue
=
{
this
.
props
.
exchange
.
outputToken
.
value
}
inputTokenValue
=
{
this
.
props
.
exchange
.
inputToken
.
value
}
exchangeFee
=
{
this
.
props
.
exchange
.
fee
}
/
>
<
Purchase
symbolToExchangeContract
=
{
this
.
symbolToExchangeContract
}
symbolToTokenAddress
=
{
this
.
symbolToTokenAddress
}
/
>
{
/* <Visualization /> */
}
<
Links
toggleInvest
=
{
this
.
toggleInvest
}
location
=
{
this
}
symbolToTokenContract
=
{
this
.
symbolToTokenContract
}
symbolToExchangeContract
=
{
this
.
symbolToExchangeContract
}
symbolToExchangeAddress
=
{
this
.
symbolToExchangeAddress
}
/
>
<
SharePurchase
symbolToTokenContract
=
{
this
.
symbolToTokenContract
}
symbolToExchangeContract
=
{
this
.
symbolToExchangeContract
}
symbolToTokenAddress
=
{
this
.
symbolToTokenAddress
}
symbolToExchangeAddress
=
{
this
.
symbolToExchangeAddress
}
/
>
<
About
toggleAbout
=
{
this
.
toggleAbout
}
location
=
{
this
}
/
>
<
/div
>
)
}
//
renderMain() {
//
return (
//
<div className="app">
//
<UniHead />
//
<Header metamask={this.props.metamask}/>
//
<ConnectionHelper
//
metamask={this.props.metamask}
//
approveAllowance={this.approveAllowance}
//
toggleAbout={this.toggleAbout}
//
/>
//
<Exchange
//
getAccountInfo={this.getAccountInfo}
//
getMarketInfo={this.getMarketInfo}
//
symbolToTokenContract={this.symbolToTokenContract}
//
symbolToExchangeAddress={this.symbolToExchangeAddress}
//
/>
//
<RateAndFee
//
exchangeRate={this.props.exchange.rate}
//
outputTokenValue={this.props.exchange.outputToken.value}
//
inputTokenValue={this.props.exchange.inputToken.value}
//
exchangeFee={this.props.exchange.fee}
//
/>
//
<Purchase
//
symbolToExchangeContract={this.symbolToExchangeContract}
//
symbolToTokenAddress={this.symbolToTokenAddress}
//
/>
//
{/* <Visualization /> */}
//
<Links
//
toggleInvest={this.toggleInvest}
//
location={this}
//
symbolToTokenContract={this.symbolToTokenContract}
//
symbolToExchangeContract={this.symbolToExchangeContract}
//
symbolToExchangeAddress={this.symbolToExchangeAddress}
//
/>
//
<SharePurchase
//
symbolToTokenContract={this.symbolToTokenContract}
//
symbolToExchangeContract={this.symbolToExchangeContract}
//
symbolToTokenAddress={this.symbolToTokenAddress}
//
symbolToExchangeAddress={this.symbolToExchangeAddress}
//
/>
//
<About toggleAbout={this.toggleAbout} location={this}/>
//
</div>
//
)
//
}
render
()
{
return
(
<
BrowserRouter
>
<
Switch
>
<
Route
exact
path
=
"
/swap
"
component
=
{
Swap
}
/
>
<
Route
exact
path
=
"
/send
"
component
=
{
Swap
}
/
>
<
Route
exact
path
=
"
/send
"
component
=
{
Send
}
/
>
<
Route
exact
path
=
"
/pool
"
component
=
{
Swap
}
/
>
<
/Switch
>
<
/BrowserRouter
>
)
}
}
...
...
src/pages/Send/index.js
0 → 100644
View file @
b9665b3a
import
React
,
{
Component
}
from
'
react
'
;
import
{
connect
}
from
'
react-redux
'
;
import
{
withRouter
}
from
'
react-router-dom
'
;
import
PropTypes
from
'
prop-types
'
;
import
Header
from
'
../../components/Header
'
;
import
NavigationTabs
from
'
../../components/NavigationTabs
'
;
import
CurrencyInputPanel
from
'
../../components/CurrencyInputPanel
'
;
import
AddressInputPanel
from
'
../../components/AddressInputPanel
'
;
import
OversizedPanel
from
'
../../components/OversizedPanel
'
;
import
ArrowDown
from
'
../../assets/images/arrow-down-blue.svg
'
;
import
"
./send.scss
"
;
class
Send
extends
Component
{
static
propTypes
=
{
// Injected by React Router Dom
push
:
PropTypes
.
func
.
isRequired
,
pathname
:
PropTypes
.
string
.
isRequired
,
};
render
()
{
return
(
<
div
className
=
"
send
"
>
<
Header
/>
<
NavigationTabs
className
=
"
swap__navigation
"
/>
<
div
className
=
"
swap__content
"
>
<
CurrencyInputPanel
title
=
"
Input
"
extraText
=
"
Balance: 0.03141
"
/>
<
OversizedPanel
>
<
div
className
=
"
swap__down-arrow-background
"
>
<
img
className
=
"
swap__down-arrow
"
src
=
{
ArrowDown
}
/
>
<
/div
>
<
/OversizedPanel
>
<
CurrencyInputPanel
title
=
"
Output
"
description
=
"
(estimated)
"
extraText
=
"
Balance: 0.0
"
/>
<
OversizedPanel
>
<
div
className
=
"
swap__down-arrow-background
"
>
<
img
className
=
"
swap__down-arrow
"
src
=
{
ArrowDown
}
/
>
<
/div
>
<
/OversizedPanel
>
<
AddressInputPanel
/>
<
OversizedPanel
hideBottom
>
<
div
className
=
"
swap__exchange-rate-wrapper
"
>
<
span
className
=
"
swap__exchange-rate
"
>
Exchange
Rate
<
/span
>
<
span
>
1
ETH
=
1283.878
BAT
<
/span
>
<
/div
>
<
/OversizedPanel
>
<
div
className
=
"
swap__summary-wrapper
"
>
<
div
>
You
are
selling
<
span
className
=
"
swap__highlight-text
"
>
0.01
ETH
<
/span></
div
>
<
div
>
You
will
receive
between
<
span
className
=
"
swap__highlight-text
"
>
12.80
<
/span> and <span className="swap__highlight-text">12.83 BAT</
span
><
/div
>
<
/div
>
<
/div
>
<
button
className
=
"
swap__cta-btn
"
>
Send
<
/button
>
<
/div
>
);
}
}
export
default
withRouter
(
connect
(
(
state
,
ownProps
)
=>
({
push
:
ownProps
.
history
.
push
,
pathname
:
ownProps
.
location
.
pathname
,
}),
)(
Send
)
);
src/pages/Send/send.scss
0 → 100644
View file @
b9665b3a
@import
"../../variables.scss"
;
.send
{
@extend
%col-nowrap
;
height
:
100%
;
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment