From b92362d07004edae9e944e5e923e0f6de26b2c6f Mon Sep 17 00:00:00 2001 From: ryanml Date: Thu, 14 Feb 2019 12:47:11 -0700 Subject: [PATCH] Rewards: Imported from brave-ui: Addressing code review --- .../resources/ui/components/walletWrapper/index.tsx | 10 +++++++--- .../resources/ui/components/walletWrapper/style.ts | 3 --- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/components/brave_rewards/resources/ui/components/walletWrapper/index.tsx b/components/brave_rewards/resources/ui/components/walletWrapper/index.tsx index 656e99d738a8..795cb181fed1 100644 --- a/components/brave_rewards/resources/ui/components/walletWrapper/index.tsx +++ b/components/brave_rewards/resources/ui/components/walletWrapper/index.tsx @@ -246,8 +246,8 @@ export default class WalletWrapper extends React.PureComponent { } getNotificationButton = (type: NotificationType, onClose: any) => { - let buttonText = 'OK' - let buttonAction = onClose + let buttonText + let buttonAction switch (type) { case 'grant': @@ -258,6 +258,10 @@ export default class WalletWrapper extends React.PureComponent { buttonText = getLocale('backupNow') buttonAction = this.onNotificationClick break + default: + buttonText = getLocale('ok').toUpperCase() + buttonAction = onClose + break } return ( @@ -286,7 +290,7 @@ export default class WalletWrapper extends React.PureComponent { {this.getNotificationIcon(notification)} {this.getNotificationMessage(notification)} - + {this.getNotificationButton(notification.type, onClose)} diff --git a/components/brave_rewards/resources/ui/components/walletWrapper/style.ts b/components/brave_rewards/resources/ui/components/walletWrapper/style.ts index 01e55917a3ab..3abd092dc461 100644 --- a/components/brave_rewards/resources/ui/components/walletWrapper/style.ts +++ b/components/brave_rewards/resources/ui/components/walletWrapper/style.ts @@ -13,8 +13,6 @@ interface StyledProps { compact?: boolean, background?: string, isMobile?: boolean, - type?: string, - onClick?: Function | undefined, notification?: Notification | undefined } @@ -283,7 +281,6 @@ export const StyledTypeText = styled('span')` font-weight: 500; margin-right: 5px; display: inline-block; - cursor: ${p => p.onClick ? 'pointer' : 'default'}; ` export const StyledMessageText = styled('span')`