-
Notifications
You must be signed in to change notification settings - Fork 428
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add staking widget on dashboard
- Loading branch information
Showing
5 changed files
with
41 additions
and
4 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
29 changes: 29 additions & 0 deletions
29
src/features/stake/components/StakeDashboardWidget/index.tsx
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,29 @@ | ||
import { useMemo } from 'react' | ||
import AppFrame from '@/components/safe-apps/AppFrame' | ||
import { getEmptySafeApp } from '@/components/safe-apps/utils' | ||
import { useGetStakeWidgetUrl } from '@/features/stake/hooks/useGetStakeWidgetUrl' | ||
import { widgetAppData } from '@/features/stake/constants' | ||
|
||
const StakingDashboardWidget = () => { | ||
const url = useGetStakeWidgetUrl('', 'overview') + '&interactive=false&navigation=none&widget_width=full' | ||
|
||
const appData = useMemo( | ||
() => ({ | ||
...getEmptySafeApp(), | ||
...widgetAppData, | ||
url, | ||
}), | ||
[url], | ||
) | ||
|
||
return ( | ||
<AppFrame | ||
appUrl={appData.url} | ||
allowedFeaturesList="clipboard-read; clipboard-write" | ||
safeAppFromManifest={appData} | ||
isNativeEmbed | ||
/> | ||
) | ||
} | ||
|
||
export default StakingDashboardWidget |
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