@@ -101,16 +101,25 @@ export const WPRainbowConnect = () => {
101
101
}
102
102
} , [ accountData , state . address , loading , hasLoadedSecondTime ] ) ;
103
103
104
+ const siteLoginText = (
105
+ < p
106
+ className = "wp-rainbow help-text"
107
+ style = { {
108
+ fontSize : "12px" ,
109
+ fontStyle : "italic" ,
110
+ marginBottom : "4px" ,
111
+ marginTop : "4px" ,
112
+ textAlign : "center" ,
113
+ } }
114
+ >
115
+ { __ ( "- OR USE SITE LOGIN -" , "wp-rainbow" ) }
116
+ </ p >
117
+ ) ;
118
+
104
119
return (
105
120
< >
106
121
< ConnectButton . Custom >
107
- { ( {
108
- account,
109
- chain,
110
- openAccountModal,
111
- openChainModal,
112
- openConnectModal,
113
- } ) => {
122
+ { ( { account, openAccountModal, openConnectModal } ) => {
114
123
if ( state . error ) {
115
124
return (
116
125
< React . Fragment >
@@ -122,33 +131,28 @@ export const WPRainbowConnect = () => {
122
131
>
123
132
{ __ ( "Log In Error, Click to Refresh" , "wp-rainbow" ) }
124
133
</ button >
125
- < p
126
- className = "wp-rainbow help-text"
127
- style = { {
128
- fontSize : "12px" ,
129
- fontStyle : "italic" ,
130
- marginBottom : "4px" ,
131
- marginTop : "4px" ,
132
- textAlign : "center" ,
133
- } }
134
- >
135
- { __ ( "- OR USE SITE LOGIN -" , "wp-rainbow" ) }
136
- </ p >
134
+ { siteLoginText }
137
135
</ React . Fragment >
138
136
) ;
139
137
}
140
138
if ( account ) {
141
139
return (
142
- < button
143
- className = "button button-secondary button-hero"
144
- onClick = { state . address ? openAccountModal : signIn }
145
- type = "button"
146
- style = { { width : "100%" } }
147
- >
148
- { state . address
149
- ? `${ __ ( "Logged In as " ) } ${ account . displayName } `
150
- : __ ( "Continue Log In with Ethereum" ) }
151
- </ button >
140
+ < React . Fragment >
141
+ < button
142
+ className = "button button-secondary button-hero"
143
+ onClick = { state . address ? openAccountModal : signIn }
144
+ type = "button"
145
+ disabled = { state . loading }
146
+ style = { { width : "100%" } }
147
+ >
148
+ { state . address
149
+ ? `${ __ ( "Logged In as " ) } ${ account . displayName } `
150
+ : state . loading
151
+ ? __ ( "Check Wallet to Sign Message" )
152
+ : __ ( "Continue Log In with Ethereum" ) }
153
+ </ button >
154
+ { siteLoginText }
155
+ </ React . Fragment >
152
156
) ;
153
157
}
154
158
return (
@@ -161,18 +165,7 @@ export const WPRainbowConnect = () => {
161
165
>
162
166
{ __ ( "Log In with Ethereum" , "wp-rainbow" ) }
163
167
</ button >
164
- < p
165
- className = "wp-rainbow help-text"
166
- style = { {
167
- fontSize : "12px" ,
168
- fontStyle : "italic" ,
169
- marginBottom : "4px" ,
170
- marginTop : "4px" ,
171
- textAlign : "center" ,
172
- } }
173
- >
174
- { __ ( "- OR USE SITE LOGIN -" , "wp-rainbow" ) }
175
- </ p >
168
+ { siteLoginText }
176
169
</ React . Fragment >
177
170
) ;
178
171
} }
0 commit comments