From ed17ae32ee23711d06fac0d0dc4c6b1c1e5387c7 Mon Sep 17 00:00:00 2001 From: Majorfi Date: Thu, 9 Nov 2023 15:30:55 +0100 Subject: [PATCH] fix: staking data feat --- apps/common/components/Dropdown.tsx | 2 +- apps/common/components/ImageWithFallback.tsx | 6 +- apps/common/components/Popover.tsx | 12 +- apps/common/components/Table.tsx | 4 +- apps/common/hooks/useFetch.ts | 2 +- apps/common/schemas/yDaemonVaultsSchemas.ts | 42 +++- apps/vaults-v3/Wrapper.tsx | 13 +- apps/vaults-v3/components/SettingsPopover.tsx | 5 +- .../details/VaultActionsTabsWrapper.tsx | 38 +-- .../components/details/VaultDetailsHeader.tsx | 23 +- .../details/actions/QuickActionsButtons.tsx | 56 ++--- .../details/actions/QuickActionsFrom.tsx | 4 +- .../details/actions/QuickActionsSwitch.tsx | 2 +- .../details/actions/QuickActionsTo.tsx | 4 +- .../components/list/VaultsV3ListRow.tsx | 18 +- apps/vaults/Wrapper.tsx | 5 +- apps/vaults/components/RewardsTab.tsx | 219 +++++++++--------- apps/vaults/components/SettingsPopover.tsx | 8 +- .../details/VaultActionsTabsWrapper.tsx | 38 +-- .../components/details/VaultDetailsHeader.tsx | 27 +-- .../details/actions/QuickActionsButtons.tsx | 56 ++--- .../details/actions/QuickActionsFrom.tsx | 6 +- .../details/actions/QuickActionsSwitch.tsx | 3 +- .../details/actions/QuickActionsTo.tsx | 4 +- .../details/tabs/VaultDetailsStrategies.tsx | 4 +- .../components/list/VaultListOptions.tsx | 8 +- apps/vaults/components/list/VaultsListRow.tsx | 12 +- apps/vaults/contexts/useActionFlow.tsx | 5 +- apps/vaults/contexts/useStakingRewards.tsx | 165 ------------- apps/vaults/hooks/useSortVaults.ts | 23 +- apps/vaults/hooks/useVaultStakingData.ts | 78 +++++++ apps/veyfi/components/RewardsTab.tsx | 8 +- .../components/ViewStakeUnstakeGauges.tsx | 8 +- apps/veyfi/contexts/useGauge.tsx | 12 +- apps/ybal/components/CardZap.tsx | 8 +- .../components/bribe/GaugeBribeModal.tsx | 8 +- apps/ybribe/components/bribe/GaugeListRow.tsx | 6 +- apps/ybribe/components/claim/GaugeListRow.tsx | 10 +- .../rewardFeed/RewardFeedTableRow.tsx | 4 +- apps/ycrv/components/CardZap.tsx | 8 +- apps/ycrv/components/QuickActions.tsx | 7 +- next.config.js | 5 +- pages/index.tsx | 1 - pages/vaults/factory.tsx | 4 +- 44 files changed, 384 insertions(+), 597 deletions(-) delete mode 100644 apps/vaults/contexts/useStakingRewards.tsx create mode 100644 apps/vaults/hooks/useVaultStakingData.ts diff --git a/apps/common/components/Dropdown.tsx b/apps/common/components/Dropdown.tsx index 16f509716..7aed30022 100644 --- a/apps/common/components/Dropdown.tsx +++ b/apps/common/components/Dropdown.tsx @@ -98,7 +98,7 @@ export const Dropdown = ({ return (
- {label && } + {label &&

{label}

}
{isOpen ? (
({}); @@ -26,8 +26,8 @@ export function ImageWithFallback(props: TImageWithFallback): ReactElement { src={imageSrc} style={imageStyle} className={cl( - `w-[${rest.smWidth ?? rest.width}px] min-w-[${rest.smWidth ?? rest.width}px]`, - `h-[${rest.smHeight ?? rest.height}px] min-h-[${rest.smHeight ?? rest.height}px]`, + `w-[${smWidth ?? rest.width}px] min-w-[${smWidth ?? rest.width}px]`, + `h-[${smHeight ?? rest.height}px] min-h-[${smHeight ?? rest.height}px]`, `md:w-[${rest.width}px] md:h-[${rest.height}px]`, `md:min-w-[${rest.width}px] md:min-h-[${rest.height}px]` )} diff --git a/apps/common/components/Popover.tsx b/apps/common/components/Popover.tsx index 60c7eaf86..749925581 100644 --- a/apps/common/components/Popover.tsx +++ b/apps/common/components/Popover.tsx @@ -148,7 +148,7 @@ export function Popover(): ReactElement { onChange={({target: {value}}): void => set_telegramHandle(value)} placeholder={'Your telegram handle for follow up'} /> - +

- -
)} diff --git a/apps/common/components/Table.tsx b/apps/common/components/Table.tsx index 6f3b54afc..26b68f088 100644 --- a/apps/common/components/Table.tsx +++ b/apps/common/components/Table.tsx @@ -184,9 +184,9 @@ export function Table({ className )}> {!fullWidth && ( -