Add user avatar to location sharing dialog (#7520)
This commit is contained in:
@@ -15,8 +15,8 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
import React, { ReactElement } from 'react';
|
||||
import { Room } from "matrix-js-sdk/src/models/room";
|
||||
import classNames from 'classnames';
|
||||
import { RoomMember } from 'matrix-js-sdk/src/models/room-member';
|
||||
|
||||
import { _t } from '../../../languageHandler';
|
||||
import LocationPicker from './LocationPicker';
|
||||
@@ -24,14 +24,14 @@ import { CollapsibleButton, ICollapsibleButtonProps } from '../rooms/Collapsible
|
||||
import ContextMenu, { aboveLeftOf, useContextMenu, AboveLeftOf } from "../../structures/ContextMenu";
|
||||
|
||||
interface IProps extends Pick<ICollapsibleButtonProps, "narrowMode"> {
|
||||
room: Room;
|
||||
sender: RoomMember;
|
||||
shareLocation: (uri: string, ts: number) => boolean;
|
||||
menuPosition: AboveLeftOf;
|
||||
narrowMode: boolean;
|
||||
}
|
||||
|
||||
export const LocationButton: React.FC<IProps> = (
|
||||
{ shareLocation, menuPosition, narrowMode },
|
||||
{ sender, shareLocation, menuPosition, narrowMode },
|
||||
) => {
|
||||
const [menuDisplayed, button, openMenu, closeMenu] = useContextMenu();
|
||||
|
||||
@@ -45,7 +45,11 @@ export const LocationButton: React.FC<IProps> = (
|
||||
onFinished={closeMenu}
|
||||
managed={false}
|
||||
>
|
||||
<LocationPicker onChoose={shareLocation} onFinished={closeMenu} />
|
||||
<LocationPicker
|
||||
sender={sender}
|
||||
onChoose={shareLocation}
|
||||
onFinished={closeMenu}
|
||||
/>
|
||||
</ContextMenu>;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user