Separate labs and betas more clearly (#8969)
* Separate labs and betas more clearly Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Fix tests Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Capitalize `L` in `Labs` Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Use `labsSections` instead of `SdkConfig.get("show_labs_settings")` Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Link to `betas.md` instead of `labs.md` Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Change labs label back to `Labs` Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Improve labs section copy Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Improve labs flags copy Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * i18n Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Fix cypress tests Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Reduce diff Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Remove empty line Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Fix comment Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Remove margin-bottom for the last child Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Improve code based on review Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Fix ts Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Improve ts Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Fix ts Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Improve code Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> * Improve TS Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com> Signed-off-by: Šimon Brandner <simon.bra.ag@gmail.com>
This commit is contained in:
parent
5cbb748843
commit
b0dfb2262e
8 changed files with 128 additions and 70 deletions
|
@ -80,12 +80,13 @@ export default class SettingsFlag extends React.Component<IProps, IState> {
|
|||
|
||||
if (!canChange && this.props.hideIfCannotSet) return null;
|
||||
|
||||
const label = this.props.label
|
||||
const label = (this.props.label
|
||||
? _t(this.props.label)
|
||||
: SettingsStore.getDisplayName(this.props.name, this.props.level);
|
||||
: SettingsStore.getDisplayName(this.props.name, this.props.level)) ?? undefined;
|
||||
const description = SettingsStore.getDescription(this.props.name);
|
||||
const shouldWarn = SettingsStore.shouldHaveWarning(this.props.name);
|
||||
|
||||
let disabledDescription: JSX.Element;
|
||||
let disabledDescription: JSX.Element | null = null;
|
||||
if (this.props.disabled && this.props.disabledDescription) {
|
||||
disabledDescription = <div className="mx_SettingsFlag_microcopy">
|
||||
{ this.props.disabledDescription }
|
||||
|
@ -106,7 +107,20 @@ export default class SettingsFlag extends React.Component<IProps, IState> {
|
|||
<label className="mx_SettingsFlag_label">
|
||||
<span className="mx_SettingsFlag_labelText">{ label }</span>
|
||||
{ description && <div className="mx_SettingsFlag_microcopy">
|
||||
{ description }
|
||||
{ shouldWarn
|
||||
? _t(
|
||||
"<w>WARNING:</w> <description/>", {},
|
||||
{
|
||||
"w": (sub) => (
|
||||
<span className="mx_SettingsTab_microcopy_warning">
|
||||
{ sub }
|
||||
</span>
|
||||
),
|
||||
"description": description,
|
||||
},
|
||||
)
|
||||
: description
|
||||
}
|
||||
</div> }
|
||||
{ disabledDescription }
|
||||
</label>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue