File tree 7 files changed +25
-25
lines changed
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";
8
8
import ETH from "svgs/icons/eth.svg" ;
9
9
import Faq from "svgs/menu-icons/help.svg" ;
10
10
import Telegram from "svgs/socialmedia/telegram.svg" ;
11
+ import { IHelp } from ".." ;
11
12
12
13
const Container = styled . div `
13
14
display: flex;
@@ -96,10 +97,6 @@ const ITEMS = [
96
97
} ,
97
98
] ;
98
99
99
- interface IHelp {
100
- toggleIsHelpOpen : ( ) => void ;
101
- }
102
-
103
100
const Help : React . FC < IHelp > = ( { toggleIsHelpOpen } ) => {
104
101
const containerRef = useRef ( null ) ;
105
102
useFocusOutside ( containerRef , ( ) => {
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import { uploadSettingsToSupabase } from "utils/uploadSettingsToSupabase";
6
6
import FormContact from "./FormContact" ;
7
7
import messages from "../../../../../../../consts/eip712-messages" ;
8
8
import { EMAIL_REGEX , TELEGRAM_REGEX } from "../../../../../../../consts/index" ;
9
- import { ISettings } from "../../types " ;
9
+ import { ISettings } from "../../../index " ;
10
10
11
11
const FormContainer = styled . form `
12
12
position: relative;
@@ -27,7 +27,7 @@ const FormContactContainer = styled.div`
27
27
margin-bottom: 24px;
28
28
` ;
29
29
30
- const FormContactDetails : React . FC < ISettings > = ( { setIsSettingsOpen } ) => {
30
+ const FormContactDetails : React . FC < ISettings > = ( { toggleIsSettingsOpen } ) => {
31
31
const [ telegramInput , setTelegramInput ] = useState < string > ( "" ) ;
32
32
const [ emailInput , setEmailInput ] = useState < string > ( "" ) ;
33
33
const [ telegramIsValid , setTelegramIsValid ] = useState < boolean > ( false ) ;
@@ -58,7 +58,7 @@ const FormContactDetails: React.FC<ISettings> = ({ setIsSettingsOpen }) => {
58
58
} ;
59
59
const response = await uploadSettingsToSupabase ( data ) ;
60
60
if ( response . ok ) {
61
- setIsSettingsOpen ( false ) ;
61
+ toggleIsSettingsOpen ( ) ;
62
62
}
63
63
} ;
64
64
return (
Original file line number Diff line number Diff line change 1
1
import React from "react" ;
2
2
import styled from "styled-components" ;
3
- import { ISettings } from "../types " ;
3
+ import { ISettings } from "../../../index " ;
4
4
5
5
import FormContactDetails from "./FormContactDetails" ;
6
6
import { EnsureChain } from "components/EnsureChain" ;
@@ -33,13 +33,13 @@ const EnsureChainContainer = styled.div`
33
33
padding-bottom: 16px;
34
34
` ;
35
35
36
- const NotificationSettings : React . FC < ISettings > = ( { setIsSettingsOpen } ) => {
36
+ const NotificationSettings : React . FC < ISettings > = ( { toggleIsSettingsOpen } ) => {
37
37
return (
38
38
< EnsureChainContainer >
39
39
< EnsureChain >
40
40
< Container >
41
41
< HeaderNotifs />
42
- < FormContactDetails setIsSettingsOpen = { setIsSettingsOpen } />
42
+ < FormContactDetails toggleIsSettingsOpen = { toggleIsSettingsOpen } />
43
43
</ Container >
44
44
</ EnsureChain >
45
45
</ EnsureChainContainer >
Original file line number Diff line number Diff line change @@ -6,7 +6,7 @@ import General from "./General";
6
6
import NotificationSettings from "./Notifications" ;
7
7
import { useFocusOutside } from "hooks/useFocusOutside" ;
8
8
import { Overlay } from "components/Overlay" ;
9
- import { ISettings } from "./types " ;
9
+ import { ISettings } from "../../index " ;
10
10
11
11
const Container = styled . div `
12
12
display: flex;
@@ -60,10 +60,10 @@ const TABS = [
60
60
} ,
61
61
] ;
62
62
63
- const Settings : React . FC < ISettings > = ( { setIsSettingsOpen } ) => {
63
+ const Settings : React . FC < ISettings > = ( { toggleIsSettingsOpen } ) => {
64
64
const [ currentTab , setCurrentTab ] = useState < number > ( 0 ) ;
65
65
const containerRef = useRef ( null ) ;
66
- useFocusOutside ( containerRef , ( ) => setIsSettingsOpen ( false ) ) ;
66
+ useFocusOutside ( containerRef , ( ) => toggleIsSettingsOpen ( ) ) ;
67
67
68
68
return (
69
69
< >
@@ -77,7 +77,7 @@ const Settings: React.FC<ISettings> = ({ setIsSettingsOpen }) => {
77
77
setCurrentTab ( n ) ;
78
78
} }
79
79
/>
80
- { currentTab === 0 ? < General /> : < NotificationSettings setIsSettingsOpen = { setIsSettingsOpen } /> }
80
+ { currentTab === 0 ? < General /> : < NotificationSettings toggleIsSettingsOpen = { toggleIsSettingsOpen } /> }
81
81
</ Container >
82
82
</ >
83
83
) ;
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";
8
8
import NotificationsIcon from "svgs/menu-icons/notifications.svg" ;
9
9
import SettingsIcon from "svgs/menu-icons/settings.svg" ;
10
10
import { useToggleTheme } from "hooks/useToggleThemeContext" ;
11
+ import { IHelp , ISettings } from ".." ;
11
12
12
13
const Container = styled . div `
13
14
display: flex;
@@ -52,12 +53,7 @@ const ButtonContainer = styled.div`
52
53
) }
53
54
` ;
54
55
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 } ) => {
61
57
const [ theme , toggleTheme ] = useToggleTheme ( ) ;
62
58
const isLightTheme = theme === "light" ;
63
59
Original file line number Diff line number Diff line change @@ -53,6 +53,18 @@ const DisconnectWalletButtonContainer = styled.div`
53
53
align-items: center;
54
54
` ;
55
55
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
+
56
68
const NavBar : React . FC = ( ) => {
57
69
const { isConnected } = useAccount ( ) ;
58
70
const [ isDappListOpen , toggleIsDappListOpen ] = useToggle ( false ) ;
You can’t perform that action at this time.
0 commit comments