-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: add @fuels/connectors to the docs (#1142)
Add `@fuels/connectors` and `@tanstack/react-query` to the docs. | Demo | | ---- | | <img width="920" alt="Screenshot 2024-03-18 at 16 13 10" src="https://github.com/FuelLabs/fuels-wallet/assets/7074983/b36222fb-1cf7-4ec5-bd2c-d18eeedef0a8"> |
- Loading branch information
1 parent
96faa7f
commit 1b0f42d
Showing
9 changed files
with
122 additions
and
32 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
--- | ||
"@fuel-wallet/connections": patch | ||
"@fuel-wallet/types": patch | ||
"fuels-wallet": patch | ||
'@fuel-wallet/connections': patch | ||
'@fuel-wallet/types': patch | ||
'fuels-wallet': patch | ||
--- | ||
|
||
ci: replace prettier and eslint with biomejs (dev) |
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,7 +1,7 @@ | ||
--- | ||
'@fuel-wallet/connections': minor | ||
'@fuel-wallet/types': minor | ||
'fuels-wallet': minor | ||
'@fuel-wallet/connections': patch | ||
'@fuel-wallet/types': patch | ||
'fuels-wallet': patch | ||
--- | ||
|
||
feat: bump SDK to latest version |
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
45 changes: 45 additions & 0 deletions
45
packages/docs/examples/connectors/ListDefaultConnectors.tsx
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,45 @@ | ||
import { Tag } from '@fuel-ui/react'; | ||
/* createInstance:start */ | ||
import { defaultConnectors } from '@fuels/connectors'; | ||
import type { FuelConnector } from 'fuels'; // ignore-line | ||
import { Fuel } from 'fuels'; | ||
import { useEffect, useState } from 'react'; // ignore-line | ||
|
||
import { ExampleBox } from '../../src/components/ExampleBox'; // ignore-line | ||
|
||
const fuel = new Fuel({ | ||
connectors: defaultConnectors({ devMode: true }), | ||
}); | ||
/* createInstance:end */ | ||
|
||
export function ListDefaultConnectors() { | ||
const [connectors, setConnectors] = useState<Array<FuelConnector>>([]); | ||
|
||
useEffect(() => { | ||
async function handleConnectors() { | ||
const connectors = await fuel.connectors(); | ||
console.log('available connectors', connectors); | ||
|
||
fuel.on(fuel.events.connectors, (connectors) => { | ||
console.log('available connectors', connectors); | ||
setConnectors(connectors); | ||
}); | ||
setConnectors(connectors); | ||
} | ||
|
||
handleConnectors(); | ||
}, []); | ||
|
||
return ( | ||
<ExampleBox> | ||
{connectors.map((connector) => { | ||
const label = `Installed: ${connector.installed} - Connected: ${connector.connected}`; | ||
return ( | ||
<Tag variant="ghost" key={connector.name} intent="base"> | ||
{connector.name} - {label} | ||
</Tag> | ||
); | ||
})} | ||
</ExampleBox> | ||
); | ||
} |
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,3 +1,4 @@ | ||
export * from './ListConnectors'; | ||
export * from './ListDefaultConnectors'; | ||
export * from './SelectConnector'; | ||
export * from './hooks'; |
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 |
---|---|---|
|
@@ -98,4 +98,4 @@ UI | |
assetId | ||
contractId | ||
boolean | ||
|
||
tanstack |