diff --git a/src/components/views/dialogs/ShareDialog.js b/src/components/views/dialogs/ShareDialog.tsx similarity index 86% rename from src/components/views/dialogs/ShareDialog.js rename to src/components/views/dialogs/ShareDialog.tsx index ebd1f8d1eb..375cb65b5f 100644 --- a/src/components/views/dialogs/ShareDialog.js +++ b/src/components/views/dialogs/ShareDialog.tsx @@ -1,5 +1,6 @@ /* Copyright 2018 New Vector Ltd +Copyright 2020 The Matrix.org Foundation C.I.C. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. @@ -14,9 +15,13 @@ See the License for the specific language governing permissions and limitations under the License. */ -import React, {createRef} from 'react'; -import PropTypes from 'prop-types'; -import {Room, User, Group, RoomMember, MatrixEvent} from 'matrix-js-sdk'; +import * as React from 'react'; +import * as PropTypes from 'prop-types'; +import {Room} from "matrix-js-sdk/src/models/room"; +import {User} from "matrix-js-sdk/src/models/user"; +import {Group} from "matrix-js-sdk/src/models/group"; +import {RoomMember} from "matrix-js-sdk/src/models/room-member"; +import {MatrixEvent} from "matrix-js-sdk/src/models/event"; import * as sdk from '../../../index'; import { _t } from '../../../languageHandler'; import QRCode from 'qrcode-react'; @@ -53,7 +58,18 @@ const socials = [ }, ]; -export default class ShareDialog extends React.Component { +interface IProps { + onFinished: () => void; + target: Room | User | Group | RoomMember | MatrixEvent; + permalinkCreator: RoomPermalinkCreator; +} + +interface IState { + linkSpecificEvent: boolean; + permalinkCreator: RoomPermalinkCreator; +} + +export default class ShareDialog extends React.PureComponent { static propTypes = { onFinished: PropTypes.func.isRequired, target: PropTypes.oneOfType([ @@ -65,6 +81,8 @@ export default class ShareDialog extends React.Component { ]).isRequired, }; + protected closeCopiedTooltip: () => void; + constructor(props) { super(props); @@ -206,17 +224,18 @@ export default class ShareDialog extends React.Component {
- { - socials.map((social) => ( + {social.name} - ) - } + + )) }