-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
27 changed files
with
4,269 additions
and
63 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { SwapWidgetApi } from '@dodoex/api'; | ||
import { MiningList, SwapWidgetProps, Widget } from '@dodoex/widgets'; | ||
import React from 'react'; | ||
|
||
export default { | ||
title: 'Widgets/MiningList', | ||
component: 'div', | ||
}; | ||
|
||
export const Primary = (props: any) => { | ||
const [config, setConfig] = React.useState<SwapWidgetProps>({}); | ||
const { projectId, apiKey, ...other } = props; | ||
React.useEffect(() => { | ||
if (projectId && apiKey) { | ||
const dodoService = new SwapWidgetApi(); | ||
dodoService | ||
.getConfigSwapWidgetProps(projectId, apiKey) | ||
.then(({ swapWidgetProps }) => { | ||
setConfig(swapWidgetProps); | ||
}); | ||
} | ||
}, [projectId, apiKey]); | ||
return ( | ||
<Widget {...config} {...other} apikey={apiKey}> | ||
<MiningList onClickCreate={() => window.alert('Create')} /> | ||
</Widget> | ||
); | ||
}; | ||
|
||
Primary.args = { | ||
projectId: 'project2', | ||
apiKey: 'ee53d6b75b12aceed4', | ||
width: '100%', | ||
height: '100%', | ||
noDocumentLink: true, | ||
// onlyChainId: 1, | ||
}; |
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
Oops, something went wrong.