Skip to content

Commit

Permalink
Revert "feat(docs): act-1481 - improvements to reference pages (MetaM…
Browse files Browse the repository at this point in the history
…ask#1441)" (MetaMask#1449)

This reverts commit 48af6f8.
  • Loading branch information
Montoya authored Jul 24, 2024
1 parent 48af6f8 commit 7497537
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 28 deletions.
6 changes: 1 addition & 5 deletions src/components/ParserOpenRPC/AuthBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,7 @@ export const AuthBox = ({ handleConnect }: AuthBoxProps) => {
return (
<div className={styles.msgWrapper}>
<p className={styles.msgText}>Connect MetaMask to test requests using your wallet</p>
<button
className={global.primaryBtn}
onClick={() => handleConnect()}
data-test-id="connect-metamask"
>
<button className={global.primaryBtn} onClick={() => handleConnect()}>
Connect MetaMask
</button>
</div>
Expand Down
2 changes: 0 additions & 2 deletions src/components/ParserOpenRPC/RequestBox/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,6 @@ export default function RequestBox({
className={clsx(global.linkBtn, "margin-right--md")}
disabled={!isMetamaskInstalled}
onClick={openModal}
data-test-id="customize-request"
>
Customize request
</button>
Expand All @@ -60,7 +59,6 @@ export default function RequestBox({
className={global.primaryBtn}
disabled={!isMetamaskInstalled}
onClick={submitRequest}
data-test-id="run-request"
>
Run request
</button>
Expand Down
9 changes: 8 additions & 1 deletion src/components/ParserOpenRPC/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,14 @@ export default function ParserOpenRPC({ network, method }: ParserProps) {

if (currentMethodData === null) return null;

const { metaMaskProvider, metaMaskConnectHandler } = useContext(MetamaskProviderContext);
const { metaMaskProvider, metaMaskAccount, metaMaskConnectHandler } = useContext(MetamaskProviderContext);

useEffect(() => {
if ((window as any)?.Sentry) {
(window as any)?.Sentry?.setUser({ name: metaMaskAccount, id: metaMaskAccount, username: metaMaskAccount })
}
}, [metaMaskAccount]);


const onParamsChangeHandle = (data) => {
if (
Expand Down
3 changes: 1 addition & 2 deletions src/theme/Footer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,7 @@ export default function FooterWrapper(props) {
}, []);

const isBrowser = useIsBrowser();
const isProd = process.env.NODE_ENV === "production"
if (isBrowser && isProd) {
if (isBrowser) {
Intercom({
app_id: 'txttgas6'
});
Expand Down
19 changes: 1 addition & 18 deletions src/theme/Root.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import React, { useState, createContext, ReactChild, useEffect } from "react";
import React, { useState, createContext, ReactChild } from "react";
import { MetaMaskSDK } from "@metamask/sdk";

export const MetamaskProviderContext = createContext(null);
Expand All @@ -12,7 +12,6 @@ export default function Root({ children }: { children: ReactChild}) {
url: "https://docs.metamask.io/",
},
preferDesktop: true,
extensionOnly: true,
logging: {
sdk: false,
}
Expand All @@ -32,22 +31,6 @@ export default function Root({ children }: { children: ReactChild}) {
}
}

useEffect(() => {
if (sdk && sdk.extension) {
metaMaskConnectHandler();
}
}, []);

useEffect(() => {
const loggedUserName = metaMaskAccount ? "logged-in-user" : "anonymous-user";
if ((window as any)?.Sentry) {
(window as any)?.Sentry?.setUser({
name: loggedUserName,
username: loggedUserName
})
}
}, [metaMaskAccount]);

return (
<MetamaskProviderContext.Provider value={{
metaMaskProvider,
Expand Down

0 comments on commit 7497537

Please sign in to comment.