Page Menu
Home
Phorge
Search
Configure Global Search
Log In
Files
F33311214
D6217.1768810384.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
D6217.1768810384.diff
View Options
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
@@ -1,7 +1,18 @@
// @flow
+import '@rainbow-me/rainbowkit/dist/index.css';
+
+import {
+ darkTheme,
+ getDefaultWallets,
+ RainbowKitProvider,
+} from '@rainbow-me/rainbowkit';
import invariant from 'invariant';
+import _merge from 'lodash/fp/merge';
import * as React from 'react';
+import { chain, configureChains, createClient, WagmiConfig } from 'wagmi';
+import { alchemyProvider } from 'wagmi/providers/alchemy';
+import { publicProvider } from 'wagmi/providers/public';
import { logInActionTypes, logIn } from 'lib/actions/user-actions';
import { useModalContext } from 'lib/components/modal-provider.react';
@@ -28,6 +39,26 @@
import css from './log-in-form.css';
import PasswordInput from './password-input.react';
+// details can be found https://0.6.x.wagmi.sh/docs/providers/configuring-chains
+const availableProviders = process.env.COMM_ALCHEMY_KEY
+ ? [alchemyProvider({ apiKey: process.env.COMM_ALCHEMY_KEY })]
+ : [publicProvider()];
+const { chains, provider } = configureChains(
+ [chain.mainnet],
+ availableProviders,
+);
+
+const { connectors } = getDefaultWallets({
+ appName: 'comm',
+ chains,
+});
+
+const wagmiClient = createClient({
+ autoConnect: true,
+ connectors,
+ provider,
+});
+
const loadingStatusSelector = createLoadingStatusSelector(logInActionTypes);
function LoginForm(): React.Node {
const inputDisabled = useSelector(loadingStatusSelector) === 'loading';
@@ -163,4 +194,25 @@
);
}
-export default LoginForm;
+function LoginFormWrapper(): React.Node {
+ const theme = React.useMemo(() => {
+ return _merge(darkTheme())({
+ radii: {
+ modal: 0,
+ modalMobile: 0,
+ },
+ colors: {
+ modalBackdrop: '#242529',
+ },
+ });
+ }, []);
+ return (
+ <WagmiConfig client={wagmiClient}>
+ <RainbowKitProvider chains={chains} theme={theme} modalSize="compact">
+ <LoginForm />
+ </RainbowKitProvider>
+ </WagmiConfig>
+ );
+}
+
+export default LoginFormWrapper;
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Mon, Jan 19, 8:13 AM (14 h, 17 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
5954613
Default Alt Text
D6217.1768810384.diff (2 KB)
Attached To
Mode
D6217: [web] Introduce `LoginFormWrapper` component
Attached
Detach File
Event Timeline
Log In to Comment