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

Remove the Description from the location picker #7485

Merged
merged 3 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion res/css/views/location/_LocationPicker.scss
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ limitations under the License.
}

#mx_LocationPicker_map {
height: 324px;
height: 366px;
border-radius: 8px 8px 0px 0px;
}

Expand Down
1 change: 0 additions & 1 deletion src/components/views/location/LocationButton.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@ interface IProps extends Pick<ICollapsibleButtonProps, "narrowMode"> {
uri: string,
ts: number,
type: LocationShareType,
description: string,
) => boolean;
menuPosition: AboveLeftOf;
narrowMode: boolean;
Expand Down
17 changes: 0 additions & 17 deletions src/components/views/location/LocationPicker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ import maplibregl from 'maplibre-gl';
import { logger } from "matrix-js-sdk/src/logger";

import SdkConfig from '../../../SdkConfig';
import Field from "../elements/Field";
import DialogButtons from "../elements/DialogButtons";
import Dropdown from "../elements/Dropdown";
import LocationShareType from "./LocationShareType";
Expand Down Expand Up @@ -91,13 +90,11 @@ interface IProps {
uri: string,
ts: number,
type: LocationShareType,
description: string,
): boolean;
onFinished(ev?: SyntheticEvent): void;
}

interface IState {
description: string;
type: LocationShareType;
position?: GeolocationPosition;
manualPosition?: GeolocationPosition;
Expand All @@ -114,7 +111,6 @@ class LocationPicker extends React.Component<IProps, IState> {
super(props);

this.state = {
description: _t("My location"),
type: LocationShareType.OnceOff,
position: undefined,
manualPosition: undefined,
Expand Down Expand Up @@ -209,10 +205,6 @@ class LocationPicker extends React.Component<IProps, IState> {
this.setState({ position });
};

private onDescriptionChange = (ev: React.ChangeEvent<HTMLInputElement>) => {
this.setState({ description: ev.target.value });
};

private onOk = () => {
const position = (this.state.type == LocationShareType.Custom) ?
this.state.manualPosition : this.state.position;
Expand All @@ -221,7 +213,6 @@ class LocationPicker extends React.Component<IProps, IState> {
position ? getGeoUri(position) : undefined,
position ? position.timestamp : undefined,
this.state.type,
this.state.description,
);
this.props.onFinished();
};
Expand Down Expand Up @@ -263,14 +254,6 @@ class LocationPicker extends React.Component<IProps, IState> {
width={400}
/>

<Field
label={_t('Description')}
onChange={this.onDescriptionChange}
value={this.state.description}
width={400}
className="mx_LocationPicker_description"
/>

<DialogButtons primaryButton={_t('Share')}
onPrimaryButtonClick={this.onOk}
onCancel={this.props.onFinished}
Expand Down
5 changes: 2 additions & 3 deletions src/components/views/rooms/MessageComposer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -457,14 +457,13 @@ export default class MessageComposer extends React.Component<IProps, IState> {
uri: string,
ts: number,
_type: LocationShareType,
description: string | null,
): boolean => {
if (!uri) return false;
try {
const text = textForLocation(uri, ts, description);
const text = textForLocation(uri, ts, null);
MatrixClientPeg.get().sendMessage(
this.props.room.roomId,
makeLocationContent(text, uri, ts, description),
makeLocationContent(text, uri, ts, null),
);
} catch (e) {
logger.error("Error sending location:", e);
Expand Down
1 change: 0 additions & 1 deletion src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -2129,7 +2129,6 @@
"Share location": "Share location",
"Share custom location": "Share custom location",
"Share my current location as a once off": "Share my current location as a once off",
"My location": "My location",
"Type of location share": "Type of location share",
"Failed to load group members": "Failed to load group members",
"Filter community members": "Filter community members",
Expand Down