docs: clean up widget pages and document widget-react#642
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
All contributors have signed the CLA ✍️ ✅ |
📝 WalkthroughWalkthroughDocumentation updates cover the CoW Widget overview and tutorial, including generic component wording, React integration guidance, corrected configuration examples, container lookups, appCode placeholders, token typing, and ChangesWidget Documentation Refresh
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
Suggested reviewers: 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| appCode: 'YOUR-APP-NAME', // Required: identifies your app | ||
| width: 600, | ||
| height: 640, | ||
| width: '600px', |
There was a problem hiding this comment.
I think both of them are marked as deprecated. If you want the closest non-deprecated equivalent, it would be:
rootStyle: {
width: "600px",
height: "640px",
}
You can play around with the different options here: https://widget.cow.fi/
|
|
||
| createCowSwapWidget(widgetContainer, { params }) | ||
| ``` | ||
| - **And more**: Slippage limits, token pair constraints, custom sounds and images |
There was a problem hiding this comment.
If it's not already lined on this page, it might be good to add a link to https://widget.cow.fi/
|
|
||
| const params: CowSwapWidgetParams = { | ||
| appCode: 'NAME-OF-YOUR-APP', // Add here the name of your app. e.g. "Pig Swap" | ||
| width: '600px', |
Danziger
left a comment
There was a problem hiding this comment.
Approved, but while valid, these example use now deprecated params.
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
docs/cow-protocol/tutorials/widget/widget.md (1)
342-342: 📐 Maintainability & Code Quality | 🟡 Minor | ⚡ Quick winFix the comma splice and add punctuation.
Use “In this case” as a new sentence and finish the paragraph with a period.
Proposed wording
-Alternatively, you can omit the provider, in this case the widget will work in standalone mode, letting users connect +Alternatively, you can omit the provider. In this case, the widget will work in standalone mode, allowing users to connect.🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@docs/cow-protocol/tutorials/widget/widget.md` at line 342, Update the sentence in the widget standalone-mode documentation to replace the comma splice with a period before “In this case,” and end the paragraph with a period.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@docs/cow-protocol/tutorials/widget/widget.md`:
- Line 342: Update the sentence in the widget standalone-mode documentation to
replace the comma splice with a period before “In this case,” and end the
paragraph with a period.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: fe602817-9639-4819-aec7-8cc1117c7a62
📒 Files selected for processing (2)
docs/cow-protocol/integrate/widget.mdxdocs/cow-protocol/tutorials/widget/widget.md
🚧 Files skipped from review as they are similar to previous changes (1)
- docs/cow-protocol/integrate/widget.mdx
Danziger
left a comment
There was a problem hiding this comment.
Changes look good, thanks 👌
Description
The widget overview page (Integrate section) had drifted out of sync with the widget tutorial, and some tutorial examples were broken when copy-pasted. The React wrapper was not documented at all.
Changes
integrate/widget.mdxto match the other integrate pages and removed duplicated examplescreateCowSwapWidgetreturn value usage, missingcontainerdeclarations)@cowprotocol/widget-reactSummary by CodeRabbit
width/height(viarootStyle) and correctedappCodeplaceholders.CowSwapWidgetusage.updateParamsflow and container wiring).