Skip to content

Commit

Permalink
Merge pull request #885 from tchapgouv/christmas-egg-bye-bye
Browse files Browse the repository at this point in the history
Remove christmas egg
  • Loading branch information
estellecomment authored Feb 5, 2024
2 parents 4770643 + e77f534 commit 2d455f1
Showing 1 changed file with 2 additions and 45 deletions.
47 changes: 2 additions & 45 deletions patches/user-menu/matrix-react-sdk+3.82.0.patch
Original file line number Diff line number Diff line change
Expand Up @@ -14,63 +14,21 @@ index f25c15e..3d37fa7 100644
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
<<<<<<<< HEAD:patches/user-menu/matrix-react-sdk+3.82.0.patch
index 2d82a5c..be5fa85 100644
========
index 12e80d7..701dc43 100644
>>>>>>>> develop_tchap:patches/user-menu/matrix-react-sdk+3.81.0.patch
--- a/node_modules/matrix-react-sdk/src/components/structures/UserMenu.tsx
+++ b/node_modules/matrix-react-sdk/src/components/structures/UserMenu.tsx
@@ -246,6 +246,28 @@ export default class UserMenu extends React.Component<IProps, IState> {
@@ -246,6 +246,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 onOpenChristmasEgg = (ev: ButtonEvent): void => {
+ ev.preventDefault();
+ ev.stopPropagation();
+
+ const roomId = "!cDKdQyXHeWBEaKDWWV:agent.dinum.tchap.gouv.fr";
+
+ defaultDispatcher.dispatch({
+ action: Action.ViewRoom,
+ show_room_tile: true, // make sure the room is visible in the list
+ room_id: roomId,
+ clear_search: true,
+ metricsTrigger: "RoomList",
+ metricsViaKeyboard: ev.type !== "click",
+ });
+
+ this.setState({ contextMenuPosition: null }); // also close the menu
+ };
+
private onProvideFeedback = (ev: ButtonEvent): void => {
ev.preventDefault();
ev.stopPropagation();
@@ -344,6 +366,19 @@ export default class UserMenu extends React.Component<IProps, IState> {
);
}

+ let christmasEggButton: JSX.Element | undefined;
+ let now = new Date().getTime();
+ let endDate = new Date("2024-10-01").getTime();
+
+ if (now < endDate) {
+ christmasEggButton = (
+ <IconizedContextMenuOption
+ label={"🎄 Joyeuses Fêtes 🎄"}
+ onClick={this.onOpenChristmasEgg}
+ />
+ );
+ }
+
let primaryOptionList = (
<IconizedContextMenuOptionList>
{homeButton}
@@ -363,6 +398,12 @@ export default class UserMenu extends React.Component<IProps, IState> {
@@ -363,6 +367,11 @@ export default class UserMenu extends React.Component<IProps, IState> {
onClick={(e) => this.onSettingsOpen(e)}
/>
{feedbackButton}
Expand All @@ -79,7 +37,6 @@ index 12e80d7..701dc43 100644
+ label={_t("common|help")}
+ onClick={this.onOpenFAQPage}
+ />
+ {christmasEggButton}
<IconizedContextMenuOption
className="mx_IconizedContextMenu_option_red"
iconClassName="mx_UserMenu_iconSignOut"

0 comments on commit 2d455f1

Please sign in to comment.