Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert "feat(docs): act-1481 - improvements to reference pages" #1449

Merged
merged 1 commit into from
Jul 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading