diff --git a/apps/store/src/components/Price.tsx b/apps/store/src/components/Price.tsx index 49794769d1..96d61bfd26 100644 --- a/apps/store/src/components/Price.tsx +++ b/apps/store/src/components/Price.tsx @@ -1,10 +1,10 @@ -import styled from '@emotion/styled' +import clsx from 'clsx' import type { ComponentProps } from 'react' -import { Text, theme } from 'ui' +import { Text, xStack } from 'ui' import type { CurrencyCode } from '@/services/graphql/generated' import { useFormatter } from '@/utils/useFormatter' -type Props = { +type Props = ComponentProps<'div'> & { currencyCode: CurrencyCode amount: number reducedAmount?: number @@ -16,31 +16,30 @@ type Props = { export const Price = ({ color = 'textPrimary', secondaryColor = 'textSecondary', + reducedAmount, + amount, + currencyCode, + className, ...props }: Props) => { const formatter = useFormatter() return ( - - {props.reducedAmount !== undefined && ( +
+ {reducedAmount !== undefined && ( {formatter.monthlyPrice({ - amount: props.amount, - currencyCode: props.currencyCode, + amount, + currencyCode, })} )} {formatter.monthlyPrice({ - currencyCode: props.currencyCode, - amount: props.reducedAmount ?? props.amount, + currencyCode, + amount: reducedAmount ?? amount, })} - +
) } - -const Wrapper = styled.div({ - display: 'flex', - columnGap: theme.space.xs, -})