Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove christmas egg #885

Merged
merged 1 commit into from
Feb 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"
Loading