Skip to content

Commit

Permalink
refactor: Update MiningDetail component and related files
Browse files Browse the repository at this point in the history
  • Loading branch information
yrjkqq committed Oct 17, 2024
1 parent e714cfb commit 25a90e0
Show file tree
Hide file tree
Showing 10 changed files with 1,339 additions and 8 deletions.
43 changes: 43 additions & 0 deletions packages/doc/src/stories/widgets/MiningDetail.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
import { SwapWidgetApi } from '@dodoex/api';
import { MiningDetail, SwapWidgetProps, Widget } from '@dodoex/widgets';
import React from 'react';

export default {
title: 'Widgets/MiningDetail',
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}>
<MiningDetail
query={{
mining: '0x15816C9baAf11b785DcF37F558c53F83d6c30Ef2',
address: '0xE9a586152879f4817cb6c599E32e8f8e96BFba4c',
chainId: 11155111,
}}
/>
</Widget>
);
};

Primary.args = {
projectId: 'project2',
apiKey: 'ee53d6b75b12aceed4',
width: '100%',
height: '100%',
noDocumentLink: true,
// onlyChainId: 1,
};
1 change: 1 addition & 0 deletions packages/dodoex-widgets/src/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export {
export type { PoolOperateProps } from './widgets/PoolWidget/PoolOperate';
export { usePoolBalanceInfo } from './widgets/PoolWidget/hooks/usePoolBalanceInfo';
export { MiningList } from './widgets/MiningWidget/MiningList';
export { MiningDetail } from './widgets/MiningWidget/MiningDetail';

export { TokenCard } from './components/Swap/components/TokenCard';
export { default as TokenLogo } from './components/TokenLogo';
Expand Down
Loading

0 comments on commit 25a90e0

Please sign in to comment.