Skip to content

Commit

Permalink
feat: add title and link to staking
Browse files Browse the repository at this point in the history
.
  • Loading branch information
compojoom committed Sep 18, 2024
1 parent ae832d7 commit 1f48e84
Showing 1 changed file with 28 additions and 6 deletions.
34 changes: 28 additions & 6 deletions src/features/stake/components/StakeDashboardWidget/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,22 @@ 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'
import css from '@/components/dashboard/PendingTxs/styles.module.css'
import { Typography } from '@mui/material'
import { ViewAllLink } from '@/components/dashboard/styled'
import { AppRoutes } from '@/config/routes'
import { useRouter } from 'next/router'

const StakingDashboardWidget = () => {
const url = useGetStakeWidgetUrl('', 'overview') + '&interactive=false&navigation=none&widget_width=full'
const router = useRouter()
const stakeUrl = useMemo(
() => ({
pathname: AppRoutes.stake,
query: { safe: router.query.safe },
}),
[router.query.safe],
)

const appData = useMemo(
() => ({
Expand All @@ -17,12 +30,21 @@ const StakingDashboardWidget = () => {
)

return (
<AppFrame
appUrl={appData.url}
allowedFeaturesList="clipboard-read; clipboard-write"
safeAppFromManifest={appData}
isNativeEmbed
/>
<>
<div className={css.title}>
<Typography component="h2" variant="subtitle1" fontWeight={700} mb={2}>
Stake
</Typography>

<ViewAllLink url={stakeUrl} text="Go to staking" />
</div>
<AppFrame
appUrl={appData.url}
allowedFeaturesList="clipboard-read; clipboard-write"
safeAppFromManifest={appData}
isNativeEmbed
/>
</>
)
}

Expand Down

0 comments on commit 1f48e84

Please sign in to comment.