Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
parity
fether
Commits
a9b3ae6e
Commit
a9b3ae6e
authored
Jan 18, 2019
by
Luke Schoen
Browse files
refactor: Replace url with onClick
parent
e423b8b8
Pipeline
#28555
passed with stage
in 1 minute and 50 seconds
Changes
2
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
packages/fether-react/src/Tokens/Tokens.js
View file @
a9b3ae6e
...
...
@@ -14,10 +14,6 @@ import withAccount from '../utils/withAccount';
@
withRouter
@
withAccount
class
Tokens
extends
PureComponent
{
handleGoToLink
=
url
=>
{
this
.
props
.
history
.
push
(
url
);
};
isParitySignerAccount
=
()
=>
{
const
{
account
:
{
type
}
...
...
@@ -28,18 +24,19 @@ class Tokens extends PureComponent {
menuItems
=
()
=>
{
const
{
account
:
{
address
}
account
:
{
address
},
history
}
=
this
.
props
;
const
backupAccountItem
=
{
name
:
'
Backup Account
'
,
url
:
`/backup/
${
address
}
`
onClick
:
()
=>
history
.
push
(
`/backup/
${
address
}
`
)
};
let
menuItems
=
[
{
name
:
'
Add
t
okens
'
,
url
:
`/whitelist/
${
address
}
`
name
:
'
Add
T
okens
'
,
onClick
:
()
=>
history
.
push
(
`/whitelist/
${
address
}
`
)
}
];
...
...
@@ -72,7 +69,6 @@ class Tokens extends PureComponent {
className
=
'
popup-menu-account
'
horizontalOffset
=
{
1
}
menuItems
=
{
this
.
menuItems
()}
onItemClick
=
{
this
.
handleGoToLink
}
size
=
'
small
'
trigger
=
{
<
Clickable
className
=
'
icon -menu
'
/>
}
/
>
...
...
packages/fether-ui/src/MenuPopup/MenuPopup.js
View file @
a9b3ae6e
...
...
@@ -7,7 +7,7 @@ import React from 'react';
import
PropTypes
from
'
prop-types
'
;
import
{
Popup
as
SUIPopup
}
from
'
semantic-ui-react
'
;
export
const
MenuPopup
=
({
menuItems
,
onItemClick
,
...
otherProps
})
=>
(
export
const
MenuPopup
=
({
menuItems
,
...
otherProps
})
=>
(
<
SUIPopup
{...
otherProps
}
>
<
div
className
=
'
popup-screen
'
>
<
SUIPopup
.
Content
>
...
...
@@ -16,7 +16,7 @@ export const MenuPopup = ({ menuItems, onItemClick, ...otherProps }) => (
<
div
className
=
'
popup-screen_item
'
key
=
{
item
.
name
}
onClick
=
{()
=>
onItemClick
(
item
.
url
)}
onClick
=
{()
=>
item
.
onClick
(
)}
>
{
item
.
name
}
<
/div
>
...
...
@@ -39,7 +39,6 @@ MenuPopup.propTypes = {
horizontalOffset
:
PropTypes
.
number
,
menuItems
:
PropTypes
.
array
.
isRequired
,
on
:
PropTypes
.
string
,
onItemClick
:
PropTypes
.
func
,
size
:
PropTypes
.
string
,
trigger
:
PropTypes
.
node
};
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new 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