Skip to content

Commit

Permalink
perf: defi only render current step if active (#5476)
Browse files Browse the repository at this point in the history
* wip: walletprovider type narrowing

* feat: cast KKRestAdapter type

* feat: cast multichain adapter as MetaMaskAdapter

* feat: rm ts-ignore

* fix: infinite dispatch

* feat: rm useless ts-ignore

* wip

* feat: gm, she compiles again

* perf: defi only render current step if active

---------

Co-authored-by: woodenfurniture <[email protected]>
Co-authored-by: Apotheosis <[email protected]>
  • Loading branch information
3 people authored Oct 18, 2023
1 parent c790afb commit 7a68ec4
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/components/DeFi/components/Steps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -49,16 +49,17 @@ export const Steps: React.FC<StepsProps> = ({
const Step = steps[step as DefiStep]
if (!Step) return null
const Component = Step.component
const isActive = currentStep === index
return (
<StepRow
label={Step.label}
key={step}
description={Step?.description}
stepNumber={`${index + 1}`}
isComplete={currentStep > index}
isActive={currentStep === index}
isActive={isActive}
>
<Component onNext={handleNext} {...Step.props} />
{isActive && <Component onNext={handleNext} {...Step.props} />}
</StepRow>
)
})}
Expand Down

0 comments on commit 7a68ec4

Please sign in to comment.