Files
tom goriunovandGitHub 28b9b27e8b Update styles for detailed views on mobile and more (#2875)
* update styles of tx details

* common color for text separator

* remove bold fontWeight from some details items

* address, block, token, pool, user ops details pages

* refactor chain-specific views

* unify grid column template for detailed views

* remove TODO

* update margins for text separator

* update screenshots

* update margin between icon and text for mobile

* rename prop

* update layout of decoded input data

* update screenshots

* fix tac operation and zilliqa quorum snippets
2025-08-12 22:56:03 +02:00

53 lines
1.4 KiB
TypeScript

import type { StackProps } from '@chakra-ui/react';
import { chakra } from '@chakra-ui/react';
import React from 'react';
import type { Step } from './types';
import { Skeleton } from 'toolkit/chakra/skeleton';
import VerificationStep from './VerificationStep';
export interface Props {
currentStep: string;
currentStepPending?: boolean;
steps: Array<Step>;
isLoading?: boolean;
rightSlot?: React.ReactNode;
className?: string;
itemProps?: StackProps;
}
const VerificationSteps = ({ currentStep, currentStepPending, steps, isLoading, rightSlot, className, itemProps }: Props) => {
const currentStepIndex = steps.findIndex((step) => {
const label = typeof step === 'string' ? step : step.label;
return label === currentStep;
});
return (
<Skeleton
className={ className }
loading={ isLoading }
display="flex"
columnGap={ 2 }
alignItems="center"
flexWrap="wrap"
>
{ steps.map((step, index) => (
<VerificationStep
key={ index }
step={ step }
isLast={ index === steps.length - 1 && !rightSlot }
isPassed={ index <= currentStepIndex }
isPending={ index === currentStepIndex && currentStepPending }
noIcon={ typeof step !== 'string' && index === currentStepIndex }
{ ...itemProps }
/>
)) }
{ rightSlot }
</Skeleton>
);
};
export default chakra(VerificationSteps);