From 44182cbb574a24b7540e034c41d6afafdc19a28d Mon Sep 17 00:00:00 2001 From: Audrey Lambert Date: Tue, 7 Mar 2023 18:21:17 +0100 Subject: [PATCH] Add a help tab in menu to redirect to external tchap faq (#452) * Add a help tab in menu to redirect to external tchap faq * Remove useless code * Change to faq url https://www.tchap.gouv.fr/faq --- .../matrix-react-sdk+3.63.0.patch | 42 +++++++++++++++++++ patches/patches.json | 10 ++++- 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 patches/add-a-help-tab-in-menu-to-redirect-to-external-tchap-faq/matrix-react-sdk+3.63.0.patch diff --git a/patches/add-a-help-tab-in-menu-to-redirect-to-external-tchap-faq/matrix-react-sdk+3.63.0.patch b/patches/add-a-help-tab-in-menu-to-redirect-to-external-tchap-faq/matrix-react-sdk+3.63.0.patch new file mode 100644 index 0000000000..04d8b1e827 --- /dev/null +++ b/patches/add-a-help-tab-in-menu-to-redirect-to-external-tchap-faq/matrix-react-sdk+3.63.0.patch @@ -0,0 +1,42 @@ +diff --git a/node_modules/matrix-react-sdk/res/css/structures/_UserMenu.pcss b/node_modules/matrix-react-sdk/res/css/structures/_UserMenu.pcss +index 08ef894..4e33170 100644 +--- a/node_modules/matrix-react-sdk/res/css/structures/_UserMenu.pcss ++++ b/node_modules/matrix-react-sdk/res/css/structures/_UserMenu.pcss +@@ -206,6 +206,10 @@ limitations under the License. + mask-image: url("$(res)/img/element-icons/settings.svg"); + } + ++ .mx_UserMenu_iconInfo::before { ++ mask-image: url("$(res)/img/element-icons/info.svg"); ++ } ++ + .mx_UserMenu_iconMessage::before { + mask-image: url("$(res)/img/element-icons/feedback.svg"); + } +diff --git a/node_modules/matrix-react-sdk/src/components/structures/UserMenu.tsx b/node_modules/matrix-react-sdk/src/components/structures/UserMenu.tsx +index 5e6970f..9497bc8 100644 +--- a/node_modules/matrix-react-sdk/src/components/structures/UserMenu.tsx ++++ b/node_modules/matrix-react-sdk/src/components/structures/UserMenu.tsx +@@ -245,6 +245,10 @@ export default class UserMenu extends React.Component { + this.setState({ contextMenuPosition: null }); // also close the menu + }; + ++ private onOpenFAQPage = () => { ++ window.open("https://www.tchap.gouv.fr/faq", '_blank'); ++ }; ++ + private onProvideFeedback = (ev: ButtonEvent) => { + ev.preventDefault(); + ev.stopPropagation(); +@@ -370,6 +374,11 @@ export default class UserMenu extends React.Component { + onClick={(e) => this.onSettingsOpen(e, null)} + /> + {feedbackButton} ++ +