-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: refactor snippets * fix: fix tab selection * fix: differenciate between TS and JS snippets * fix: replace also the enabledTradeTypes * fix: add missing commit i forgot to upload * fix: fix issue with value of tabs * fix: remove type for JS example * fix: rename html example
- Loading branch information
Showing
9 changed files
with
150 additions
and
52 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
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
20 changes: 0 additions & 20 deletions
20
apps/widget-configurator/src/app/embedDialog/utils/reactExample.ts
This file was deleted.
Oops, something went wrong.
20 changes: 20 additions & 0 deletions
20
apps/widget-configurator/src/app/embedDialog/utils/reactTsExample.ts
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,20 @@ | ||
import type { CowSwapWidgetParams } from '@cowprotocol/widget-lib' | ||
|
||
import { formatParameters } from './formatParameters' | ||
|
||
import { COMMENTS_BEFORE_PARAMS, IMPORT_STATEMENT } from '../const' | ||
|
||
export function reactTsExample(params: CowSwapWidgetParams): string { | ||
return ` | ||
${IMPORT_STATEMENT} from '@cowprotocol/widget-react' | ||
// ${COMMENTS_BEFORE_PARAMS} | ||
const params: CowSwapWidgetParams = ${formatParameters(params, 0, true)} | ||
function App() { | ||
return ( | ||
<CowSwapWidget params={params} /> | ||
) | ||
} | ||
` | ||
} |
18 changes: 18 additions & 0 deletions
18
apps/widget-configurator/src/app/embedDialog/utils/tsExample.ts
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,18 @@ | ||
import type { CowSwapWidgetParams } from '@cowprotocol/widget-lib' | ||
|
||
import { formatParameters } from './formatParameters' | ||
|
||
import { COMMENTS_BEFORE_PARAMS, IMPORT_STATEMENT as TS_IMPORT_STATEMENT } from '../const' | ||
|
||
export function tsExample(params: CowSwapWidgetParams): string { | ||
return ` | ||
${TS_IMPORT_STATEMENT} from '@cowprotocol/widget-lib' | ||
const container = document.getElementById('<YOUR_CONTAINER>') | ||
// ${COMMENTS_BEFORE_PARAMS} | ||
const params: CowSwapWidgetParams = ${formatParameters(params, 0, true)} | ||
const updateWidget = cowSwapWidget(container, params) | ||
` | ||
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1b703ea
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.
Successfully deployed to the following URLs:
widget-configurator – ./
widget-configurator-seven.vercel.app
widget-configurator-git-main-cowswap.vercel.app
widget-configurator-cowswap.vercel.app
widget.cow.fi
1b703ea
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.
Successfully deployed to the following URLs:
cosmos – ./
cosmos.cow.fi
cosmos-cowswap.vercel.app
cosmos-git-main-cowswap.vercel.app
cowswap-seven.vercel.app