Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.

Commit e53a8ad

Browse files
committed
Refactor SeshatResetDialog in TypeScript
1 parent c40f97f commit e53a8ad

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

src/components/views/dialogs/SeshatResetDialog.js renamed to src/components/views/dialogs/SeshatResetDialog.tsx

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
Copyright 2020 The Matrix.org Foundation C.I.C.
2+
Copyright 2021 The Matrix.org Foundation C.I.C.
33
44
Licensed under the Apache License, Version 2.0 (the "License");
55
you may not use this file except in compliance with the License.
@@ -15,25 +15,24 @@ limitations under the License.
1515
*/
1616

1717
import React from 'react';
18-
import PropTypes from 'prop-types';
1918
import {_t} from "../../../languageHandler";
20-
import * as sdk from "../../../index";
2119
import {replaceableComponent} from "../../../utils/replaceableComponent";
2220

21+
import BaseDialog from "./BaseDialog";
22+
import DialogButtons from "../elements/DialogButtons";
23+
24+
interface IProps {
25+
onFinished(): void;
26+
}
27+
2328
@replaceableComponent("views.dialogs.SeshatResetDialog")
24-
export default class SeshatResetDialog extends React.Component {
25-
static propTypes = {
26-
onFinished: PropTypes.func.isRequired,
27-
};
29+
export default class SeshatResetDialog extends React.PureComponent<IProps> {
2830
render() {
29-
const BaseDialog = sdk.getComponent('views.dialogs.BaseDialog');
30-
const DialogButtons = sdk.getComponent('views.elements.DialogButtons');
31-
3231
return (
3332
<BaseDialog
34-
hasCancel={true}
35-
onFinished={this.props.onFinished.bind(null, false)}
36-
title={_t("Reset event index store?")}>
33+
hasCancel={true}
34+
onFinished={this.props.onFinished.bind(null, false)}
35+
title={_t("Reset event index store?")}>
3736
<div>
3837
<p>
3938
{_t(

0 commit comments

Comments
 (0)