Add cancel button to updater

This commit is contained in:
Yuya Ochiai
2018-10-17 22:42:51 +09:00
parent c4240bd87f
commit 48f165c44f
4 changed files with 20 additions and 5 deletions

View File

@@ -55,6 +55,11 @@ function UpdaterPage(props) {
now={props.progress}
label={`${props.progress}%`}
/>
<div className='pull-right'>
<Button
onClick={props.onClickCancel}
>{'Cancel'}</Button>
</div>
</Navbar> :
<Navbar
className='UpdaterPage-footer'
@@ -93,6 +98,7 @@ UpdaterPage.propTypes = {
onClickReleaseNotes: propTypes.func.isRequired,
onClickRemind: propTypes.func.isRequired,
onClickSkip: propTypes.func.isRequired,
onClickCancel: propTypes.func.isRequired,
};
export default UpdaterPage;

View File

@@ -48,5 +48,6 @@ storiesOf('UpdaterPage', module).
appName={appName}
isDownloading={true}
progress={0}
onClickCancel={action('clicked cancel')}
/>
));

View File

@@ -53,6 +53,9 @@ class UpdaterPageContainer extends React.Component {
onClickDownload={() => {
ipcRenderer.send('click-download');
}}
onClickCancel={() => {
ipcRenderer.send('click-cancel');
}}
/>
);
}