feat: create story with examples for transaction status

This commit is contained in:
RadoslavDimchev 2023-09-28 17:24:41 +03:00
parent c2d3d043c6
commit 080ebdc98a
2 changed files with 45 additions and 2 deletions

View File

@ -0,0 +1,43 @@
import type { Meta, StoryObj } from '@storybook/react'
import TransactionStatus from './TransactionStatus'
const meta = {
title: 'ValidatorOnboarding/TransactionStatus',
component: TransactionStatus,
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
} satisfies Meta<typeof TransactionStatus>
export default meta
type Story = StoryObj<typeof meta>
export const Default: Story = {
args: {
isTransactionConfirmation: false,
transactionStatus: '',
},
}
export const Complete: Story = {
args: {
isTransactionConfirmation: true,
transactionStatus: 'Complete',
},
}
export const Pending: Story = {
args: {
isTransactionConfirmation: true,
transactionStatus: 'Pending',
},
}
export const Fail: Story = {
args: {
isTransactionConfirmation: true,
transactionStatus: 'Fail',
},
}

View File

@ -1,5 +1,5 @@
import { Text } from '@status-im/components'
import { FullscreenMacOsIcon, CloseMacOsIcon, MinimizeMacOsIcon } from '@status-im/icons'
import { FullscreenMacOsIcon, MinimizeMacOsIcon, CloseMacOsIcon } from '@status-im/icons'
import { XStack } from 'tamagui'
type VTransactionStatusProps = {
@ -16,8 +16,8 @@ const TransactionStatus = ({
{isTransactionConfirmation ? (
<XStack space={'$2'} alignItems={'center'}>
{transactionStatus === 'Complete' && <FullscreenMacOsIcon size={16} />}
{transactionStatus === 'Failed' && <CloseMacOsIcon size={16} />}
{transactionStatus === 'Pending' && <MinimizeMacOsIcon size={16} />}
{transactionStatus === 'Fail' && <CloseMacOsIcon size={16} />}
<Text size={13} color="#2F80ED" weight={'semibold'}>
Transaction {transactionStatus}
</Text>