-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #34723 from JKobrynski/migrateUpdateAppModalToType…
…Script [No QA] [TS migration] Migrate 'UpdateAppModal' component to TypeScript
- Loading branch information
Showing
5 changed files
with
26 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
11 changes: 5 additions & 6 deletions
11
...omponents/UpdateAppModal/index.desktop.js → ...mponents/UpdateAppModal/index.desktop.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,16 @@ | ||
import React from 'react'; | ||
import ELECTRON_EVENTS from '../../../desktop/ELECTRON_EVENTS'; | ||
import BaseUpdateAppModal from './BaseUpdateAppModal'; | ||
import {propTypes} from './updateAppModalPropTypes'; | ||
import type UpdateAppModalProps from './types'; | ||
|
||
function UpdateAppModal(props) { | ||
function UpdateAppModal({onSubmit}: UpdateAppModalProps) { | ||
const updateApp = () => { | ||
if (props.onSubmit) { | ||
props.onSubmit(); | ||
} | ||
onSubmit?.(); | ||
window.electron.send(ELECTRON_EVENTS.START_UPDATE); | ||
}; | ||
return <BaseUpdateAppModal onSubmit={updateApp} />; | ||
} | ||
UpdateAppModal.propTypes = propTypes; | ||
|
||
UpdateAppModal.displayName = 'UpdateAppModal'; | ||
|
||
export default UpdateAppModal; |
7 changes: 4 additions & 3 deletions
7
src/components/UpdateAppModal/index.js → src/components/UpdateAppModal/index.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
import React from 'react'; | ||
import BaseUpdateAppModal from './BaseUpdateAppModal'; | ||
import {propTypes} from './updateAppModalPropTypes'; | ||
import type UpdateAppModalProps from './types'; | ||
|
||
function UpdateAppModal(props) { | ||
function UpdateAppModal(props: UpdateAppModalProps) { | ||
return ( | ||
<BaseUpdateAppModal | ||
// eslint-disable-next-line react/jsx-props-no-spreading | ||
{...props} | ||
/> | ||
); | ||
} | ||
UpdateAppModal.propTypes = propTypes; | ||
|
||
UpdateAppModal.displayName = 'UpdateAppModal'; | ||
|
||
export default UpdateAppModal; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
type UpdateAppModalProps = { | ||
/** Callback to fire when we want to trigger the update. */ | ||
onSubmit?: () => void; | ||
}; | ||
|
||
export default UpdateAppModalProps; |
This file was deleted.
Oops, something went wrong.