fix: remove add val count handler

This commit is contained in:
RadoslavDimchev 2023-09-27 16:22:16 +03:00
parent e2cd19f4db
commit 111ab75cb2
3 changed files with 7 additions and 11 deletions

View File

@ -14,7 +14,6 @@ type Story = StoryObj<typeof meta>
export const Default: Story = {
args: {
validatorCount: 2,
addValidatorHandler: () => {},
changeValidatorCountHandler: () => {},
},
}
@ -22,7 +21,6 @@ export const Default: Story = {
export const WithoutValidatorCount: Story = {
args: {
validatorCount: 0,
addValidatorHandler: () => {},
changeValidatorCountHandler: () => {},
},
}
@ -30,7 +28,6 @@ export const WithoutValidatorCount: Story = {
export const WithLongValidatorCount: Story = {
args: {
validatorCount: 2000,
addValidatorHandler: () => {},
changeValidatorCountHandler: () => {},
},
}

View File

@ -9,13 +9,11 @@ import CurrencyDropdown from './CurrencyDropdown'
type ValidatorsMenuWithPriceProps = {
validatorCount: number
addValidatorHandler: () => void
changeValidatorCountHandler: (value: string) => void
}
const ValidatorsMenuWithPrice = ({
validatorCount,
addValidatorHandler,
changeValidatorCountHandler,
}: ValidatorsMenuWithPriceProps) => {
const [currency, setCurrency] = useState(CURRENCIES[0])
@ -31,7 +29,13 @@ const ValidatorsMenuWithPrice = ({
<Stack space={'$2'}>
<DepositSubtitle />
<Input
icon={<AddIcon size={16} style={{ cursor: 'pointer' }} onClick={addValidatorHandler} />}
icon={
<AddIcon
size={16}
style={{ cursor: 'pointer' }}
onClick={() => changeValidatorCountHandler((validatorCount + 1).toString())}
/>
}
style={{ fontWeight: 'bold' }}
value={validatorCount.toString()}
onChangeText={changeValidatorCountHandler}

View File

@ -18,10 +18,6 @@ const Deposit = () => {
const { isWalletConnected } = useSelector((state: RootState) => state.deposit)
const isTransactionConfirmation = false
const addValidatorHandler = () => {
setValidatorCount((state: number) => state + 1)
}
const changeValidatorCountHandler = (value: string) => {
const numberValue = Number(value)
if (!isNaN(numberValue)) {
@ -44,7 +40,6 @@ const Deposit = () => {
) : (
<ValidatorsMenuWithPrice
validatorCount={validatorCount}
addValidatorHandler={addValidatorHandler}
changeValidatorCountHandler={changeValidatorCountHandler}
/>
)}