Skip to content

Commit cb94788

Browse files
authored
Merge pull request #748 from Web3Auth/feat/add-post-comments-into-guides
Feat/Add post comments to guides
2 parents 0f01cc0 + ef55759 commit cb94788

7 files changed

Lines changed: 72 additions & 28 deletions

File tree

docs/sdk/pnp/flutter/usage.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -635,11 +635,11 @@ method currently supports only the signing methods.
635635

636636
### Arguments
637637

638-
| Arguments | Description |
639-
| --------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
640-
| `chainConfig` | Defines the chain to be used for signature. |
641-
| `method` | JSON RPC method name in `String`. Currently, the request method only supports the singing methods. |
642-
| `requestParams` | Parameters for the corresponding method. The parameters should be in the list and correct sequence. Take a look at [RPC methods](<[https://docs.metamask.io/wallet/reference/json-rpc-api/](https://docs.metamask.io/wallet/reference/json-rpc-api/)>) to know more. |
638+
| Arguments | Description |
639+
| --------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
640+
| `chainConfig` | Defines the chain to be used for signature. |
641+
| `method` | JSON RPC method name in `String`. Currently, the request method only supports the singing methods. |
642+
| `requestParams` | Parameters for the corresponding method. The parameters should be in the list and correct sequence. Take a look at [RPC methods](https://docs.metamask.io/wallet/reference/json-rpc-api) to know more. |
643643

644644
### Usage
645645

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,29 @@
11
import { useEffect } from "react";
22

33
export default function DiscourseComment(props) {
4+
// Get the current page URL
5+
// const url = window.location.href;
46
// eslint-disable-next-line react/prop-types
5-
const { topicId } = props;
7+
// const { topicId } = props;
68
useEffect(() => {
79
window.DiscourseEmbed = {
810
discourseUrl: "https://web3auth.io/community/",
9-
topicId,
11+
discourseEmbedUrl: `${window.location.href}`,
1012
};
1113

1214
const d = document.createElement("script");
1315
d.type = "text/javascript";
1416
d.async = true;
1517
d.src = `${window.DiscourseEmbed.discourseUrl}javascripts/embed.js`;
16-
(document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]).appendChild(d);
18+
(
19+
document.getElementsByTagName("head")[0] || document.getElementsByTagName("body")[0]
20+
).appendChild(d);
1721
}, []);
1822

19-
return <div id="discourse-comments" />;
23+
return (
24+
<>
25+
<meta name="discourse-username" content="shahbaz"></meta>
26+
<div id="discourse-comments" />
27+
</>
28+
);
2029
}

src/pages/guides/flutter-wallet.mdx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,9 @@ Flutter. The wallet will support the Ethereum and Solana ecosystem.
2626
As an overview, the app is quite simple, with functionality to log in, display user details, and
2727
perform blockchain interactions. The signing of the blockchain transactions is done through the
2828
Web3Auth embedded wallet. You can check out the infrastructure docs,
29-
["Web3Auth Wallet Management Infrastructure"](/docs/infrastructure/infrastructure) for a high-level
30-
overview of the Web3Auth architecture and implementation. For those who want to skip straight to the
31-
code, you can find it on
29+
["Web3Auth Wallet Management Infrastructure"](/docs/infrastructure) for a high-level overview of the
30+
Web3Auth architecture and implementation. For those who want to skip straight to the code, you can
31+
find it on
3232
[GitHub](https://github.com/Web3Auth/web3auth-pnp-examples/tree/main/flutter/flutter-playground).
3333

3434
Here are few screenshots of the application.
@@ -290,7 +290,7 @@ and `SolanaProvider`. If you wish to support any additional ecosystem, you can e
290290
`ChainProvider` and implement the methods.
291291

292292
If you want to learn, how you can integrate different blockchain with Web3Auth, you can checkout our
293-
[Connect Blockchain resources](docs/connect-blockchain).
293+
[Connect Blockchain resources](/docs/connect-blockchain/).
294294

295295
```dart
296296
abstract class ChainProvider {

src/pages/guides/sfa-android-firebase.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Android application.
2828
As an overview, the guide is quite simple, with functionality to log in, display user details, and
2929
perform blockchain interactions. The signing of the blockchain transactions is done through the
3030
Web3Auth embedded wallet. You can check out the infrastructure docs,
31-
["Web3Auth Wallet Management Infrastructure"](/docs/infrastructure/infrastructure) for a high-level
32-
overview of the Web3Auth architecture and implementation. For those who want to skip straight to the
33-
code, you can find it on
31+
["Web3Auth Wallet Management Infrastructure"](/docs/infrastructure) for a high-level overview of the
32+
Web3Auth architecture and implementation. For those who want to skip straight to the code, you can
33+
find it on
3434
[GitHub](https://github.com/Web3Auth/web3auth-core-kit-examples/tree/main/single-factor-auth-android/sfa-android-quick-start).
3535

3636
## How to set up Web3Auth Dashboard

src/pages/guides/sfa-flutter-firebase.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ Flutter application.
2828
As an overview, the guide is quite simple, with functionality to log in, display user details, and
2929
perform blockchain interactions. The signing of the blockchain transactions is done through the
3030
Web3Auth embedded wallet. You can check out the infrastructure docs,
31-
["Web3Auth Wallet Management Infrastructure"](/docs/infrastructure/infrastructure) for a high-level
32-
overview of the Web3Auth architecture and implementation. For those who want to skip straight to the
33-
code, you can find it on
31+
["Web3Auth Wallet Management Infrastructure"](/docs/infrastructure) for a high-level overview of the
32+
Web3Auth architecture and implementation. For those who want to skip straight to the code, you can
33+
find it on
3434
[GitHub](https://github.com/Web3Auth/web3auth-core-kit-examples/tree/main/single-factor-auth-flutter/sfa-flutter-quick-start).
3535

3636
## How to set up Web3Auth Dashboard

src/pages/guides/sfa-ios-firebase.mdx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ application.
2828
As an overview, the guide is quite simple, with functionality to log in, display user details, and
2929
perform blockchain interactions. The signing of the blockchain transactions is done through the
3030
Web3Auth embedded wallet. You can check out the infrastructure docs,
31-
["Web3Auth Wallet Management Infrastructure"](/docs/infrastructure/infrastructure) for a high-level
32-
overview of the Web3Auth architecture and implementation. For those who want to skip straight to the
33-
code, you can find it on
31+
["Web3Auth Wallet Management Infrastructure"](/docs/infrastructure) for a high-level overview of the
32+
Web3Auth architecture and implementation. For those who want to skip straight to the code, you can
33+
find it on
3434
[GitHub](https://github.com/Web3Auth/web3auth-core-kit-examples/tree/main/single-factor-auth-ios/sfa-ios-quick-start).
3535

3636
## How to set up Web3Auth Dashboard

src/theme/MDXPage/index.tsx

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import * as React from "react";
12
import BrowserOnly from "@docusaurus/BrowserOnly";
23
import Link from "@docusaurus/Link";
34
import { MDXProvider } from "@mdx-js/react";
@@ -26,7 +27,17 @@ export default function MDXPage(props: ComponentProps<typeof OriginalMDXPage>) {
2627
// return <OriginalMDXPage {...props} />;
2728
// }
2829

29-
const { title, image, description, type, tags, author, date, wrapperClassName, communityPortalTopicId } = frontMatter;
30+
const {
31+
title,
32+
image,
33+
description,
34+
type,
35+
tags,
36+
author,
37+
date,
38+
wrapperClassName,
39+
communityPortalTopicId,
40+
} = frontMatter;
3041
const url = `https://web3auth.io${permalink}`;
3142
const facebookLink = `https://www.facebook.com/sharer/sharer.php?${url}`;
3243
const twitterLink = `http://twitter.com/share?text=Checkout ${title} published by @Web3Auth&url=${url}`;
@@ -77,7 +88,13 @@ export default function MDXPage(props: ComponentProps<typeof OriginalMDXPage>) {
7788
<div className={styles.socialButtonContainer}>
7889
<Link to={facebookLink}>
7990
<button type="button" className={styles.socialButton}>
80-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
91+
<svg
92+
width="16"
93+
height="16"
94+
viewBox="0 0 16 16"
95+
fill="none"
96+
xmlns="http://www.w3.org/2000/svg"
97+
>
8198
<g clipPath="url(#clip0_1_9)">
8299
<path
83100
d="M16 8C16 3.58172 12.4183 0 8 0C3.58172 0 0 3.58172 0 8C0 11.993 2.92547 15.3027 6.75 15.9028V10.3125H4.71875V8H6.75V6.2375C6.75 4.2325 7.94438 3.125 9.77172 3.125C10.6467 3.125 11.5625 3.28125 11.5625 3.28125V5.25H10.5538C9.56 5.25 9.25 5.86672 9.25 6.5V8H11.4688L11.1141 10.3125H9.25V15.9028C13.0745 15.3027 16 11.993 16 8Z"
@@ -95,7 +112,13 @@ export default function MDXPage(props: ComponentProps<typeof OriginalMDXPage>) {
95112
</Link>
96113
<Link to={twitterLink}>
97114
<button type="button" className={styles.socialButton}>
98-
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
115+
<svg
116+
width="16"
117+
height="16"
118+
viewBox="0 0 16 16"
119+
fill="none"
120+
xmlns="http://www.w3.org/2000/svg"
121+
>
99122
<path
100123
d="M5.03168 14.5003C11.0694 14.5003 14.3718 9.4981 14.3718 5.16018C14.3718 5.0181 14.3718 4.87666 14.3622 4.73586C15.0047 4.27117 15.5593 3.69579 16 3.03666C15.4009 3.30227 14.7654 3.47637 14.1146 3.55314C14.7999 3.14294 15.3128 2.49767 15.5578 1.73746C14.9134 2.11987 14.2084 2.38935 13.4733 2.53426C12.9783 2.00798 12.3237 1.65949 11.6108 1.54272C10.8978 1.42595 10.1663 1.54741 9.52931 1.8883C8.89234 2.22919 8.38548 2.77051 8.08716 3.4285C7.78884 4.08648 7.71569 4.82444 7.87904 5.52818C6.57393 5.46272 5.29717 5.12354 4.13164 4.53267C2.9661 3.9418 1.93784 3.11244 1.1136 2.09842C0.693819 2.82109 0.565248 3.67658 0.754066 4.49071C0.942885 5.30484 1.43489 6.01639 2.12992 6.4805C1.60749 6.4652 1.09643 6.32426 0.64 6.06962V6.11122C0.640207 6.86912 0.902567 7.60362 1.38258 8.19014C1.86259 8.77665 2.53071 9.17907 3.2736 9.32914C2.79032 9.46097 2.28325 9.48024 1.79136 9.38546C2.00121 10.0377 2.40962 10.608 2.95949 11.0168C3.50937 11.4255 4.17322 11.6522 4.85824 11.6651C4.17763 12.2001 3.39821 12.5957 2.56458 12.8291C1.73096 13.0626 0.859476 13.1294 0 13.0258C1.50122 13.9891 3.24795 14.5001 5.03168 14.4978"
101124
fill="currentColor"
@@ -105,7 +128,13 @@ export default function MDXPage(props: ComponentProps<typeof OriginalMDXPage>) {
105128
</button>
106129
</Link>
107130
<button type="button" className={styles.socialButton} onClick={handleClick}>
108-
<svg width="13" height="14" viewBox="0 0 13 14" fill="none" xmlns="http://www.w3.org/2000/svg">
131+
<svg
132+
width="13"
133+
height="14"
134+
viewBox="0 0 13 14"
135+
fill="none"
136+
xmlns="http://www.w3.org/2000/svg"
137+
>
109138
<path
110139
fillRule="evenodd"
111140
clipRule="evenodd"
@@ -119,7 +148,13 @@ export default function MDXPage(props: ComponentProps<typeof OriginalMDXPage>) {
119148
<BrowserOnly>
120149
{() => (
121150
<Bookmark className={styles.bookmarkButton} href={url} title={title}>
122-
<svg width="16" height="20" viewBox="0 0 16 20" fill="none" xmlns="http://www.w3.org/2000/svg">
151+
<svg
152+
width="16"
153+
height="20"
154+
viewBox="0 0 16 20"
155+
fill="none"
156+
xmlns="http://www.w3.org/2000/svg"
157+
>
123158
<path
124159
d="M1.58579 1.58579C1.21071 1.96086 1 2.46957 1 3V19L8 15.5L15 19V3C15 2.46957 14.7893 1.96086 14.4142 1.58579C14.0391 1.21071 13.5304 1 13 1H3C2.46957 1 1.96086 1.21071 1.58579 1.58579Z"
125160
stroke="currentColor"
@@ -132,7 +167,7 @@ export default function MDXPage(props: ComponentProps<typeof OriginalMDXPage>) {
132167
)}
133168
</BrowserOnly>
134169
</div>
135-
{communityPortalTopicId && <DiscourseComment topicId={communityPortalTopicId} />}
170+
<DiscourseComment />
136171
</div>
137172
{MDXPageContent.toc && (
138173
<div className="col col--3" style={{ paddingRight: "30px" }}>

0 commit comments

Comments
 (0)