Files
healthchat-web/apps/web/src/components/views/elements/LearnMore.tsx
T
Michael Telatynski 30f442208a Fix React hydration issues (#32958)
* Add more playwright axe tests to settings dialogs

* Add utility to jest setupTests to detect React hydration errors

* Iterate jest utility

* Fix axe issue heading-order

* Fix div-in-p issues

* Fix setupTests.ts

* Fix heading order

* Make types happier

* Fix hydration issues of thead containing text nodes

* Update tests

* Fix form-in-form React hydration issues

* Fix li-in-li React hydration issues

* Fix checked in form without onChange React hydration issue

* Fix styling bleeding from _common.pcss

* Update snapshots

* Fix more remaining issues

* Remove _common.pcss h2 rule altogether

* Fix test

* Update snapshots

* Iterate

* Iterate

* Update snapshots

* Simplify diff

* Test

* Update screenshots

* Update screenshot
2026-04-16 13:35:40 +00:00

45 lines
1.2 KiB
TypeScript

/*
Copyright 2024 New Vector Ltd.
Copyright 2022 The Matrix.org Foundation C.I.C.
SPDX-License-Identifier: AGPL-3.0-only OR GPL-3.0-only OR LicenseRef-Element-Commercial
Please see LICENSE files in the repository root for full details.
*/
import React from "react";
import { _t } from "../../../languageHandler";
import Modal from "../../../Modal";
import InfoDialog from "../dialogs/InfoDialog";
import AccessibleButton, { type ButtonProps } from "./AccessibleButton";
type Props = Omit<ButtonProps<"button">, "element" | "kind" | "onClick" | "className"> & {
title: string;
description: string | React.ReactNode;
};
const LearnMore: React.FC<Props> = ({ title, description, ...rest }) => {
const onClick = (): void => {
Modal.createDialog(InfoDialog, {
title,
description,
button: _t("action|got_it"),
hasCloseButton: true,
});
};
return (
<AccessibleButton
{...rest}
element="button"
kind="link_inline"
onClick={onClick}
className="mx_LearnMore_button"
>
{_t("action|learn_more")}
</AccessibleButton>
);
};
export default LearnMore;