File tree Expand file tree Collapse file tree 7 files changed +25
-25
lines changed
Expand file tree Collapse file tree 7 files changed +25
-25
lines changed Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import Bug from "svgs/icons/bug.svg";
88import ETH from "svgs/icons/eth.svg" ;
99import Faq from "svgs/menu-icons/help.svg" ;
1010import Telegram from "svgs/socialmedia/telegram.svg" ;
11+ import { IHelp } from ".." ;
1112
1213const Container = styled . div `
1314 display: flex;
@@ -96,10 +97,6 @@ const ITEMS = [
9697 } ,
9798] ;
9899
99- interface IHelp {
100- toggleIsHelpOpen : ( ) => void ;
101- }
102-
103100const Help : React . FC < IHelp > = ( { toggleIsHelpOpen } ) => {
104101 const containerRef = useRef ( null ) ;
105102 useFocusOutside ( containerRef , ( ) => {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { uploadSettingsToSupabase } from "utils/uploadSettingsToSupabase";
66import FormContact from "./FormContact" ;
77import messages from "../../../../../../../consts/eip712-messages" ;
88import { EMAIL_REGEX , TELEGRAM_REGEX } from "../../../../../../../consts/index" ;
9- import { ISettings } from "../../types " ;
9+ import { ISettings } from "../../../index " ;
1010
1111const 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 (
Original file line number Diff line number Diff line change 11import React from "react" ;
22import styled from "styled-components" ;
3- import { ISettings } from "../types " ;
3+ import { ISettings } from "../../../index " ;
44
55import FormContactDetails from "./FormContactDetails" ;
66import { 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 >
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import General from "./General";
66import NotificationSettings from "./Notifications" ;
77import { useFocusOutside } from "hooks/useFocusOutside" ;
88import { Overlay } from "components/Overlay" ;
9- import { ISettings } from "./types " ;
9+ import { ISettings } from "../../index " ;
1010
1111const 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 ) ;
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import LightModeIcon from "svgs/menu-icons/light-mode.svg";
88import NotificationsIcon from "svgs/menu-icons/notifications.svg" ;
99import SettingsIcon from "svgs/menu-icons/settings.svg" ;
1010import { useToggleTheme } from "hooks/useToggleThemeContext" ;
11+ import { IHelp , ISettings } from ".." ;
1112
1213const 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
Original file line number Diff line number Diff 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+
5668const NavBar : React . FC = ( ) => {
5769 const { isConnected } = useAccount ( ) ;
5870 const [ isDappListOpen , toggleIsDappListOpen ] = useToggle ( false ) ;
You can’t perform that action at this time.
0 commit comments