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