Skip to content

Commit

Permalink
fix(SwapLine): fix value prop usage in NumericFormat
Browse files Browse the repository at this point in the history
  • Loading branch information
oliviera9 committed Jan 22, 2024
1 parent 998449c commit 8153a54
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 10 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "plain-dapp-update",
"private": true,
"version": "1.18.0",
"version": "1.18.1",
"type": "module",
"scripts": {
"dev": "npm run create-version-file && vite",
Expand Down
16 changes: 9 additions & 7 deletions src/components/organisms/swapLine/SwapLine.jsx
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
import React, { useState, useEffect, useMemo } from 'react'
import styled from 'styled-components'
import PropTypes from 'prop-types'
import React, { useState, useEffect, useMemo } from 'react'
import { Row, Col } from 'react-bootstrap'
import { capitalizeAllLettersExceptFirst } from '../../../utils/capitalize'
import Skeleton from 'react-loading-skeleton'
import { NumericFormat } from 'react-number-format'
import AssetInfo from '../assetInfo/AssetInfo'
import Icon from '../../atoms/icon/Icon'
import styled from 'styled-components'

import { getDecimalSeparator, getThousandSeparator } from '../../../utils/amount-utils'
import Skeleton from 'react-loading-skeleton'
import { capitalizeAllLettersExceptFirst } from '../../../utils/capitalize'
import Icon from '../../atoms/icon/Icon'
import AssetInfo from '../assetInfo/AssetInfo'

import 'react-loading-skeleton/dist/skeleton.css'

const SwapLineContainer = styled.div`
Expand Down Expand Up @@ -275,7 +277,7 @@ const SwapLine = ({
disabled={disableInput}
onValueChange={(_e, _source) => onChangeAmount(_e.value.toString().replace(',', '.'), _source)}
prefix={prefix}
value={amount !== '' ? +amount : amount}
value={amount}
allowedDecimalSeparators={[',', '.']}
decimalSeparator={getDecimalSeparator()}
thousandSeparator={getThousandSeparator()}
Expand Down

0 comments on commit 8153a54

Please sign in to comment.