Fix hostingSignupIFrame rendering in UserMenu after latest develop changes
parent
c818a719bf
commit
94fba82227
|
@ -17,7 +17,7 @@ limitations under the License.
|
||||||
import * as React from "react";
|
import * as React from "react";
|
||||||
import Modal from "../../Modal";
|
import Modal from "../../Modal";
|
||||||
import HostingSignupDialog from "../views/dialogs/HostingSignupDialog";
|
import HostingSignupDialog from "../views/dialogs/HostingSignupDialog";
|
||||||
import IconizedContextMenu, {
|
import {
|
||||||
IconizedContextMenuOption,
|
IconizedContextMenuOption,
|
||||||
IconizedContextMenuOptionList,
|
IconizedContextMenuOptionList,
|
||||||
} from "../views/context_menus/IconizedContextMenu";
|
} from "../views/context_menus/IconizedContextMenu";
|
||||||
|
|
|
@ -274,6 +274,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
||||||
|
|
||||||
let topSection;
|
let topSection;
|
||||||
const signupLink = getHostingLink("user-context-menu");
|
const signupLink = getHostingLink("user-context-menu");
|
||||||
|
const hostingSignupOptions = SdkConfig.get().hosting_signup;
|
||||||
if (MatrixClientPeg.get().isGuest()) {
|
if (MatrixClientPeg.get().isGuest()) {
|
||||||
topSection = (
|
topSection = (
|
||||||
<div className="mx_UserMenu_contextMenu_header mx_UserMenu_contextMenu_guestPrompts">
|
<div className="mx_UserMenu_contextMenu_header mx_UserMenu_contextMenu_guestPrompts">
|
||||||
|
@ -293,26 +294,7 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
||||||
})}
|
})}
|
||||||
</div>
|
</div>
|
||||||
)
|
)
|
||||||
} else if (signupLink) {
|
} else if (signupLink || hostingSignupOptions) {
|
||||||
topSection = (
|
|
||||||
<div className="mx_UserMenu_contextMenu_header mx_UserMenu_contextMenu_hostingLink">
|
|
||||||
{_t(
|
|
||||||
"<a>Upgrade</a> to your own domain", {},
|
|
||||||
{
|
|
||||||
a: sub => (
|
|
||||||
<a
|
|
||||||
href={signupLink}
|
|
||||||
target="_blank"
|
|
||||||
rel="noreferrer noopener"
|
|
||||||
tabIndex={-1}
|
|
||||||
>{sub}</a>
|
|
||||||
),
|
|
||||||
},
|
|
||||||
)}
|
|
||||||
</div>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
const hostingSignupOptions = SdkConfig.get().hosting_signup;
|
|
||||||
let hostingSignupIFrame;
|
let hostingSignupIFrame;
|
||||||
if (hostingSignupOptions && hostingSignupOptions.url) {
|
if (hostingSignupOptions && hostingSignupOptions.url) {
|
||||||
// If hosting_signup_domains is set to a non-empty array, only show
|
// If hosting_signup_domains is set to a non-empty array, only show
|
||||||
|
@ -329,6 +311,29 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
||||||
</div>;
|
</div>;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
topSection = (
|
||||||
|
<>
|
||||||
|
{signupLink &&
|
||||||
|
<div className="mx_UserMenu_contextMenu_header mx_UserMenu_contextMenu_hostingLink">
|
||||||
|
{_t(
|
||||||
|
"<a>Upgrade</a> to your own domain", {},
|
||||||
|
{
|
||||||
|
a: sub => (
|
||||||
|
<a
|
||||||
|
href={signupLink}
|
||||||
|
target="_blank"
|
||||||
|
rel="noreferrer noopener"
|
||||||
|
tabIndex={-1}
|
||||||
|
>{sub}</a>
|
||||||
|
),
|
||||||
|
},
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
}
|
||||||
|
{hostingSignupIFrame}
|
||||||
|
</>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
let homeButton = null;
|
let homeButton = null;
|
||||||
if (this.hasHomePage) {
|
if (this.hasHomePage) {
|
||||||
|
@ -513,7 +518,6 @@ export default class UserMenu extends React.Component<IProps, IState> {
|
||||||
</AccessibleTooltipButton>
|
</AccessibleTooltipButton>
|
||||||
</div>
|
</div>
|
||||||
{topSection}
|
{topSection}
|
||||||
{hostingSignupIFrame}
|
|
||||||
{primaryOptionList}
|
{primaryOptionList}
|
||||||
{secondarySection}
|
{secondarySection}
|
||||||
</IconizedContextMenu>;
|
</IconizedContextMenu>;
|
||||||
|
|
Loading…
Reference in New Issue