diff --git a/packages/react/components/price/Price.native.tsx b/packages/react/components/price/Price.native.tsx index 501988a2..8d813fee 100644 --- a/packages/react/components/price/Price.native.tsx +++ b/packages/react/components/price/Price.native.tsx @@ -25,15 +25,12 @@ import { StatesContext } from '@/context/providerStates' * @param level {PriceLevel} Price custom size * @param style {Object} Additional style * @param inverted {boolean} Inverted Price Color - * @param children {React.ReactNode} * @param align {Alignable} Price alignement * @param inline {boolean} Inline display Price * @param testId {string} id for test * @param accessibilityLabel {string} * @param oldAmount {boolean} Striked Amount Price * @param overline {string} Price overline - * @param tagAmount {number} Tag amount - * @param tagSymbol {number} Tag symbol */ const Price = ({ amount, @@ -48,14 +45,14 @@ const Price = ({ accessibilityLabel, oldAmount, overline, - tagAmount, - tagSymbol, + tagValue, + tagLabel, ...others }: PriceProps): JSX.Element => { const statesContext = useContext(StatesContext) - const isNegative = amount < 0 - const absoluteAmount = Math.abs(amount) + const isNegative = amount ? amount < 0 : false + const absoluteAmount = amount ? Math.abs(amount) : 0 const absoluteWhole = Math.floor(absoluteAmount) const whole = isNegative ? -absoluteWhole : absoluteWhole @@ -276,7 +273,7 @@ const Price = ({ {overline && {overline}} - + )} - {tagAmount && ( + {tagValue && ( @@ -344,15 +341,15 @@ const Price = ({ style={[styles.tagTextAmount]} typo={[TypographyBold.TEXT_WEIGHT_SEMIBOLD, TypographyColor.TEXT_WHITE]} > - {tagAmount} {tagSymbol ? tagSymbol : '€'} + {tagValue} - {tagSymbol === '€' && period && ( + {tagLabel && ( {' '} - /{period} + /{tagLabel} )} diff --git a/packages/react/components/price/test/Price.native.test.tsx b/packages/react/components/price/test/Price.native.test.tsx index 3ac1b319..bdd2f3ad 100644 --- a/packages/react/components/price/test/Price.native.test.tsx +++ b/packages/react/components/price/test/Price.native.test.tsx @@ -4,7 +4,7 @@ import Price from '../Price' describe('Price', () => { it('renders correctly with whole amount', () => { - render() + render() expect(screen.getByText('24')).toBeOnTheScreen() }) })