fix: change tabs constant name

This commit is contained in:
RadoslavDimchev 2023-11-20 17:56:19 +02:00
parent 70b66834af
commit 7e7083aaa9
4 changed files with 10 additions and 10 deletions

View File

@ -61,7 +61,7 @@ export const years = [
]
// Validator Management
export const VALIDATOR_TABS = ['Active', 'Pending', 'Inactive', 'Exited', 'Withdraw', 'All']
export const VALIDATOR_TABS_MANAGEMENT = ['Active', 'Pending', 'Inactive', 'Exited', 'Withdraw', 'All']
export const VALIDATORS_DATA = [
{

View File

@ -1,7 +1,7 @@
import type { Meta, StoryObj } from '@storybook/react'
import ManagementTable from './ManagementTable'
import { VALIDATOR_TABS } from '../../../constants'
import { VALIDATOR_TABS_MANAGEMENT } from '../../../constants'
import { useState } from 'react'
const meta = {
@ -25,7 +25,7 @@ export const Default: Story = () => {
return (
<ManagementTable
tab={VALIDATOR_TABS[0]}
tab={VALIDATOR_TABS_MANAGEMENT[0]}
searchValue={searchValue}
changeSearchValue={changeSearchValue}
/>
@ -33,7 +33,7 @@ export const Default: Story = () => {
}
Default.args = {
tab: VALIDATOR_TABS[0],
tab: VALIDATOR_TABS_MANAGEMENT[0],
searchValue: '',
changeSearchValue: () => {},
}

View File

@ -5,7 +5,7 @@ import { YStack, XStack, Stack } from 'tamagui'
import ValidatorProfile from '../../../components/General/ValidatorProfile'
import SearchManagement from './SearchManagement'
import { VALIDATORS_DATA, VALIDATOR_TABS } from '../../../constants'
import { VALIDATORS_DATA, VALIDATOR_TABS_MANAGEMENT } from '../../../constants'
import './ManagementTable.css'
type ManagementTableProps = {
@ -26,7 +26,7 @@ type Validator = {
}
const isValidStatus = (validatorStatus: string, tabStatus: string) => {
if (validatorStatus === tabStatus || tabStatus === VALIDATOR_TABS[VALIDATOR_TABS.length - 1]) {
if (validatorStatus === tabStatus || tabStatus === VALIDATOR_TABS_MANAGEMENT[VALIDATOR_TABS_MANAGEMENT.length - 1]) {
return true
}
return false

View File

@ -3,7 +3,7 @@ import { Stack } from 'tamagui'
import { useState } from 'react'
import ManagementTable from './ManagementTable/ManagementTable'
import { VALIDATOR_TABS } from '../../constants'
import { VALIDATOR_TABS_MANAGEMENT } from '../../constants'
const ManagementTabs = () => {
const [searchValue, setSearchValue] = useState('')
@ -14,17 +14,17 @@ const ManagementTabs = () => {
return (
<div style={{ width: '100%' }}>
<Tabs defaultValue={VALIDATOR_TABS[0]}>
<Tabs defaultValue={VALIDATOR_TABS_MANAGEMENT[0]}>
<Stack style={{ cursor: 'pointer', width: 'fit-content', margin: '16px 0' }}>
<Tabs.List size={32}>
{VALIDATOR_TABS.map(tab => (
{VALIDATOR_TABS_MANAGEMENT.map(tab => (
<Tabs.Trigger key={tab} type="default" value={tab}>
{tab}
</Tabs.Trigger>
))}
</Tabs.List>
</Stack>
{VALIDATOR_TABS.map(tab => (
{VALIDATOR_TABS_MANAGEMENT.map(tab => (
<Tabs.Content key={tab} value={tab} style={{ marginTop: '8px' }}>
<ManagementTable
tab={tab}