Fix settings header

This commit is contained in:
Florian Duros 2024-12-04 10:36:51 +01:00
parent b016cf59e9
commit 3ac8d2773d
No known key found for this signature in database
GPG key ID: A5BBB4041B493F15
4 changed files with 3 additions and 11 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 51 KiB

Before After
Before After

Binary file not shown.

Before

Width:  |  Height:  |  Size: 62 KiB

After

Width:  |  Height:  |  Size: 62 KiB

Before After
Before After

View file

@ -45,7 +45,7 @@ export const SettingsSubsection: React.FC<SettingsSubsectionProps> = ({
mx_SettingsSubsection_newUi: !legacy, mx_SettingsSubsection_newUi: !legacy,
})} })}
> >
{typeof heading === "string" ? <SettingsSubsectionHeading heading={heading} legacy={legacy} /> : <>{heading}</>} {typeof heading === "string" ? <SettingsSubsectionHeading heading={heading} /> : <>{heading}</>}
{!!description && ( {!!description && (
<div className="mx_SettingsSubsection_description"> <div className="mx_SettingsSubsection_description">
<SettingsSubsectionText>{description}</SettingsSubsectionText> <SettingsSubsectionText>{description}</SettingsSubsectionText>

View file

@ -12,21 +12,13 @@ import Heading from "../../typography/Heading";
export interface SettingsSubsectionHeadingProps extends HTMLAttributes<HTMLDivElement> { export interface SettingsSubsectionHeadingProps extends HTMLAttributes<HTMLDivElement> {
heading: string; heading: string;
legacy?: boolean;
children?: React.ReactNode; children?: React.ReactNode;
} }
export const SettingsSubsectionHeading: React.FC<SettingsSubsectionHeadingProps> = ({ export const SettingsSubsectionHeading: React.FC<SettingsSubsectionHeadingProps> = ({ heading, children, ...rest }) => {
heading,
legacy = true,
children,
...rest
}) => {
const size = legacy ? "4" : "3";
return ( return (
<div {...rest} className="mx_SettingsSubsectionHeading"> <div {...rest} className="mx_SettingsSubsectionHeading">
<Heading className="mx_SettingsSubsectionHeading_heading" size={size} as="h3"> <Heading className="mx_SettingsSubsectionHeading_heading" size="4" as="h3">
{heading} {heading}
</Heading> </Heading>
{children} {children}