Skip to content
This repository was archived by the owner on Sep 11, 2024. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all 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/beta/_BetaCard.scss
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ limitations under the License.
display: inline-block;
vertical-align: text-bottom;

&.mx_BetaCard_betaPill_clickable {
&.mx_AccessibleButton {
cursor: pointer;
}
}
Expand Down
21 changes: 7 additions & 14 deletions src/components/views/beta/BetaCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,20 +15,19 @@ limitations under the License.
*/

import React, { ReactNode, useState } from "react";
import classNames from "classnames";
import { sleep } from "matrix-js-sdk/src/utils";

import { _t } from "../../../languageHandler";
import AccessibleButton from "../elements/AccessibleButton";
import SettingsStore from "../../../settings/SettingsStore";
import { SettingLevel } from "../../../settings/SettingLevel";
import TextWithTooltip from "../elements/TextWithTooltip";
import Modal from "../../../Modal";
import BetaFeedbackDialog from "../dialogs/BetaFeedbackDialog";
import SdkConfig from "../../../SdkConfig";
import SettingsFlag from "../elements/SettingsFlag";
import { useFeatureEnabled } from "../../../hooks/useSettings";
import InlineSpinner from "../elements/InlineSpinner";
import AccessibleTooltipButton from "../elements/AccessibleTooltipButton";

// XXX: Keep this around for re-use in future Betas

Expand All @@ -39,10 +38,9 @@ interface IProps {

export const BetaPill = ({ onClick }: { onClick?: () => void }) => {
if (onClick) {
return <TextWithTooltip
class={classNames("mx_BetaCard_betaPill", {
mx_BetaCard_betaPill_clickable: !!onClick,
})}
return <AccessibleTooltipButton
className="mx_BetaCard_betaPill"
title={_t("This is a beta feature. Click for more info")}
tooltip={<div>
<div className="mx_Tooltip_title">
{ _t("This is a beta feature") }
Expand All @@ -52,18 +50,13 @@ export const BetaPill = ({ onClick }: { onClick?: () => void }) => {
</div>
</div>}
onClick={onClick}
tooltipProps={{ yOffset: -10 }}
yOffset={-10}
>
{ _t("Beta") }
</TextWithTooltip>;
</AccessibleTooltipButton>;
}

return <span
className={classNames("mx_BetaCard_betaPill", {
mx_BetaCard_betaPill_clickable: !!onClick,
})}
onClick={onClick}
>
return <span className="mx_BetaCard_betaPill">
{ _t("Beta") }
</span>;
};
Expand Down
1 change: 1 addition & 0 deletions src/i18n/strings/en_EN.json
Original file line number Diff line number Diff line change
Expand Up @@ -2934,6 +2934,7 @@
"Revoke permissions": "Revoke permissions",
"Move left": "Move left",
"Move right": "Move right",
"This is a beta feature. Click for more info": "This is a beta feature. Click for more info",
"This is a beta feature": "This is a beta feature",
"Click for more info": "Click for more info",
"Beta": "Beta",
Expand Down