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

feat: add ethereum rpc table component and example #115

Merged
merged 2 commits into from
Feb 13, 2024

Conversation

yqrashawn
Copy link
Member

@yqrashawn yqrashawn commented Nov 1, 2023

Description

  • add rpc table component through ethereum-rpc-table package
  • add example usage in docs/en/user-guide/setup.mdx, this is just an example, the table is not supposed to be there, do not merge
  • package code at https://github.com/scroll-tech/ethereum-rpc-table

Copy link

netlify bot commented Nov 1, 2023

Deploy Preview for scroll-documentation ready!

Name Link
🔨 Latest commit 7e0a09b
🔍 Latest deploy log https://app.netlify.com/sites/scroll-documentation/deploys/65cabd446883be0008669f68
😎 Deploy Preview https://deploy-preview-115.docs.scroll.xyz
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@yqrashawn yqrashawn self-assigned this Nov 1, 2023
Comment on lines +10 to +72
chainData = chainData || {
name: "Scroll",
chain: "ETH",
status: "active",
rpc: [
{
url: "https://rpc.scroll.io",
},
{
url: "https://rpc-scroll.icecreamswap.com",
},
{
url: "https://scroll.blockpi.network/v1/rpc/public",
tracking: "limited",
trackingDetails:
"We do not collect request data or request origin. We only temporarily record the request method names and IP addresses for 7 days to ensure our service functionality such as load balancing and DDoS protection. All the data is automatically deleted after 7 days and we do not store any user information for longer periods of time. https://blockpi.io/privacy-policy",
},
{
url: "https://1rpc.io/scroll",
tracking: "none",
trackingDetails:
"With the exception of data that will be public on chain, all the other metadata / data should remain private to users and other parties should not be able to access or collect it. 1RPC uses many different techniques to prevent the unnecessary collection of user privacy, which prevents tracking from RPC providers. https://docs.1rpc.io/technology/zero-tracking",
},
{
url: "https://rpc.ankr.com/scroll",
},
{
url: "https://scroll-mainnet.chainstacklabs.com",
},
],
faucets: [],
nativeCurrency: {
name: "Ether",
symbol: "ETH",
decimals: 18,
},
infoURL: "https://scroll.io",
shortName: "scr",
chainId: 534352,
networkId: 534352,
explorers: [
{
name: "Scrollscan",
url: "https://scrollscan.com",
standard: "EIP3091",
},
{
name: "Blockscout",
url: "https://blockscout.scroll.io",
standard: "EIP3091",
},
],
parent: {
type: "L2",
chain: "eip155-1",
bridges: [
{
url: "https://scroll.io/bridge",
},
],
},
}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is good for now!

@yqrashawn yqrashawn marked this pull request as ready for review November 1, 2023 09:02
@dghelm
Copy link
Collaborator

dghelm commented Nov 1, 2023

Question for @zzq0826 and @Turupawn -- Do we want i18n strings to live close to components, or would we prefer everything for a single language to sit in its translation.json file?

@zzq0826
Copy link
Member

zzq0826 commented Nov 2, 2023

Question for @zzq0826 and @Turupawn -- Do we want i18n strings to live close to components, or would we prefer everything for a single language to sit in its translation.json file?

If possible, I prefer to configure it in the translation.json file.

@yqrashawn
Copy link
Member Author

It's still possible to have i18n strings in [lang]/translation.json with this component.
I've updated the code to relfect that. I also added en and zh translation to json file.

@dghelm @zzq0826

@yqrashawn
Copy link
Member Author

To add custom style, you can remove
import "ethereum-rpc-table/lib/default.css" and import "./RPCTable.css" at

import "ethereum-rpc-table/lib/default.css"
import i18next, { t } from "i18next"
import "./RPCTable.css"

The package adds zero style if these two imports are removed

@yqrashawn yqrashawn force-pushed the feat/add-rpc-table-component branch 3 times, most recently from a696da4 to d4f24e0 Compare November 22, 2023 02:21
@yqrashawn yqrashawn force-pushed the feat/add-rpc-table-component branch 3 times, most recently from cf95f67 to c7c308c Compare December 11, 2023 03:17
- add rpc table component through `ethereum-rpc-table` package
- add example usage in `docs/en/user-guide/setup.mdx`
- package code at https://github.com/scroll-tech/ethereum-rpc-table

Signed-off-by: yqrashawn <[email protected]>
Copy link
Collaborator

@dghelm dghelm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM -- adjusted css and moved to components preview page.

Might assess followup for mobile, but we'll likely just want to hide it and make a component that alternates display after different breakpoints.

@dghelm dghelm merged commit 55d4de6 into develop Feb 13, 2024
6 checks passed
@yqrashawn yqrashawn deleted the feat/add-rpc-table-component branch February 18, 2024 01:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants