Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3251817
D6221.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Referenced Files
None
Subscribers
None
D6221.diff
View Options
diff --git a/web/account/log-in-form.css b/web/account/log-in-form.css
--- a/web/account/log-in-form.css
+++ b/web/account/log-in-form.css
@@ -65,3 +65,10 @@
content: 'or';
background-color: #1f1f1fff;
}
+
+div.connectButtonContainer {
+ width: 100%;
+ display: flex;
+ justify-content: center;
+ align-content: center;
+}
diff --git a/web/account/log-in-form.react.js b/web/account/log-in-form.react.js
--- a/web/account/log-in-form.react.js
+++ b/web/account/log-in-form.react.js
@@ -3,15 +3,23 @@
import '@rainbow-me/rainbowkit/dist/index.css';
import {
+ ConnectButton,
darkTheme,
getDefaultWallets,
RainbowKitProvider,
+ useConnectModal,
} from '@rainbow-me/rainbowkit';
import invariant from 'invariant';
import _merge from 'lodash/fp/merge';
import * as React from 'react';
import { FaEthereum } from 'react-icons/fa';
-import { chain, configureChains, createClient, WagmiConfig } from 'wagmi';
+import {
+ chain,
+ configureChains,
+ createClient,
+ WagmiConfig,
+ useSigner,
+} from 'wagmi';
import { alchemyProvider } from 'wagmi/providers/alchemy';
import { publicProvider } from 'wagmi/providers/public';
@@ -63,6 +71,8 @@
const loadingStatusSelector = createLoadingStatusSelector(logInActionTypes);
function LoginForm(): React.Node {
+ const { openConnectModal } = useConnectModal();
+ const { data: signer } = useSigner();
const inputDisabled = useSelector(loadingStatusSelector) === 'loading';
const loginExtraInfo = useSelector(webLogInExtraInfoSelector);
const callLogIn = useServerCall(logIn);
@@ -158,13 +168,30 @@
[],
);
- let siweButton;
+ let siweSeparator;
if (isDev) {
+ siweSeparator = <hr />;
+ }
+
+ let siweConnectButton;
+ if (isDev && signer) {
+ siweConnectButton = (
+ <div className={css.connectButtonContainer}>
+ <ConnectButton />
+ </div>
+ );
+ }
+
+ const onSIWEButtonClick = React.useCallback(() => {
+ openConnectModal && openConnectModal();
+ }, [openConnectModal]);
+
+ let siweButton;
+ if (isDev && openConnectModal) {
siweButton = (
<>
- <hr />
<Button
- onClick={undefined}
+ onClick={onSIWEButtonClick}
variant="filled"
buttonColor={siweButtonColor}
>
@@ -213,6 +240,8 @@
>
{loginButtonContent}
</Button>
+ {siweSeparator}
+ {siweConnectButton}
{siweButton}
<div className={css.modal_form_error}>{errorMessage}</div>
</div>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 16, 5:56 PM (20 h, 12 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2499830
Default Alt Text
D6221.diff (2 KB)
Attached To
Mode
D6221: [web] Display `ConnectButton` after `ConnectModal` flow completes successfully
Attached
Detach File
Event Timeline
Log In to Comment