Skip to content

Commit

Permalink
fix: adjust card title to protocol steps
Browse files Browse the repository at this point in the history
  • Loading branch information
chybisov committed Mar 21, 2023
1 parent b28bb89 commit 670f67f
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions packages/widget/src/components/Step/Step.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,19 @@ export const Step: React.FC<{
const getCardTitle = () => {
switch (step.type) {
case 'lifi':
if (step.includedSteps.every((step) => step.type === 'cross')) {
return t('swap.stepBridge');
const hasCrossStep = step.includedSteps.some(
(step) => step.type === 'cross',
);
const hasSwapStep = step.includedSteps.some(
(step) => step.type === 'swap',
);
if (hasCrossStep && hasSwapStep) {
return t('swap.stepSwapAndBridge');
}
if (step.includedSteps.every((step) => step.type === 'swap')) {
return t('swap.stepSwap');
if (hasCrossStep) {
return t('swap.stepBridge');
}
return t('swap.stepSwapAndBridge');
return t('swap.stepSwap');
case 'swap':
return t('swap.stepSwap');
case 'cross':
Expand Down

0 comments on commit 670f67f

Please sign in to comment.