Skip to content

Commit

Permalink
Add a help tab in menu to redirect to external tchap faq (#452)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
aulamber authored Mar 7, 2023
1 parent 0bc8e43 commit 44182cb
Show file tree
Hide file tree
Showing 2 changed files with 51 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -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<IProps, IState> {
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<IProps, IState> {
onClick={(e) => this.onSettingsOpen(e, null)}
/>
{feedbackButton}
+ <IconizedContextMenuOption
+ iconClassName="mx_UserMenu_iconInfo"
+ label={_t("Help")}
+ onClick={this.onOpenFAQPage}
+ />
<IconizedContextMenuOption
className="mx_IconizedContextMenu_option_red"
iconClassName="mx_UserMenu_iconSignOut"
10 changes: 9 additions & 1 deletion patches/patches.json
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@
"res/css/views/directory/_NetworkDropdown.pcss",
"src/components/views/directory/NetworkDropdown.tsx",
"src/i18n/strings/en_EN.json",
"/src/i18n/strings/fr.json"
"src/i18n/strings/fr.json"
]
},
"auto-accept-tac": {
Expand Down Expand Up @@ -194,5 +194,13 @@
"src/components/structures/MatrixChat.tsx",
"src/components/views/settings/DevicesPanel.tsx"
]
},
"add-a-help-tab-in-menu-to-redirect-to-external-tchap-faq": {
"github-issue" : "https://github.com/tchapgouv/tchap-web-v4/issues/395",
"package": "matrix-react-sdk",
"files": [
"src/components/structures/UserMenu.tsx",
"res/css/structures/_UserMenu.pcss"
]
}
}

0 comments on commit 44182cb

Please sign in to comment.