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
d5679be5
Commit
d5679be5
authored
Jan 06, 2019
by
Jeff Reiner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
♻
refactor transaction details modal into expanding panel
parent
ff628445
Changes
9
Show whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
67 additions
and
106 deletions
+67
-106
contextual-info.scss
src/components/ContextualInfo/contextual-info.scss
+21
-48
index.js
src/components/ContextualInfo/index.js
+27
-39
AddLiquidity.js
src/pages/Pool/AddLiquidity.js
+2
-2
CreateExchange.js
src/pages/Pool/CreateExchange.js
+2
-2
RemoveLiquidity.js
src/pages/Pool/RemoveLiquidity.js
+2
-2
pool.scss
src/pages/Pool/pool.scss
+10
-10
index.js
src/pages/Send/index.js
+1
-1
index.js
src/pages/Swap/index.js
+1
-1
swap.scss
src/pages/Swap/swap.scss
+1
-1
No files found.
src/components/ContextualInfo/contextual-info.scss
View file @
d5679be5
@import
'../../variables.scss'
;
@import
"../../variables.scss"
;
.contextual-info
{
.contextual-info
{
&
__summary-wrapper
{
&
__summary-wrapper
{
background-color
:
$concrete-gray
;
color
:
$dove-gray
;
border-top-left-radius
:
1rem
;
font-size
:
0
.75rem
;
border-top-right-radius
:
1rem
;
padding
:
1rem
;
color
:
#737373
;
font-size
:
.75rem
;
text-align
:
center
;
text-align
:
center
;
cursor
:
pointer
;
margin-top
:
1rem
;
padding-top
:
1rem
;
}
}
&
--error
{
&
--error
{
color
:
$salmon-red
;
color
:
$salmon-red
;
}
}
&
__summary-modal
{
&
__details
{
background-color
:
$white
;
background-color
:
$concrete-gray
;
position
:
relative
;
padding
:
1
.5rem
;
bottom
:
12rem
;
min-height
:
12rem
;
max-height
:
12rem
;
z-index
:
2000
;
padding
:
1rem
;
border-top-left-radius
:
1rem
;
border-top-right-radius
:
1rem
;
transition
:
250ms
ease-in-out
;
@media
only
screen
and
(
min-width
:
768px
)
{
max-width
:
560px
;
position
:
absolute
;
margin-left
:
auto
;
margin-right
:
auto
;
border-radius
:
1rem
;
border-radius
:
1rem
;
padding-bottom
:
1rem
;
font-size
:
0
.75rem
;
left
:
0
;
margin-top
:
1rem
;
right
:
0
;
bottom
:
0
;
top
:
0
;
margin-top
:
4rem
;
}
}
.swap__open-details-container
{
&
__open-details-container
{
padding
:
0
.5rem
0
;
margin-bottom
:
1rem
;
cursor
:
pointer
;
cursor
:
pointer
;
}
}
&
__open-details-container
{
@extend
%row-nowrap
;
@extend
%row-nowrap
;
align-items
:
center
;
align-items
:
center
;
justify-content
:
space-between
;
justify-content
:
center
;
font-size
:
.75rem
;
font-size
:
0
.75rem
;
color
:
$royal-blue
;
color
:
$royal-blue
;
img
{
span
{
height
:
.75rem
;
margin-right
:
12px
;
width
:
.75rem
;
}
}
}
&
__modal-button
{
img
{
padding
:
0
.5rem
0
;
height
:
0
.75rem
;
margin-bottom
:
1rem
;
width
:
0
.75rem
;
}
}
}
}
}
src/components/ContextualInfo/index.js
View file @
d5679be5
import
React
,
{
Component
}
from
'
react
'
;
import
React
,
{
Component
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
PropTypes
from
'
prop-types
'
;
import
c
from
'
classnames
'
;
import
c
from
'
classnames
'
;
import
{
CSSTransitionGroup
}
from
"
react-transition-group
"
;
import
Modal
from
'
../Modal
'
;
import
DropdownBlue
from
"
../../assets/images/dropdown-blue.svg
"
;
import
DropdownBlue
from
"
../../assets/images/dropdown-blue.svg
"
;
import
DropupBlue
from
"
../../assets/images/dropup-blue.svg
"
;
import
DropupBlue
from
"
../../assets/images/dropup-blue.svg
"
;
import
'
./contextual-info.scss
'
;
import
'
./contextual-info.scss
'
;
class
ContextualInfo
extends
Component
{
class
ContextualInfo
extends
Component
{
static
propTypes
=
{
static
propTypes
=
{
open
Modal
Text
:
PropTypes
.
string
,
open
Details
Text
:
PropTypes
.
string
,
renderTransactionDetails
:
PropTypes
.
func
,
renderTransactionDetails
:
PropTypes
.
func
,
contextualInfo
:
PropTypes
.
string
,
contextualInfo
:
PropTypes
.
string
,
modalClass
:
PropTypes
.
string
,
isError
:
PropTypes
.
bool
,
isError
:
PropTypes
.
bool
,
};
};
static
defaultProps
=
{
static
defaultProps
=
{
openModalText
:
'
Transaction Details
'
,
openDetailsText
:
'
Transaction Details
'
,
closeDetailsText
:
'
Hide Details
'
,
renderTransactionDetails
()
{},
renderTransactionDetails
()
{},
contextualInfo
:
''
,
contextualInfo
:
''
,
modalClass
:
''
,
isError
:
false
,
isError
:
false
,
};
};
state
=
{
state
=
{
showDetail
Modal
:
false
,
showDetail
s
:
false
,
};
};
render
Modal
()
{
render
Details
()
{
if
(
!
this
.
state
.
showDetail
Modal
)
{
if
(
!
this
.
state
.
showDetail
s
)
{
return
null
;
return
null
;
}
}
const
{
modalClass
}
=
this
.
props
;
return
(
return
(
<
Modal
key
=
"
modal
"
onClose
=
{()
=>
this
.
setState
({
showDetailModal
:
false
})}
>
<
div
className
=
"
contextual-info__details
"
>
<
CSSTransitionGroup
transitionName
=
"
summary-modal
"
transitionAppear
=
{
true
}
transitionLeave
=
{
true
}
transitionAppearTimeout
=
{
200
}
transitionLeaveTimeout
=
{
200
}
transitionEnterTimeout
=
{
200
}
>
<
div
className
=
{
c
(
'
contextual-info__summary-modal
'
,
modalClass
)}
>
<
div
key
=
"
open-details
"
className
=
"
contextual-info__open-details-container contextual-info__modal-button
"
onClick
=
{()
=>
this
.
setState
({
showDetailModal
:
false
})}
>
<
span
>
Transaction
Details
<
/span
>
<
img
src
=
{
DropupBlue
}
/
>
<
/div
>
{
this
.
props
.
renderTransactionDetails
()}
{
this
.
props
.
renderTransactionDetails
()}
<
/div
>
<
/div
>
<
/CSSTransitionGroup
>
)
<
/Modal
>
);
}
}
render
()
{
render
()
{
const
{
const
{
openModalText
,
openDetailsText
,
closeDetailsText
,
contextualInfo
,
contextualInfo
,
isError
,
isError
,
}
=
this
.
props
;
}
=
this
.
props
;
...
@@ -81,12 +58,23 @@ class ContextualInfo extends Component {
...
@@ -81,12 +58,23 @@ class ContextualInfo extends Component {
<
div
<
div
key
=
"
open-details
"
key
=
"
open-details
"
className
=
"
contextual-info__summary-wrapper contextual-info__open-details-container
"
className
=
"
contextual-info__summary-wrapper contextual-info__open-details-container
"
onClick
=
{()
=>
this
.
setState
({
showDetailModal
:
true
})}
onClick
=
{()
=>
this
.
setState
((
prevState
)
=>
{
return
{
showDetails
:
!
prevState
.
showDetails
}
})}
>
>
<
span
>
{
openModalText
}
<
/span
>
{
!
this
.
state
.
showDetails
?
(
<>
<
span
>
{
openDetailsText
}
<
/span
>
<
img
src
=
{
DropdownBlue
}
/
>
<
img
src
=
{
DropdownBlue
}
/
>
<
/
>
)
:
(
<>
<
span
>
{
closeDetailsText
}
<
/span
>
<
img
src
=
{
DropupBlue
}
/
>
<
/
>
)}
<
/div>
,
<
/div>
,
this
.
render
Modal
()
this
.
render
Details
()
]
]
}
}
}
}
...
...
src/pages/Pool/AddLiquidity.js
View file @
d5679be5
...
@@ -559,6 +559,7 @@ class AddLiquidity extends Component {
...
@@ -559,6 +559,7 @@ class AddLiquidity extends Component {
<
OversizedPanel
hideBottom
>
<
OversizedPanel
hideBottom
>
{
this
.
renderInfo
()
}
{
this
.
renderInfo
()
}
<
/OversizedPanel
>
<
/OversizedPanel
>
{
this
.
renderSummary
(
inputError
,
outputError
)
}
<
div
className
=
"
pool__cta-container
"
>
<
div
className
=
"
pool__cta-container
"
>
<
button
<
button
className
=
{
classnames
(
'
pool__cta-btn
'
,
{
className
=
{
classnames
(
'
pool__cta-btn
'
,
{
...
@@ -571,8 +572,7 @@ class AddLiquidity extends Component {
...
@@ -571,8 +572,7 @@ class AddLiquidity extends Component {
Add
Liquidity
Add
Liquidity
<
/button
>
<
/button
>
<
/div
>
<
/div
>
<
/div>
,
<
/div
>
this
.
renderSummary
(
inputError
,
outputError
)
];
];
}
}
}
}
...
...
src/pages/Pool/CreateExchange.js
View file @
d5679be5
...
@@ -149,7 +149,7 @@ class CreateExchange extends Component {
...
@@ -149,7 +149,7 @@ class CreateExchange extends Component {
if
(
errorMessage
)
{
if
(
errorMessage
)
{
return
(
return
(
<
div
className
=
"
create-exchange__summary-panel
"
>
<
div
className
=
"
create-exchange__summary-panel
"
>
<
div
className
=
"
create-exchange__summary-text
"
>
{
errorMessage
}
<
/div
>
<
div
className
=
"
create-exchange__summary-text
create-exchange--error
"
>
{
errorMessage
}
<
/div
>
<
/div
>
<
/div
>
)
)
}
}
...
@@ -200,6 +200,7 @@ class CreateExchange extends Component {
...
@@ -200,6 +200,7 @@ class CreateExchange extends Component {
<
/div
>
<
/div
>
<
/div
>
<
/div
>
<
/OversizedPanel
>
<
/OversizedPanel
>
{
this
.
renderSummary
()
}
<
div
className
=
"
pool__cta-container
"
>
<
div
className
=
"
pool__cta-container
"
>
<
button
<
button
className
=
{
classnames
(
'
pool__cta-btn
'
,
{
className
=
{
classnames
(
'
pool__cta-btn
'
,
{
...
@@ -211,7 +212,6 @@ class CreateExchange extends Component {
...
@@ -211,7 +212,6 @@ class CreateExchange extends Component {
Create
Exchange
Create
Exchange
<
/button
>
<
/button
>
<
/div
>
<
/div
>
{
this
.
renderSummary
()
}
<
/div
>
<
/div
>
);
);
}
}
...
...
src/pages/Pool/RemoveLiquidity.js
View file @
d5679be5
...
@@ -377,6 +377,7 @@ class RemoveLiquidity extends Component {
...
@@ -377,6 +377,7 @@ class RemoveLiquidity extends Component {
<
/div
>
<
/div
>
<
/OversizedPanel
>
<
/OversizedPanel
>
{
this
.
renderOutput
()
}
{
this
.
renderOutput
()
}
{
this
.
renderSummary
(
errorMessage
)
}
<
div
className
=
"
pool__cta-container
"
>
<
div
className
=
"
pool__cta-container
"
>
<
button
<
button
className
=
{
classnames
(
'
pool__cta-btn
'
,
{
className
=
{
classnames
(
'
pool__cta-btn
'
,
{
...
@@ -389,8 +390,7 @@ class RemoveLiquidity extends Component {
...
@@ -389,8 +390,7 @@ class RemoveLiquidity extends Component {
Remove
Liquidity
Remove
Liquidity
<
/button
>
<
/button
>
<
/div
>
<
/div
>
<
/div>
,
<
/div
>
this
.
renderSummary
(
errorMessage
)
];
];
}
}
}
}
...
...
src/pages/Pool/pool.scss
View file @
d5679be5
...
@@ -113,9 +113,11 @@
...
@@ -113,9 +113,11 @@
}
}
&
__item
{
&
__item
{
&
:not
(
:last-child
)
{
margin-bottom
:
.5rem
;
margin-bottom
:
.5rem
;
}
}
}
}
}
}
}
.pool-modal
{
.pool-modal
{
...
@@ -173,20 +175,18 @@
...
@@ -173,20 +175,18 @@
.create-exchange
{
.create-exchange
{
&
__summary-panel
{
&
__summary-panel
{
position
:
absolute
;
color
:
$dove-gray
;
bottom
:
0
;
left
:
0
;
background-color
:
$concrete-gray
;
width
:
100%
;
text-align
:
center
;
text-align
:
center
;
border-top-left-radius
:
.625
rem
;
margin-top
:
1
rem
;
border-top-right-radius
:
.625
rem
;
padding-top
:
1
rem
;
}
}
&
__summary-text
{
&
__summary-text
{
padding
:
.75rem
;
font-size
:
.75rem
;
font-size
:
.75rem
;
color
:
$dove-gray
;
}
&
--error
{
color
:
$salmon-red
;
}
}
}
}
...
...
src/pages/Send/index.js
View file @
d5679be5
...
@@ -770,6 +770,7 @@ class Send extends Component {
...
@@ -770,6 +770,7 @@ class Send extends Component {
onChange
=
{
address
=>
this
.
setState
({
recipient
:
address
})}
onChange
=
{
address
=>
this
.
setState
({
recipient
:
address
})}
/
>
/
>
{
this
.
renderExchangeRate
()
}
{
this
.
renderExchangeRate
()
}
{
this
.
renderSummary
(
inputError
,
outputError
)
}
<
div
className
=
"
swap__cta-container
"
>
<
div
className
=
"
swap__cta-container
"
>
<
button
<
button
className
=
{
classnames
(
'
swap__cta-btn
'
,
{
className
=
{
classnames
(
'
swap__cta-btn
'
,
{
...
@@ -782,7 +783,6 @@ class Send extends Component {
...
@@ -782,7 +783,6 @@ class Send extends Component {
<
/button
>
<
/button
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
{
this
.
renderSummary
(
inputError
,
outputError
)
}
<
/div
>
<
/div
>
);
);
}
}
...
...
src/pages/Swap/index.js
View file @
d5679be5
...
@@ -743,6 +743,7 @@ class Swap extends Component {
...
@@ -743,6 +743,7 @@ class Swap extends Component {
disableUnlock
disableUnlock
/>
/>
{
this
.
renderExchangeRate
()
}
{
this
.
renderExchangeRate
()
}
{
this
.
renderSummary
(
inputError
,
outputError
)
}
<
div
className
=
"
swap__cta-container
"
>
<
div
className
=
"
swap__cta-container
"
>
<
button
<
button
className
=
{
classnames
(
'
swap__cta-btn
'
,
{
className
=
{
classnames
(
'
swap__cta-btn
'
,
{
...
@@ -755,7 +756,6 @@ class Swap extends Component {
...
@@ -755,7 +756,6 @@ class Swap extends Component {
<
/button
>
<
/button
>
<
/div
>
<
/div
>
<
/div
>
<
/div
>
{
this
.
renderSummary
(
inputError
,
outputError
)
}
<
/div
>
<
/div
>
);
);
}
}
...
...
src/pages/Swap/swap.scss
View file @
d5679be5
...
@@ -54,7 +54,7 @@
...
@@ -54,7 +54,7 @@
&
__cta-container
{
&
__cta-container
{
display
:
flex
;
display
:
flex
;
margin-top
:
1
.5
rem
;
margin-top
:
1rem
;
}
}
&
__cta-btn
{
&
__cta-btn
{
...
...
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