-
-
Notifications
You must be signed in to change notification settings - Fork 968
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(docs): act-1448 - added sentry plugin (#1408)
* feat(docs): act-1448 - added sentry plugin * feat(docs): act-1448 - fix client key * feat(docs): act-1448 - changed config settings * feat(docs): act-1448 - added user id as name for sentry * feat(docs): act-1448 - added user id * feat(docs): added mm sdk * feat(docs): fix for auth * feat(docs): fix for sentry config * feat(docs): disabled traces rates * feat(docs): removed console * fixed bug with input value for array children * removed console log --------- Co-authored-by: aednikanov <[email protected]>
- Loading branch information
1 parent
83276d0
commit 5638ccd
Showing
8 changed files
with
1,219 additions
and
108 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,60 +1,18 @@ | ||
import React from "react"; | ||
import Link from "@docusaurus/Link"; | ||
import styles from "./styles.module.css"; | ||
import global from "../global.module.css"; | ||
import { EIP6963ProviderDetail } from "@site/src/hooks/store.ts"; | ||
|
||
interface AuthBoxProps { | ||
metamaskProviders: any; | ||
handleConnect: (i) => void; | ||
selectedProvider?: number; | ||
handleConnect: () => void; | ||
} | ||
|
||
const MetamaskInstallMessage = () => ( | ||
<div className={styles.msgWrapper}> | ||
<strong className={styles.msgHeading}>Install MetaMask</strong> | ||
<p className={styles.msgText}> | ||
Install MetaMask for your browser to enable interactive features | ||
</p> | ||
<Link className={global.primaryBtn} href="https://metamask.io/download/"> | ||
Install MetaMask | ||
</Link> | ||
</div> | ||
); | ||
|
||
export const AuthBox = ({ | ||
metamaskProviders = [], | ||
selectedProvider, | ||
handleConnect, | ||
}: AuthBoxProps) => { | ||
if (metamaskProviders.length === 0) { | ||
return <MetamaskInstallMessage />; | ||
} | ||
|
||
if (metamaskProviders.length > 0) { | ||
return null; | ||
} | ||
|
||
export const AuthBox = ({ handleConnect }: AuthBoxProps) => { | ||
return ( | ||
<div className={styles.msgWrapper}> | ||
<p>Select a MetaMask provider to use interactive features:</p> | ||
<div className={styles.mmBtnRow}> | ||
{metamaskProviders.map((provider: EIP6963ProviderDetail, i) => ( | ||
<div key={provider.info.uuid} className={styles.mmBtnCol}> | ||
<button className={styles.mmBtn} onClick={() => handleConnect(i)}> | ||
<img | ||
src={provider.info.icon} | ||
alt={provider.info.name} | ||
width="30" | ||
/> | ||
<div className="padding-left--md">{provider.info.name}</div> | ||
{selectedProvider === i && ( | ||
<span className={styles.mmBtnCheck}>✓</span> | ||
)} | ||
</button> | ||
</div> | ||
))} | ||
</div> | ||
<p className={styles.msgText}>Connect MetaMask to test requests using your wallet</p> | ||
<button className={global.primaryBtn} onClick={() => handleConnect()}> | ||
Connect MetaMask | ||
</button> | ||
</div> | ||
); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React, { ReactChild } from "react"; | ||
import { MetaMaskProvider } from '@metamask/sdk-react'; | ||
import BrowserOnly from '@docusaurus/BrowserOnly'; | ||
|
||
export default function Root({ children }: { children: ReactChild}) { | ||
return ( | ||
<BrowserOnly fallback={<div>Loading...</div>}> | ||
{ | ||
() => { | ||
return ( | ||
<MetaMaskProvider debug={false} sdkOptions={{ | ||
logging:{ | ||
developerMode: false, | ||
}, | ||
checkInstallationImmediately: false, | ||
dappMetadata: { | ||
name: "New mm app", | ||
url: "https://docs.metamask.io/", | ||
}, | ||
preferDesktop: true | ||
}}> | ||
{children} | ||
</MetaMaskProvider> | ||
) | ||
} | ||
} | ||
</BrowserOnly> | ||
); | ||
} |
Oops, something went wrong.