Skip to content

Commit 967e78f

Browse files
committed
fix: interface changes after merge
1 parent d1bd9d1 commit 967e78f

File tree

7 files changed

+25
-25
lines changed

7 files changed

+25
-25
lines changed

web/src/layout/Header/navbar/Menu/Help.tsx

+1-4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import Bug from "svgs/icons/bug.svg";
88
import ETH from "svgs/icons/eth.svg";
99
import Faq from "svgs/menu-icons/help.svg";
1010
import Telegram from "svgs/socialmedia/telegram.svg";
11+
import { IHelp } from "..";
1112

1213
const Container = styled.div`
1314
display: flex;
@@ -96,10 +97,6 @@ const ITEMS = [
9697
},
9798
];
9899

99-
interface IHelp {
100-
toggleIsHelpOpen: () => void;
101-
}
102-
103100
const Help: React.FC<IHelp> = ({ toggleIsHelpOpen }) => {
104101
const containerRef = useRef(null);
105102
useFocusOutside(containerRef, () => {

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import { uploadSettingsToSupabase } from "utils/uploadSettingsToSupabase";
66
import FormContact from "./FormContact";
77
import messages from "../../../../../../../consts/eip712-messages";
88
import { EMAIL_REGEX, TELEGRAM_REGEX } from "../../../../../../../consts/index";
9-
import { ISettings } from "../../types";
9+
import { ISettings } from "../../../index";
1010

1111
const FormContainer = styled.form`
1212
position: relative;
@@ -27,7 +27,7 @@ const FormContactContainer = styled.div`
2727
margin-bottom: 24px;
2828
`;
2929

30-
const FormContactDetails: React.FC<ISettings> = ({ setIsSettingsOpen }) => {
30+
const FormContactDetails: React.FC<ISettings> = ({ toggleIsSettingsOpen }) => {
3131
const [telegramInput, setTelegramInput] = useState<string>("");
3232
const [emailInput, setEmailInput] = useState<string>("");
3333
const [telegramIsValid, setTelegramIsValid] = useState<boolean>(false);
@@ -58,7 +58,7 @@ const FormContactDetails: React.FC<ISettings> = ({ setIsSettingsOpen }) => {
5858
};
5959
const response = await uploadSettingsToSupabase(data);
6060
if (response.ok) {
61-
setIsSettingsOpen(false);
61+
toggleIsSettingsOpen();
6262
}
6363
};
6464
return (

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

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from "react";
22
import styled from "styled-components";
3-
import { ISettings } from "../types";
3+
import { ISettings } from "../../../index";
44

55
import FormContactDetails from "./FormContactDetails";
66
import { EnsureChain } from "components/EnsureChain";
@@ -33,13 +33,13 @@ const EnsureChainContainer = styled.div`
3333
padding-bottom: 16px;
3434
`;
3535

36-
const NotificationSettings: React.FC<ISettings> = ({ setIsSettingsOpen }) => {
36+
const NotificationSettings: React.FC<ISettings> = ({ toggleIsSettingsOpen }) => {
3737
return (
3838
<EnsureChainContainer>
3939
<EnsureChain>
4040
<Container>
4141
<HeaderNotifs />
42-
<FormContactDetails setIsSettingsOpen={setIsSettingsOpen} />
42+
<FormContactDetails toggleIsSettingsOpen={toggleIsSettingsOpen} />
4343
</Container>
4444
</EnsureChain>
4545
</EnsureChainContainer>

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import General from "./General";
66
import NotificationSettings from "./Notifications";
77
import { useFocusOutside } from "hooks/useFocusOutside";
88
import { Overlay } from "components/Overlay";
9-
import { ISettings } from "./types";
9+
import { ISettings } from "../../index";
1010

1111
const Container = styled.div`
1212
display: flex;
@@ -60,10 +60,10 @@ const TABS = [
6060
},
6161
];
6262

63-
const Settings: React.FC<ISettings> = ({ setIsSettingsOpen }) => {
63+
const Settings: React.FC<ISettings> = ({ toggleIsSettingsOpen }) => {
6464
const [currentTab, setCurrentTab] = useState<number>(0);
6565
const containerRef = useRef(null);
66-
useFocusOutside(containerRef, () => setIsSettingsOpen(false));
66+
useFocusOutside(containerRef, () => toggleIsSettingsOpen());
6767

6868
return (
6969
<>
@@ -77,7 +77,7 @@ const Settings: React.FC<ISettings> = ({ setIsSettingsOpen }) => {
7777
setCurrentTab(n);
7878
}}
7979
/>
80-
{currentTab === 0 ? <General /> : <NotificationSettings setIsSettingsOpen={setIsSettingsOpen} />}
80+
{currentTab === 0 ? <General /> : <NotificationSettings toggleIsSettingsOpen={toggleIsSettingsOpen} />}
8181
</Container>
8282
</>
8383
);

web/src/layout/Header/navbar/Menu/Settings/types.ts

-5
This file was deleted.

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

+2-6
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ import LightModeIcon from "svgs/menu-icons/light-mode.svg";
88
import NotificationsIcon from "svgs/menu-icons/notifications.svg";
99
import SettingsIcon from "svgs/menu-icons/settings.svg";
1010
import { useToggleTheme } from "hooks/useToggleThemeContext";
11+
import { IHelp, ISettings } from "..";
1112

1213
const Container = styled.div`
1314
display: flex;
@@ -52,12 +53,7 @@ const ButtonContainer = styled.div`
5253
)}
5354
`;
5455

55-
interface IMenu {
56-
toggleIsSettingsOpen: () => void;
57-
toggleIsHelpOpen: () => void;
58-
}
59-
60-
const Menu: React.FC<IMenu> = ({ toggleIsHelpOpen, toggleIsSettingsOpen }) => {
56+
const Menu: React.FC<ISettings & IHelp> = ({ toggleIsHelpOpen, toggleIsSettingsOpen }) => {
6157
const [theme, toggleTheme] = useToggleTheme();
6258
const isLightTheme = theme === "light";
6359

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

+12
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,18 @@ const DisconnectWalletButtonContainer = styled.div`
5353
align-items: center;
5454
`;
5555

56+
export interface ISettings {
57+
toggleIsSettingsOpen: () => void;
58+
}
59+
60+
export interface IHelp {
61+
toggleIsHelpOpen: () => void;
62+
}
63+
64+
export interface IDappList {
65+
toggleIsDappListOpen: () => void;
66+
}
67+
5668
const NavBar: React.FC = () => {
5769
const { isConnected } = useAccount();
5870
const [isDappListOpen, toggleIsDappListOpen] = useToggle(false);

0 commit comments

Comments
 (0)