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
7a30c1c8
Commit
7a30c1c8
authored
Oct 06, 2018
by
Chi Kei Chan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add NavigationTabs
parent
e0cc2b59
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
164 additions
and
9 deletions
+164
-9
index.js
src/components/Logo/index.js
+4
-2
index.js
src/components/NavigationTabs/index.js
+46
-0
OrderContainer.js
src/components/OrderContainer.js
+0
-0
index.js
src/components/Tab/index.js
+38
-0
tab.scss
src/components/Tab/tab.scss
+39
-0
web3-status.scss
src/components/Web3Status/web3-status.scss
+3
-3
index.scss
src/index.scss
+1
-1
App.js
src/pages/App.js
+2
-0
index.js
src/pages/Swap/index.js
+19
-2
swap.scss
src/pages/Swap/swap.scss
+5
-0
variables.scss
src/variables.scss
+7
-1
No files found.
src/components/Logo/index.js
View file @
7a30c1c8
...
...
@@ -3,6 +3,8 @@ import "./logo.scss";
export
default
function
Logo
(
props
)
{
return
(
<
div
className
=
"
logo
"
>
🦄
<
/div
>
<
div
className
=
"
logo
"
>
<
span
role
=
"
img
"
aria
-
label
=
"
logo
"
>
🦄
<
/span
>
<
/div
>
);
}
\ No newline at end of file
}
src/components/NavigationTabs/index.js
0 → 100644
View file @
7a30c1c8
import
React
,
{
Component
}
from
'
react
'
;
import
{
withRouter
}
from
'
react-router-dom
'
;
import
PropTypes
from
'
prop-types
'
;
import
{
Tab
,
Tabs
}
from
"
../Tab
"
;
class
NavigationTabs
extends
Component
{
static
propTypes
=
{
history
:
PropTypes
.
shape
({
push
:
PropTypes
.
func
.
isRequired
,
}),
};
constructor
(
props
)
{
super
(
props
);
this
.
state
=
{
selectedPath
:
this
.
props
.
location
.
pathname
,
};
}
renderTab
(
name
,
path
)
{
const
{
push
}
=
this
.
props
.
history
;
const
{
selectedPath
}
=
this
.
state
;
return
(
<
Tab
text
=
{
name
}
onClick
=
{()
=>
{
push
(
path
);
this
.
setState
({
selectedPath
:
path
});
}}
isSelected
=
{
path
===
selectedPath
}
/
>
)
}
render
()
{
return
(
<
Tabs
>
{
this
.
renderTab
(
'
Swap
'
,
'
/swap
'
)
}
{
this
.
renderTab
(
'
Send
'
,
'
/send
'
)
}
{
this
.
renderTab
(
'
Pool
'
,
'
/pool
'
)
}
<
/Tabs
>
);
}
}
export
default
withRouter
(
NavigationTabs
);
src/co
ntainer
s/OrderContainer.js
→
src/co
mponent
s/OrderContainer.js
View file @
7a30c1c8
File moved
src/components/Tab/index.js
0 → 100644
View file @
7a30c1c8
import
React
,
{
Component
}
from
'
react
'
;
import
PropTypes
from
'
prop-types
'
;
import
classnames
from
'
classnames
'
;
import
'
./tab.scss
'
;
export
const
Tabs
=
props
=>
{
return
(
<
div
className
=
"
tabs
"
>
{
props
.
children
}
<
/div
>
);
};
export
const
Tab
=
props
=>
{
return
(
<
div
className
=
{
classnames
(
"
tab
"
,
{
'
tab--selected
'
:
props
.
isSelected
,
})}
onClick
=
{
props
.
onClick
}
>
{
props
.
text
?
<
span
>
{
props
.
text
}
<
/span> : null
}
<
/div
>
);
};
Tab
.
propTypes
=
{
className
:
PropTypes
.
string
,
text
:
PropTypes
.
string
,
isSelected
:
PropTypes
.
bool
,
onClick
:
PropTypes
.
func
,
};
Tab
.
defaultProps
=
{
className
:
''
,
};
src/components/Tab/tab.scss
0 → 100644
View file @
7a30c1c8
@import
'../../variables.scss'
;
.tabs
{
@extend
%row-nowrap
;
align-items
:
center
;
height
:
3rem
;
background-color
:
$concrete-gray
;
border-radius
:
3rem
;
border
:
1px
solid
$mercury-gray
;
}
.tab
{
@extend
%row-nowrap
;
align-items
:
center
;
justify-content
:
center
;
height
:
3rem
;
flex
:
1
0
auto
;
border-radius
:
3rem
;
border
:
1px
solid
transparent
;
transition
:
250ms
ease-in-out
;
left
:
-1px
;
position
:
relative
;
span
{
color
:
$dove-gray
;
font-size
:
1rem
;
}
&
--selected
{
background-color
:
$white
;
border-radius
:
3rem
;
border
:
1px
solid
$mercury-gray
;
font-weight
:
500
;
span
{
color
:
$royal-blue
;
}
}
}
src/components/Web3Status/web3-status.scss
View file @
7a30c1c8
...
...
@@ -2,15 +2,15 @@
.web3-status
{
@extend
%row-nowrap
;
width
:
9
.5
rem
;
font-size
:
.
75
rem
;
width
:
10
rem
;
font-size
:
.
9
rem
;
line-height
:
1rem
;
align-items
:
center
;
border
:
1px
solid
$mercury-gray
;
padding
:
.5rem
1rem
;
border-radius
:
2rem
;
color
:
$dove-gray
;
font-weight
:
5
00
;
font-weight
:
4
00
;
box-sizing
:
border-box
;
&
__identicon
{
...
...
src/index.scss
View file @
7a30c1c8
...
...
@@ -18,5 +18,5 @@ html, body {
width
:
100vw
;
overflow-x
:
hidden
;
overflow-y
:
auto
;
background-color
:
$
concrete-gray
;
background-color
:
$
white
;
}
src/pages/App.js
View file @
7a30c1c8
...
...
@@ -64,6 +64,8 @@ class App extends Component {
return
(
<
Switch
>
<
Route
exact
path
=
"
/swap
"
component
=
{
Swap
}
/
>
<
Route
exact
path
=
"
/send
"
component
=
{
Swap
}
/
>
<
Route
exact
path
=
"
/pool
"
component
=
{
Swap
}
/
>
<
/Switch
>
)
}
...
...
src/pages/Swap/index.js
View file @
7a30c1c8
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
"
./swap.scss
"
;
class
Swap
extends
Component
{
static
propTypes
=
{
// Injected by React Router Dom
push
:
PropTypes
.
func
.
isRequired
,
pathname
:
PropTypes
.
string
.
isRequired
,
};
render
()
{
return
(
<
div
className
=
"
swap
"
>
<
Header
/>
<
div
className
=
"
swap__content
"
>
<
NavigationTabs
/>
<
/div
>
<
/div
>
)
)
;
}
}
export
default
connect
()(
Swap
);
export
default
withRouter
(
connect
(
(
state
,
ownProps
)
=>
({
push
:
ownProps
.
history
.
push
,
pathname
:
ownProps
.
location
.
pathname
,
}),
)(
Swap
)
);
src/pages/Swap/swap.scss
View file @
7a30c1c8
.swap
{
&
__content
{
padding
:
1rem
.75rem
;
}
}
\ No newline at end of file
src/variables.scss
View file @
7a30c1c8
$white
:
#fff
;
$black
:
#000
;
// Gray
$concrete-gray
:
#F
2F2F2
;
$concrete-gray
:
#F
BFBFB
;
$silver-gray
:
#C4C4C4
;
$mercury-gray
:
#E1E1E1
;
$dove-gray
:
#737373
;
// Blue
$royal-blue
:
#2F80ED
;
// Purple
$wisteria-purple
:
#AE60B9
;
...
...
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