-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
show different providers in getting started
- Loading branch information
Showing
8 changed files
with
165 additions
and
46 deletions.
There are no files selected for viewing
File renamed without changes.
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,15 @@ | ||
|
||
@media screen and (max-width: 720px) { | ||
.Tabs__root { | ||
border-radius: 0; | ||
margin-left: calc(-1* var(--vocs-space_16)); | ||
margin-right: calc(-1* var(--vocs-space_16)); | ||
padding-left: var(--vocs-space_16); | ||
padding-right: var(--vocs-space_16); | ||
} | ||
|
||
.Tabs__list { | ||
margin-left: calc(-1* var(--vocs-space_16)); | ||
margin-right: calc(-1* var(--vocs-space_16)); | ||
} | ||
} |
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,30 @@ | ||
import * as Tabs from "@radix-ui/react-tabs"; | ||
import { PropsWithChildren } from "react"; | ||
import "./Tabs.css"; | ||
|
||
export const Root = ({ | ||
options, | ||
children, | ||
}: PropsWithChildren<{ | ||
options: Record<string, string>; | ||
}>) => ( | ||
<Tabs.Root | ||
className="Tabs__root border rounded bg-[--vocs-color_codeBlockBackground] border-[--vocs-color_codeInlineBorder]" | ||
defaultValue={Object.keys(options)[0]} | ||
> | ||
<Tabs.List className="Tabs__list flex flex-wrap px-2 bg-[--vocs-color_codeTitleBackground]"> | ||
{Object.entries(options).map(([value, label]) => ( | ||
<Tabs.Trigger | ||
className="text-sm p-3 pb-2 text-[--vocs-color_text3] border-b border-transparent hover:text-[--vocs-color_text] [&[data-state='active']]:text-[--vocs-color_text] [&[data-state='active']]:border-[--vocs-color_borderAccent]" | ||
value={value} | ||
> | ||
{label} | ||
</Tabs.Trigger> | ||
))} | ||
</Tabs.List> | ||
{children} | ||
</Tabs.Root> | ||
); | ||
export const Content = (props: Tabs.TabsContentProps) => ( | ||
<Tabs.Content {...props} /> | ||
); |
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,22 @@ | ||
// [!region import] | ||
// `dot` is the name we gave to `npx papi add` | ||
import { dot } from "papee/descriptors"; | ||
import { WellKnownChain, createClient } from "papee"; | ||
// [!endregion import] | ||
|
||
// [!region usage] | ||
// With the `client`, you can get information such as subscribing to the last | ||
// block to get the latest hash: | ||
client.finalized$.subscribe((finalizedBlock) => | ||
console.log(finalizedBlock.number, finalizedBlock.hash) | ||
); | ||
|
||
// To interact with the chain, you need to get the `TypedApi`, which includes | ||
// all the types for every call in that chain: | ||
const dotApi = client.getTypedApi(dot); | ||
|
||
// get the value for an account | ||
const accountInfo = await dotApi.query.System.Account.getValue( | ||
"16JGzEsi8gcySKjpmxHVrkLTHdFHodRepEz8n244gNZpr9J" | ||
); | ||
// [!endregion usage] |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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