fix(#2038): add min price in sunscription

keep-around/4e84a6392e0a9deef7be2728ffb02ac4b9b56c3d
Andrei Dekterev 4 years ago committed by Макситалиев Мирлан
parent d927435c21
commit 4e84a6392e
  1. 1
      src/config/lexics/indexLexics.tsx
  2. 14
      src/features/BuyMatchPopup/components/SelectSubscription/index.tsx
  3. 14
      src/features/BuyMatchPopup/components/SelectSubscription/styled.tsx
  4. 12
      src/features/Price/index.tsx
  5. 9
      src/features/Price/styled.tsx
  6. 1
      src/requests/getSubscriptions.tsx

@ -9,6 +9,7 @@ const matchPopupLexics = {
episode_duration: 13410, episode_duration: 13410,
events: 1020, events: 1020,
from_end_match: 15396, from_end_match: 15396,
from_price: 3992,
from_start_match: 15395, from_start_match: 15395,
gk: 3515, gk: 3515,
go_back_to_match: 13405, go_back_to_match: 13405,

@ -31,6 +31,8 @@ import {
Pass, Pass,
} from '../SubscriptionsList/styled' } from '../SubscriptionsList/styled'
import { Price } from './styled'
export const ChooseSub = styled.div` export const ChooseSub = styled.div`
font-weight: 600; font-weight: 600;
font-size: 16px; font-size: 16px;
@ -87,8 +89,7 @@ export const SelectSubscriptionStep = () => {
</Header> </Header>
<Body marginTop={15}> <Body marginTop={15}>
<ChooseSubList> <ChooseSubList>
{ {map(initialSubscription.data, (subscription, index) => (
map(initialSubscription.data, (subscription, index) => (
<ChooseSubItem <ChooseSubItem
key={subscription.id} key={subscription.id}
onClick={() => onItemClick(subscription, index)} onClick={() => onItemClick(subscription, index)}
@ -105,9 +106,14 @@ export const SelectSubscriptionStep = () => {
<T9n t={subscription.lexic3} /> <T9n t={subscription.lexic3} />
</Description> </Description>
</InfoWrapper> </InfoWrapper>
<Price
amount={subscription.min_price || 0}
currency={subscription.packages.month.all.currency_iso}
isFrom={Boolean(subscription.min_price)}
/>
</ChooseSubItem> </ChooseSubItem>
)) ))}
}
</ChooseSubList> </ChooseSubList>
</Body> </Body>
<Footer> <Footer>

@ -0,0 +1,14 @@
import styled from 'styled-components/macro'
import { Price as BasePrice } from 'features/Price'
import { PriceAmount, PriceDetails } from 'features/Price/styled'
export const Price = styled(BasePrice)`
${PriceAmount} {
font-size: 24px;
font-weight: normal;
}
${PriceDetails} {
padding-top: 5px;
font-size: 12px;
}
`

@ -3,6 +3,7 @@ import { currencySymbols } from 'config'
import { T9n } from 'features/T9n' import { T9n } from 'features/T9n'
import { import {
Prefix,
PriceAmount, PriceAmount,
PriceDetails, PriceDetails,
PriceWrapper, PriceWrapper,
@ -14,6 +15,7 @@ type Props = {
amount: number, amount: number,
className?: string, className?: string,
currency?: string, currency?: string,
isFrom?: boolean,
perPeriod?: string | null, perPeriod?: string | null,
} }
@ -21,9 +23,19 @@ export const Price = ({
amount, amount,
className, className,
currency = currencySymbols.RUB, currency = currencySymbols.RUB,
isFrom,
perPeriod, perPeriod,
}: Props) => ( }: Props) => (
<PriceWrapper className={className}> <PriceWrapper className={className}>
{
isFrom
? (
<Prefix>
<T9n t='from_price' />
</Prefix>
)
: ''
}
<PriceAmount>{amount}</PriceAmount> <PriceAmount>{amount}</PriceAmount>
<PriceDetails> <PriceDetails>
<Currency>{currency}</Currency> <Currency>{currency}</Currency>

@ -55,3 +55,12 @@ export const Currency = styled.span`
export const Period = styled.span` export const Period = styled.span`
text-transform: uppercase; text-transform: uppercase;
` `
export const Prefix = styled.span`
padding-top: 5px;
text-transform: lowercase;
line-height: 40px;
font-size: 12px;
font-weight: normal;
margin-right: 5px;
`

@ -13,6 +13,7 @@ export type SelectSubscriptionData = {
lexic: number, lexic: number,
lexic2: number, lexic2: number,
lexic3: number, lexic3: number,
min_price?: number,
packages: SelectSubscriptionPackages, packages: SelectSubscriptionPackages,
} }

Loading…
Cancel
Save