From 4a3132b8e70b50b95f8eb0cd2fe59b2cebb64f4b Mon Sep 17 00:00:00 2001 From: Labhansh Agrawal Date: Wed, 18 Mar 2020 00:35:05 +0530 Subject: [PATCH] port notifications component to ts --- .../{notifications.js => notifications.tsx} | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) rename lib/components/{notifications.js => notifications.tsx} (93%) diff --git a/lib/components/notifications.js b/lib/components/notifications.tsx similarity index 93% rename from lib/components/notifications.js rename to lib/components/notifications.tsx index 8a68067a..f605ff1b 100644 --- a/lib/components/notifications.js +++ b/lib/components/notifications.tsx @@ -3,10 +3,11 @@ import React from 'react'; import {decorate} from '../utils/plugins'; import Notification_ from './notification'; +import {NotificationsProps} from '../hyper'; const Notification = decorate(Notification_, 'Notification'); -export default class Notifications extends React.PureComponent { +export default class Notifications extends React.PureComponent { render() { return (
@@ -50,7 +51,7 @@ export default class Notifications extends React.PureComponent { key="link" style={{color: '#fff'}} onClick={ev => { - window.require('electron').shell.openExternal(ev.target.href); + window.require('electron').shell.openExternal(ev.currentTarget.href); ev.preventDefault(); }} href={this.props.messageURL} @@ -77,7 +78,7 @@ export default class Notifications extends React.PureComponent { { - window.require('electron').shell.openExternal(ev.target.href); + window.require('electron').shell.openExternal(ev.currentTarget.href); ev.preventDefault(); }} href={`https://github.com/zeit/hyper/releases/tag/${this.props.updateVersion}`} @@ -105,10 +106,10 @@ export default class Notifications extends React.PureComponent { fontWeight: 'bold' }} onClick={ev => { - window.require('electron').shell.openExternal(ev.target.href); + window.require('electron').shell.openExternal(ev.currentTarget.href); ev.preventDefault(); }} - href={this.props.updateReleaseUrl} + href={this.props.updateReleaseUrl!} > Download