Fix UIFeature.Registration not applying to all paths (#10371)

This commit is contained in:
Michael Telatynski 2023-03-14 15:20:38 +00:00 committed by GitHub
parent 587da5b7dc
commit e0e83bd81d
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 39 additions and 31 deletions

View file

@ -289,7 +289,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
private renderContextMenu = (): React.ReactNode => {
if (!this.state.contextMenuPosition) return null;
let topSection;
let topSection: JSX.Element | undefined;
if (MatrixClientPeg.get().isGuest()) {
topSection = (
<div className="mx_UserMenu_contextMenu_header mx_UserMenu_contextMenu_guestPrompts">
@ -304,17 +304,19 @@ export default class UserMenu extends React.Component<IProps, IState> {
),
},
)}
{_t(
"New here? <a>Create an account</a>",
{},
{
a: (sub) => (
<AccessibleButton kind="link_inline" onClick={this.onRegisterClick}>
{sub}
</AccessibleButton>
),
},
)}
{SettingsStore.getValue(UIFeature.Registration)
? _t(
"New here? <a>Create an account</a>",
{},
{
a: (sub) => (
<AccessibleButton kind="link_inline" onClick={this.onRegisterClick}>
{sub}
</AccessibleButton>
),
},
)
: null}
</div>
);
}