Skip to content

Commit d71993d

Browse files
committed
chore(web): update-contact-support-link
1 parent 0fcef50 commit d71993d

File tree

4 files changed

+21
-11
lines changed

4 files changed

+21
-11
lines changed

web/src/layout/Header/DesktopHeader.tsx

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import React from "react";
1+
import React, { useCallback, useEffect, useState } from "react";
22
import styled, { css } from "styled-components";
33
import { landscapeStyle } from "styles/landscapeStyle";
44
import { useToggle } from "react-use";
@@ -89,8 +89,18 @@ const DesktopHeader = () => {
8989
const [isDappListOpen, toggleIsDappListOpen] = useToggle(false);
9090
const [isHelpOpen, toggleIsHelpOpen] = useToggle(false);
9191
const [isSettingsOpen, toggleIsSettingsOpen] = useToggle(false);
92+
const [initialTab, setInitialTab] = useState<number>(0);
9293
const { isConnected, chain } = useAccount();
9394
const isDefaultChain = chain?.id === DEFAULT_CHAIN;
95+
96+
const initializeFragmentURL = useCallback(() => {
97+
const hasNotificationsPath = location.hash.includes("#notifications");
98+
toggleIsSettingsOpen(hasNotificationsPath);
99+
setInitialTab(hasNotificationsPath ? 1 : 0);
100+
}, [toggleIsSettingsOpen, location.hash]);
101+
102+
useEffect(initializeFragmentURL, [initializeFragmentURL]);
103+
94104
useLockOverlayScroll(isDappListOpen || isHelpOpen || isSettingsOpen);
95105

96106
return (
@@ -129,7 +139,7 @@ const DesktopHeader = () => {
129139
<PopupContainer>
130140
{isDappListOpen && <DappList {...{ toggleIsDappListOpen, isDappListOpen }} />}
131141
{isHelpOpen && <Help {...{ toggleIsHelpOpen, isHelpOpen }} />}
132-
{isSettingsOpen && <Settings {...{ toggleIsSettingsOpen, isSettingsOpen }} />}
142+
{isSettingsOpen && <Settings {...{ toggleIsSettingsOpen, isSettingsOpen, initialTab }} />}
133143
</PopupContainer>
134144
)}
135145
</>

web/src/layout/Header/navbar/Menu/Settings/index.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,8 +66,8 @@ const TABS = [
6666
},
6767
];
6868

69-
const Settings: React.FC<ISettings> = ({ toggleIsSettingsOpen }) => {
70-
const [currentTab, setCurrentTab] = useState<number>(0);
69+
const Settings: React.FC<ISettings> = ({ toggleIsSettingsOpen, initialTab }) => {
70+
const [currentTab, setCurrentTab] = useState<number>(initialTab || 0);
7171
const containerRef = useRef(null);
7272
const location = useLocation();
7373
const navigate = useNavigate();

web/src/layout/Header/navbar/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import DappList from "./DappList";
88
import Explore from "./Explore";
99
import ConnectWallet from "components/ConnectWallet";
1010
import LightButton from "components/LightButton";
11-
import { Overlay } from "components/Overlay";
1211
import KlerosSolutionsIcon from "svgs/menu-icons/kleros-solutions.svg";
1312
import Menu from "./Menu";
1413
import Help from "./Menu/Help";
@@ -54,6 +53,7 @@ const DisconnectWalletButtonContainer = styled.div`
5453

5554
export interface ISettings {
5655
toggleIsSettingsOpen: () => void;
56+
initialTab?: number;
5757
}
5858

5959
export interface IHelp {

web/src/pages/Settings/EmailConfirmation/index.tsx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import React, { useEffect, useMemo, useState } from "react";
22
import styled, { css } from "styled-components";
33

4-
import { useNavigate, useSearchParams } from "react-router-dom";
4+
import { Link, useSearchParams } from "react-router-dom";
55
import { isAddress } from "viem";
66

77
import { Button } from "@kleros/ui-components-library";
@@ -96,15 +96,15 @@ const messageConfigs = {
9696
headerMsg: "Invalid Link!",
9797
subtitleMsg: "Oops, seems like you followed an invalid link.",
9898
buttonMsg: "Contact Support",
99-
buttonTo: "/",
99+
buttonTo: "https://t.me/kleros",
100100
Icon: InvalidIcon,
101101
color: "primaryText",
102102
},
103103
error: {
104104
headerMsg: "Something went wrong",
105105
subtitleMsg: "Oops, seems like something went wrong in our systems",
106106
buttonMsg: "Contact Support",
107-
buttonTo: "/",
107+
buttonTo: "https://t.me/kleros",
108108
Icon: WarningIcon,
109109
color: "error",
110110
},
@@ -139,8 +139,6 @@ const EmailConfirmation: React.FC = () => {
139139
const address = searchParams.get("address");
140140
const token = searchParams.get("token");
141141

142-
const navigate = useNavigate();
143-
144142
useEffect(() => {
145143
if (address && isAddress(address) && token) {
146144
setIsConfirming(true);
@@ -174,7 +172,9 @@ const EmailConfirmation: React.FC = () => {
174172
</HeaderIconContainer>
175173
<Header fontColor={color}>{headerMsg}</Header>
176174
<Subtitle>{subtitleMsg}</Subtitle>
177-
<Button text={buttonMsg} onClick={() => navigate(buttonTo)} />
175+
<Link to={buttonTo}>
176+
<Button text={buttonMsg} />
177+
</Link>
178178
</InfoWrapper>
179179
<IconContainer>
180180
<Icon />

0 commit comments

Comments
 (0)