feat: use new constants for stories

This commit is contained in:
RadoslavDimchev 2024-01-06 21:15:22 +02:00
parent c315c5743c
commit 330da5a072
3 changed files with 27 additions and 16 deletions

View File

@ -121,3 +121,4 @@ export const BEACON = 'Beacon'
export const NODE = 'Node'
export const VC_PORT = '9000'
export const BEACON_PORT = '5052'
export const DEFAULT_ADDRESS = 'http://124.0.0.1'

View File

@ -2,6 +2,15 @@ import type { Meta, StoryObj } from '@storybook/react'
import { withRouter } from 'storybook-addon-react-router-v6'
import InputsRow from './InputsRow'
import {
BEACON,
BEACON_PORT,
DEFAULT_ADDRESS,
NODE,
VALIDATOR_CLIENT,
VC,
VC_PORT,
} from '../../../constants'
const meta = {
title: 'Pair Device/InputsRow',
@ -18,19 +27,19 @@ type Story = StoryObj<typeof meta>
export const Node: Story = {
args: {
addressType: 'Node',
address: 'http://124.0.0.1',
addressType: NODE,
address: DEFAULT_ADDRESS,
port: '',
portType: '',
},
}
export const VC: Story = {
export const ValidatorClient: Story = {
args: {
addressType: 'Validator Client',
portType: 'VC',
address: 'http://124.0.0.1',
port: '9000',
addressType: VALIDATOR_CLIENT,
portType: VC,
address: DEFAULT_ADDRESS,
port: VC_PORT,
isAdvanced: true,
isSwitchOn: true,
isChecked: true,
@ -39,10 +48,10 @@ export const VC: Story = {
export const Beacon: Story = {
args: {
addressType: 'Beacon',
portType: 'Beacon',
address: 'http://124.0.0.1',
port: '5052',
addressType: BEACON,
portType: BEACON,
address: DEFAULT_ADDRESS,
port: BEACON_PORT,
isAdvanced: true,
isSwitchOn: true,
isChecked: true,

View File

@ -2,6 +2,7 @@ import type { Meta, StoryObj } from '@storybook/react'
import { withRouter } from 'storybook-addon-react-router-v6'
import PortInput from './PortInput'
import { BEACON, BEACON_PORT, VC, VC_PORT } from '../../../constants'
const meta = {
title: 'Pair Device/PortInput',
@ -16,16 +17,16 @@ const meta = {
export default meta
type Story = StoryObj<typeof meta>
export const VC: Story = {
export const ValidatorClient: Story = {
args: {
port: '9000',
portType: 'VC',
port: VC_PORT,
portType: VC,
},
}
export const Beacon: Story = {
args: {
port: '5052',
portType: 'Beacon',
port: BEACON_PORT,
portType: BEACON,
},
}