Merge branch 'develop' into germain-gg/facepile-offset

This commit is contained in:
Germain
2023-09-22 08:46:37 +01:00
committed by GitHub
163 changed files with 15302 additions and 13240 deletions

View File

@@ -479,6 +479,7 @@ export default class ImageView extends React.Component<IProps, IState> {
fallbackUserId={mxEvent.getSender()}
size="32px"
viewUserOnClick={true}
className="mx_Dialog_nonDialogButton"
/>
);

View File

@@ -103,7 +103,7 @@ export const Pill: React.FC<PillProps> = ({ type: propType, url, inMessage, room
const classes = classNames("mx_Pill", {
mx_AtRoomPill: type === PillType.AtRoomMention,
mx_RoomPill: type === PillType.RoomMention,
mx_SpacePill: type === "space",
mx_SpacePill: type === "space" || targetRoom?.isSpaceRoom(),
mx_UserPill: type === PillType.UserMention,
mx_UserPill_me: resourceId === MatrixClientPeg.safeGet().getUserId(),
mx_EventPill: type === PillType.EventInOtherRoom || type === PillType.EventInSameRoom,

View File

@@ -63,8 +63,8 @@ const MAX_OPTION_LENGTH = 340;
function creatingInitialState(): IState {
return {
title: _t("Create poll"),
actionLabel: _t("Create Poll"),
title: _t("poll|create_poll_title"),
actionLabel: _t("poll|create_poll_action"),
canSubmit: false, // need to add a question and at least one option first
question: "",
options: arraySeed("", DEFAULT_NUM_OPTIONS),
@@ -79,7 +79,7 @@ function editingInitialState(editingMxEvent: MatrixEvent): IState {
if (!poll?.isEquivalentTo(M_POLL_START)) return creatingInitialState();
return {
title: _t("Edit poll"),
title: _t("poll|edit_poll_title"),
actionLabel: _t("action|done"),
canSubmit: true,
question: poll.question.text,
@@ -175,8 +175,8 @@ export default class PollCreateDialog extends ScrollableBaseModal<IProps, IState
.catch((e) => {
console.error("Failed to post poll:", e);
Modal.createDialog(QuestionDialog, {
title: _t("Failed to post poll"),
description: _t("Sorry, the poll you tried to create was not posted."),
title: _t("poll|failed_send_poll_title"),
description: _t("poll|failed_send_poll_description"),
button: _t("action|try_again"),
cancelButton: _t("action|cancel"),
onFinished: (tryAgain: boolean) => {
@@ -197,37 +197,37 @@ export default class PollCreateDialog extends ScrollableBaseModal<IProps, IState
protected renderContent(): React.ReactNode {
return (
<div className="mx_PollCreateDialog">
<h2>{_t("Poll type")}</h2>
<h2>{_t("poll|type_heading")}</h2>
<Field element="select" value={this.state.kind.name} onChange={this.onPollTypeChange}>
<option key={M_POLL_KIND_DISCLOSED.name} value={M_POLL_KIND_DISCLOSED.name}>
{_t("Open poll")}
{_t("poll|type_open")}
</option>
<option key={M_POLL_KIND_UNDISCLOSED.name} value={M_POLL_KIND_UNDISCLOSED.name}>
{_t("Closed poll")}
{_t("poll|type_closed")}
</option>
</Field>
<p>{pollTypeNotes(this.state.kind)}</p>
<h2>{_t("What is your poll question or topic?")}</h2>
<h2>{_t("poll|topic_heading")}</h2>
<Field
id="poll-topic-input"
value={this.state.question}
maxLength={MAX_QUESTION_LENGTH}
label={_t("Question or topic")}
placeholder={_t("Write something…")}
label={_t("poll|topic_label")}
placeholder={_t("poll|topic_placeholder")}
onChange={this.onQuestionChange}
usePlaceholderAsHint={true}
disabled={this.state.busy}
autoFocus={this.state.autoFocusTarget === FocusTarget.Topic}
/>
<h2>{_t("Create options")}</h2>
<h2>{_t("poll|options_heading")}</h2>
{this.state.options.map((op, i) => (
<div key={`option_${i}`} className="mx_PollCreateDialog_option">
<Field
id={`pollcreate_option_${i}`}
value={op}
maxLength={MAX_OPTION_LENGTH}
label={_t("Option %(number)s", { number: i + 1 })}
placeholder={_t("Write an option")}
label={_t("poll|options_label", { number: i + 1 })}
placeholder={_t("poll|options_placeholder")}
onChange={(e: ChangeEvent<HTMLInputElement>) => this.onOptionChange(i, e)}
usePlaceholderAsHint={true}
disabled={this.state.busy}
@@ -250,7 +250,7 @@ export default class PollCreateDialog extends ScrollableBaseModal<IProps, IState
className="mx_PollCreateDialog_addOption"
inputRef={this.addOptionRef}
>
{_t("Add option")}
{_t("poll|options_add_button")}
</AccessibleButton>
{this.state.busy && (
<div className="mx_PollCreateDialog_busy">
@@ -270,8 +270,8 @@ export default class PollCreateDialog extends ScrollableBaseModal<IProps, IState
function pollTypeNotes(kind: KnownPollKind): string {
if (M_POLL_KIND_DISCLOSED.matches(kind.name)) {
return _t("Voters see results as soon as they have voted");
return _t("poll|disclosed_notes");
} else {
return _t("Results are only revealed when you end the poll");
return _t("poll|notes");
}
}

View File

@@ -99,7 +99,7 @@ export default function RoomTopic({ room, ...props }: IProps): JSX.Element {
dis.dispatch({ action: "open_room_settings" });
}}
>
{_t("Edit topic")}
{_t("room|edit_topic")}
</AccessibleButton>
)}
</div>
@@ -119,7 +119,7 @@ export default function RoomTopic({ room, ...props }: IProps): JSX.Element {
onClick={onClick}
dir="auto"
tooltipTargetClassName={className}
label={_t("Click to read topic")}
label={_t("room|read_topic")}
alignment={Alignment.Bottom}
ignoreHover={ignoreHover}
>