Skip to content

Commit

Permalink
Rewards: Imported from brave-ui: Addressing code review
Browse files Browse the repository at this point in the history
  • Loading branch information
ryanml authored and NejcZdovc committed Sep 19, 2019
1 parent 9e5904a commit b92362d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -246,8 +246,8 @@ export default class WalletWrapper extends React.PureComponent<Props, State> {
}

getNotificationButton = (type: NotificationType, onClose: any) => {
let buttonText = 'OK'
let buttonAction = onClose
let buttonText
let buttonAction

switch (type) {
case 'grant':
Expand All @@ -258,6 +258,10 @@ export default class WalletWrapper extends React.PureComponent<Props, State> {
buttonText = getLocale('backupNow')
buttonAction = this.onNotificationClick
break
default:
buttonText = getLocale('ok').toUpperCase()
buttonAction = onClose
break
}

return (
Expand Down Expand Up @@ -286,7 +290,7 @@ export default class WalletWrapper extends React.PureComponent<Props, State> {
<StyledNotificationContent>
{this.getNotificationIcon(notification)}
{this.getNotificationMessage(notification)}
<StyledButtonWrapper type={notification.type}>
<StyledButtonWrapper>
{this.getNotificationButton(notification.type, onClose)}
</StyledButtonWrapper>
</StyledNotificationContent>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ interface StyledProps {
compact?: boolean,
background?: string,
isMobile?: boolean,
type?: string,
onClick?: Function | undefined,
notification?: Notification | undefined
}

Expand Down Expand Up @@ -283,7 +281,6 @@ export const StyledTypeText = styled<StyledProps, 'span'>('span')`
font-weight: 500;
margin-right: 5px;
display: inline-block;
cursor: ${p => p.onClick ? 'pointer' : 'default'};
`

export const StyledMessageText = styled<StyledProps, 'span'>('span')`
Expand Down

0 comments on commit b92362d

Please sign in to comment.