From c7706ac3d54a4fa2de79f2e7f85a4e2fae8f3a22 Mon Sep 17 00:00:00 2001 From: Jason Robinson Date: Wed, 21 Oct 2020 15:22:35 +0300 Subject: [PATCH] Add possibility for hosting provider IFrame Add config option hosting_signup_iframe that will render an action in the UserMenu and ProfileSettings for setting up a host with some hosting provider that provides an HTML to do that. Add iframe for hosting provider signup content --- res/css/_components.scss | 1 + .../views/dialogs/_HostingProviderDialog.scss | 44 +++++++++++++++++++ .../structures/HostingProviderDialog.tsx | 33 ++++++++++++++ .../structures/HostingProviderTrigger.tsx | 39 ++++++++++++++++ src/components/structures/UserMenu.tsx | 12 +++++ .../views/settings/ProfileSettings.js | 9 ++++ 6 files changed, 138 insertions(+) create mode 100644 res/css/views/dialogs/_HostingProviderDialog.scss create mode 100644 src/components/structures/HostingProviderDialog.tsx create mode 100644 src/components/structures/HostingProviderTrigger.tsx diff --git a/res/css/_components.scss b/res/css/_components.scss index 445ed70ff4..a021a41be5 100644 --- a/res/css/_components.scss +++ b/res/css/_components.scss @@ -72,6 +72,7 @@ @import "./views/dialogs/_EditCommunityPrototypeDialog.scss"; @import "./views/dialogs/_FeedbackDialog.scss"; @import "./views/dialogs/_GroupAddressPicker.scss"; +@import "./views/dialogs/_HostingProviderDialog.scss"; @import "./views/dialogs/_IncomingSasDialog.scss"; @import "./views/dialogs/_InviteDialog.scss"; @import "./views/dialogs/_KeyboardShortcutsDialog.scss"; diff --git a/res/css/views/dialogs/_HostingProviderDialog.scss b/res/css/views/dialogs/_HostingProviderDialog.scss new file mode 100644 index 0000000000..0b0bdd4884 --- /dev/null +++ b/res/css/views/dialogs/_HostingProviderDialog.scss @@ -0,0 +1,44 @@ +/* +Copyright 2020 Element + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +.mx_HostingProviderDialog .mx_Dialog { + width: 60%; + height: 70%; + overflow: hidden; + padding: 0; + max-width: initial; + max-height: initial; + position: relative; +} + +.mx_HostingProviderDialog_container { + position: absolute; + top: 0; + bottom: 0; + left: 0; + right: 0; + + iframe { + width: 100%; + height: 100%; + border: none; + background-color: #fff; + } +} + +.mx_HostingProviderTrigger { + cursor: pointer; +} diff --git a/src/components/structures/HostingProviderDialog.tsx b/src/components/structures/HostingProviderDialog.tsx new file mode 100644 index 0000000000..0ee3d32b3f --- /dev/null +++ b/src/components/structures/HostingProviderDialog.tsx @@ -0,0 +1,33 @@ +/* +Copyright 2020 Element + +Licensed under the Apache License, Version 2.0 (the "License"); +you may not use this file except in compliance with the License. +You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + +Unless required by applicable law or agreed to in writing, software +distributed under the License is distributed on an "AS IS" BASIS, +WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +See the License for the specific language governing permissions and +limitations under the License. +*/ + +import * as React from "react"; +import SdkConfig from "../../SdkConfig"; + +interface IProps {} + +interface IState {} + +export default class HostingProviderDialog extends React.PureComponent { + public render(): React.ReactNode { + const hostingSignupUrl = SdkConfig.get().hosting_signup_iframe; + return ( +
+