Fix sending locations into threads and fix i18n (#7943)

This commit is contained in:
Michael Telatynski 2022-03-02 14:27:16 +00:00 committed by GitHub
parent 0f4125dfd5
commit 3c858a723b
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
7 changed files with 55 additions and 40 deletions

View file

@ -16,6 +16,7 @@ limitations under the License.
import React, { SyntheticEvent, useContext, useState } from 'react';
import { Room } from 'matrix-js-sdk/src/models/room';
import { IEventRelation } from 'matrix-js-sdk/src/models/event';
import MatrixClientContext from '../../../contexts/MatrixClientContext';
import ContextMenu, { AboveLeftOf } from '../../structures/ContextMenu';
@ -29,6 +30,7 @@ type Props = Omit<ILocationPickerProps, 'onChoose'> & {
menuPosition: AboveLeftOf;
openMenu: () => void;
roomId: Room["roomId"];
relation?: IEventRelation;
};
const getEnabledShareTypes = (): LocationShareType[] => {
@ -43,7 +45,12 @@ const getEnabledShareTypes = (): LocationShareType[] => {
};
const LocationShareMenu: React.FC<Props> = ({
menuPosition, onFinished, sender, roomId, openMenu,
menuPosition,
onFinished,
sender,
roomId,
openMenu,
relation,
}) => {
const matrixClient = useContext(MatrixClientContext);
const enabledShareTypes = getEnabledShareTypes();
@ -60,7 +67,7 @@ const LocationShareMenu: React.FC<Props> = ({
<div className="mx_LocationShareMenu">
{ shareType ? <LocationPicker
sender={sender}
onChoose={shareLocation(matrixClient, roomId, openMenu)}
onChoose={shareLocation(matrixClient, roomId, relation, openMenu)}
onFinished={onFinished}
/>
: