Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33299870
D6489.1768769291.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
2 KB
Referenced Files
None
Subscribers
None
D6489.1768769291.diff
View Options
diff --git a/web/account/siwe-button.react.js b/web/account/siwe-button.react.js
new file mode 100644
--- /dev/null
+++ b/web/account/siwe-button.react.js
@@ -0,0 +1,36 @@
+// @flow
+
+import * as React from 'react';
+import { FaEthereum } from 'react-icons/fa';
+
+import Button from '../components/button.react';
+import css from './siwe.css';
+
+type SIWEButtonProps = {
+ +onSIWEButtonClick: () => void,
+};
+function SIWEButton(props: SIWEButtonProps): React.Node {
+ const { onSIWEButtonClick } = props;
+
+ const siweButtonColor = React.useMemo(
+ () => ({ backgroundColor: 'white', color: 'black' }),
+ [],
+ );
+
+ return (
+ <div className={css.siweContainer}>
+ <Button
+ onClick={onSIWEButtonClick}
+ variant="filled"
+ buttonColor={siweButtonColor}
+ >
+ <div className={css.ethereumLogoContainer}>
+ <FaEthereum />
+ </div>
+ Sign in with Ethereum
+ </Button>
+ </div>
+ );
+}
+
+export default SIWEButton;
diff --git a/web/account/siwe.react.js b/web/account/siwe.react.js
--- a/web/account/siwe.react.js
+++ b/web/account/siwe.react.js
@@ -6,7 +6,6 @@
import { ConnectButton, useConnectModal } from '@rainbow-me/rainbowkit';
import invariant from 'invariant';
import * as React from 'react';
-import { FaEthereum } from 'react-icons/fa';
import { useDispatch } from 'react-redux';
import { useAccount, useSigner } from 'wagmi';
@@ -33,6 +32,7 @@
import { setPrimaryIdentityPublicKey } from '../redux/primary-identity-public-key-reducer';
import { useSelector } from '../redux/redux-utils';
import { webLogInExtraInfoSelector } from '../selectors/account-selectors.js';
+import SIWEButton from './siwe-button.react.js';
import css from './siwe.css';
const getSIWENonceLoadingStatusSelector = createLoadingStatusSelector(
@@ -91,11 +91,6 @@
})();
}, [dispatch]);
- const siweButtonColor = React.useMemo(
- () => ({ backgroundColor: 'white', color: 'black' }),
- [],
- );
-
const callSIWEAuthEndpoint = React.useCallback(
(message: string, signature: string, extraInfo) =>
siweAuthCall({
@@ -165,20 +160,7 @@
let siweButton;
if (openConnectModal) {
- siweButton = (
- <>
- <Button
- onClick={onSIWEButtonClick}
- variant="filled"
- buttonColor={siweButtonColor}
- >
- <div className={css.ethereumLogoContainer}>
- <FaEthereum />
- </div>
- Sign in with Ethereum
- </Button>
- </>
- );
+ siweButton = <SIWEButton onSIWEButtonClick={onSIWEButtonClick} />;
}
return (
<div className={css.siweContainer}>
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sun, Jan 18, 8:48 PM (19 h, 43 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5953034
Default Alt Text
D6489.1768769291.diff (2 KB)
Attached To
Mode
D6489: [web] Pull `SIWEButton` out of `SIWE` component
Attached
Detach File
Event Timeline
Log In to Comment