diff --git a/src/app/components/RenderMessageContent.tsx b/src/app/components/RenderMessageContent.tsx
index 936b21f79..ea54c8cdd 100644
--- a/src/app/components/RenderMessageContent.tsx
+++ b/src/app/components/RenderMessageContent.tsx
@@ -431,7 +431,8 @@ function RenderMessageContentInternal({
}
if (msgType === (MsgType.File as string)) return renderFile();
- if (msgType === (MsgType.Location as string)) return ;
+ if (msgType === (MsgType.Location as string))
+ return ;
if (msgType === 'm.bad.encrypted') return ;
// cute events
diff --git a/src/app/components/message/MsgTypeRenderers.tsx b/src/app/components/message/MsgTypeRenderers.tsx
index de102dcad..2f8193072 100644
--- a/src/app/components/message/MsgTypeRenderers.tsx
+++ b/src/app/components/message/MsgTypeRenderers.tsx
@@ -35,10 +35,10 @@ import { MessageTextBody } from './layout';
import { unwrapForwardedContent } from './modals/MessageForward';
import { LINKINPUTREGEX } from '$components/editor';
import { MATRIX_TO_BASE } from '$plugins/matrix-to';
+import { copyToClipboard } from '$utils/dom';
import { MapContainer, Marker, TileLayer } from 'react-leaflet';
import type { LatLngExpression } from 'leaflet';
import 'leaflet/dist/leaflet.css';
-import { copyToClipboard } from '$utils/dom';
export interface BundleContent extends IPreviewUrlResponse {
matched_url: string;
@@ -685,26 +685,28 @@ export function MLocation({ content, showMaps }: MLocationProps) {
rel="noreferrer noopener"
variant="Primary"
radii="Pill"
+ style={{ flexShrink: '0' }}
before={}
>
Open Location
{showMaps && (
-
-
+
+
-
- )}
+
+
+ )}
);
}
diff --git a/src/app/features/room/RoomInput.tsx b/src/app/features/room/RoomInput.tsx
index 02644cf7e..223b8c6fc 100644
--- a/src/app/features/room/RoomInput.tsx
+++ b/src/app/features/room/RoomInput.tsx
@@ -129,7 +129,7 @@ import {
convertPerMessageProfileToBeeperFormat,
getCurrentlyUsedPerMessageProfileForRoom,
} from '$hooks/usePerMessageProfile';
-import { Microphone, Stop } from '@phosphor-icons/react';
+import { Microphone, Stop, MapPinPlusIcon } from '@phosphor-icons/react';
import { getSupportedAudioExtension } from '$plugins/voice-recorder-kit/supportedCodec';
import { ErrorCode } from '../../cs-errorcode';
import { sanitizeText } from '$utils/sanitize';
@@ -160,6 +160,7 @@ import type {
import { AudioMessageRecorder } from './AudioMessageRecorder';
import * as prefix from '$unstable/prefixes';
import { PollDialog } from './poll-modals';
+import { LocationDialog } from './location-modal';
// Returns the event ID of the most recent non-reaction/non-edit event in a thread,
// falling back to the thread root if no replies exist yet.
@@ -389,6 +390,7 @@ export const RoomInput = forwardRef(
);
const [AddMenuAnchor, setAddMenuAnchor] = useState();
const [showPollPicker, setShowPollPicker] = useState(false);
+ const [showLocationPicker, setShowLocationPicker] = useState(false);
const [scheduleMenuAnchor, setScheduleMenuAnchor] = useState();
const [showSchedulePicker, setShowSchedulePicker] = useState(false);
const [silentReply, setSilentReply] = useState(!mentionInReplies);
@@ -822,16 +824,15 @@ export const RoomInput = forwardRef(
} else if (commandName === Command.UnFlip) {
plainText = `${UNFLIP} ${plainText}`;
customHtml = `${UNFLIP} ${customHtml}`;
- } else if (commandName === Command.Poll) {
- setShowPollPicker(true);
- resetEditor(editor);
- resetEditorHistory(editor);
- sendTypingStatus(false);
- return;
} else if (commandName) {
- const commandContent = commands[commandName as Command];
- if (commandContent) {
- commandContent.exe(plainText, customHtml);
+ if ((commandName as Command) === Command.Poll) setShowPollPicker(true);
+ else if ((commandName as Command) === Command.Location && plainText.trim().length === 0)
+ setShowLocationPicker(true);
+ else {
+ const commandContent = commands[commandName as Command];
+ if (commandContent) {
+ commandContent.exe(plainText, customHtml);
+ }
}
resetEditor(editor);
resetEditorHistory(editor);
@@ -1561,6 +1562,17 @@ export const RoomInput = forwardRef(
>
Create Poll
+