-
Notifications
You must be signed in to change notification settings - Fork 22
[FRE-1668] Update web-component to allow passing props in the same format as the react component (camelCase) #1055
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
Conversation
🦋 Changeset detectedLatest commit: acf8420 The changes in this PR will be included in the next version bump. This PR includes changesets to release 2 packages
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
…and manually pass the type of prop it is
interface HTMLElementTagNameMap { | ||
[WEB_COMPONENT_NAME]: WidgetProps; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can add this to the documentation, I'm not sure there is a doc for web component. |
|
||
## Usage | ||
|
||
Props are the same as [`WidgetProps`](./configuration), but passed as attributes in kebab-case. Use strings or stringified objects for complex props. | ||
Props are the exact same as [`WidgetProps`](./configuration) but you are required to pass them to the element via javascript/typescript. | ||
|
||
```tsx | ||
<div style="width:100%; max-width:500px; padding:0 10px;"> | ||
<skip-widget | ||
theme='{ | ||
"brandColor": "#FF4FFF", | ||
}' | ||
default-route='{ | ||
"srcChainId": "osmosis-1", | ||
"srcAssetDenom": "ibc/1480b8fd20ad5fcae81ea87584d269547dd4d436843c1d20f15e00eb64743ef4" | ||
}' | ||
></skip-widget> | ||
<skip-widget></skip-widget> | ||
</div> | ||
<script> | ||
const skipWidget = document.querySelector("skip-widget"); | ||
if (skipWidget) { | ||
skipWidget.theme = { | ||
brandColor: "#FF4FFF", | ||
}; | ||
skipWidget.defaultRoute = { | ||
srcChainId: "osmosis-1", | ||
srcAssetDenom: "ibc/1480b8fd20ad5fcae81ea87584d269547dd4d436843c1d20f15e00eb64743ef4", | ||
} | ||
} | ||
</script> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can add this to the documentation, I'm not sure there is a doc for web component.
@codingki docs are here and this is where it shows up https://docs.skip.build/go/widget/web-component
No description provided.