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. 48
      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,
events: 1020,
from_end_match: 15396,
from_price: 3992,
from_start_match: 15395,
gk: 3515,
go_back_to_match: 13405,

@ -31,6 +31,8 @@ import {
Pass,
} from '../SubscriptionsList/styled'
import { Price } from './styled'
export const ChooseSub = styled.div`
font-weight: 600;
font-size: 16px;
@ -87,27 +89,31 @@ export const SelectSubscriptionStep = () => {
</Header>
<Body marginTop={15}>
<ChooseSubList>
{
map(initialSubscription.data, (subscription, index) => (
<ChooseSubItem
key={subscription.id}
onClick={() => onItemClick(subscription, index)}
active={active === index}
>
<InfoWrapper>
<Pass>
<T9n t={subscription.lexic} />
</Pass>
<Name>
<T9n t={subscription.lexic2} />
</Name>
<Description>
<T9n t={subscription.lexic3} />
</Description>
</InfoWrapper>
</ChooseSubItem>
))
}
{map(initialSubscription.data, (subscription, index) => (
<ChooseSubItem
key={subscription.id}
onClick={() => onItemClick(subscription, index)}
active={active === index}
>
<InfoWrapper>
<Pass>
<T9n t={subscription.lexic} />
</Pass>
<Name>
<T9n t={subscription.lexic2} />
</Name>
<Description>
<T9n t={subscription.lexic3} />
</Description>
</InfoWrapper>
<Price
amount={subscription.min_price || 0}
currency={subscription.packages.month.all.currency_iso}
isFrom={Boolean(subscription.min_price)}
/>
</ChooseSubItem>
))}
</ChooseSubList>
</Body>
<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 {
Prefix,
PriceAmount,
PriceDetails,
PriceWrapper,
@ -14,6 +15,7 @@ type Props = {
amount: number,
className?: string,
currency?: string,
isFrom?: boolean,
perPeriod?: string | null,
}
@ -21,9 +23,19 @@ export const Price = ({
amount,
className,
currency = currencySymbols.RUB,
isFrom,
perPeriod,
}: Props) => (
<PriceWrapper className={className}>
{
isFrom
? (
<Prefix>
<T9n t='from_price' />
</Prefix>
)
: ''
}
<PriceAmount>{amount}</PriceAmount>
<PriceDetails>
<Currency>{currency}</Currency>

@ -55,3 +55,12 @@ export const Currency = styled.span`
export const Period = styled.span`
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,
lexic2: number,
lexic3: number,
min_price?: number,
packages: SelectSubscriptionPackages,
}

Loading…
Cancel
Save