Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
reprograma
Wallet Frontend
Commits
f0ebb8e5
Commit
f0ebb8e5
authored
May 24, 2019
by
Simic Veljko
Browse files
Scale amount
parent
8981a06e
Changes
4
Hide whitespace changes
Inline
Side-by-side
src/components/widgets/CurrenciesValue/index.js
View file @
f0ebb8e5
...
...
@@ -23,8 +23,10 @@ class CurrenciesValue extends Component {
if
(
nextProps
.
status
===
"
success
"
){
this
.
setState
({
loading
:
false
});
}
}
componentWillUnmount
()
{
this
.
props
.
reset
()
}
render
()
{
const
{
values
=
{}
}
=
this
.
props
;
if
(
this
.
state
.
loading
&&
Object
.
keys
(
values
).
length
===
0
)
return
"
Loading
"
;
...
...
src/components/widgets/Transactions/index.js
View file @
f0ebb8e5
...
...
@@ -13,6 +13,14 @@ import Button from "components/atoms/CustomButtons/Button.jsx";
import
{
connect
}
from
'
react-redux
'
import
actions
from
'
./actions
'
const
STATUS_COLORS
=
{
'
sending
'
:
'
#2192EF
'
,
'
failed
'
:
'
#FF5000
'
,
'
success
'
:
'
#4caf50
'
}
class
Transactions
extends
Component
{
constructor
(){
super
();
...
...
@@ -121,11 +129,29 @@ class Transactions extends Component {
columns
=
{[
{
Header
:
"
Status
"
,
accessor
:
"
status
"
,
accessor
:
"
status
"
,
Cell
:
row
=>
{
const
status
=
row
.
row
.
status
return
(
<
div
style
=
{{
display
:
'
flex
'
,
justifyContent
:
'
center
'
,
width
:
'
100%
'
,
height
:
'
100%
'
,
backgroundColor
:
STATUS_COLORS
[
status
],
borderRadius
:
'
2px
'
}}
>
<
i
>
{
status
}
<
/i
>
<
/div
>
)
}
},
{
Header
:
"
Amount
"
,
accessor
:
"
amount
"
accessor
:
"
amount
"
,
},
{
Header
:
"
Date
"
,
...
...
src/components/widgets/WalletActions/CashOut/methods/Coin.jsx
View file @
f0ebb8e5
...
...
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
import
{
connect
}
from
'
react-redux
'
;
import
actions
from
'
./actions
'
;
import
transactionsActions
from
'
../../../Transactions/actions
'
;
import
walletActions
from
'
../../../../../layouts/actions
'
;
import
Big
from
'
big.js
'
;
import
TextField
from
'
@material-ui/core/TextField
'
;
...
...
@@ -44,7 +45,7 @@ class Coin extends Component {
alert
:
(
<
SweetAlert
success
style
=
{
{
display
:
"
block
"
,
marginTop
:
"
-100px
"
}
}
style
=
{
{
display
:
"
block
"
,
width
:
'
30%
'
,
marginTop
:
"
-100px
"
}
}
title
=
"Success send!"
onConfirm
=
{
()
=>
this
.
hideAlert
()
}
onCancel
=
{
()
=>
this
.
hideAlert
()
}
...
...
@@ -55,13 +56,18 @@ class Coin extends Component {
});
nextProps
.
reset
(
this
.
props
.
method
);
nextProps
.
getTransactions
();
nextProps
.
getWallet
();
}
}
handleSubmit
(){
const
{
amount
,
address
,
concept
,
pin
}
=
this
.
state
;
const
{
method
,
company_id
}
=
this
.
props
let
scale_amount
=
amount
*
1
e8
;
if
(
method
.
cname
!==
'
fac
'
){
scale_amount
=
Math
.
round
(
scale_amount
);
}
let
data
=
new
FormData
();
data
.
set
(
'
amount
'
,
amount
);
data
.
set
(
'
amount
'
,
scale_
amount
);
data
.
set
(
'
address
'
,
address
);
data
.
set
(
'
concept
'
,
concept
);
data
.
set
(
'
pin
'
,
pin
);
...
...
@@ -210,7 +216,8 @@ const mapDispatchToProps = (dispatch) => {
return
{
cashOut
:
actions
.
cashOut
,
reset
:
actions
.
reset
,
getTransactions
:
transactionsActions
.
getTransactions
getTransactions
:
transactionsActions
.
getTransactions
,
getWallet
:
walletActions
.
getWallet
}
}
...
...
src/layouts/actions.js
View file @
f0ebb8e5
...
...
@@ -39,6 +39,19 @@ const successWallet = createAction(WALLET, wallet=> ({
status
:
'
success
'
}));
export
const
getWallet
=
()
=>
(
dispatch
)
=>
{
dispatch
(
beginWallet
());
fetchApi
({
path
:
'
user/v1/wallet
'
}).
then
(
response
=>
{
var
wallet
=
response
;
dispatch
(
successWallet
(
wallet
.
data
));
}).
catch
(
error
=>
{
dispatch
(
failWallet
(
error
));
});
}
const
getMe
=
()
=>
(
dispatch
)
=>
{
dispatch
(
begin
());
...
...
@@ -70,7 +83,9 @@ const actions = {
beginWallet
,
successWallet
,
failWallet
,
getMe
getMe
,
getWallet
};
export
default
actions
;
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