diff --git a/public/images/edit-icon.svg b/public/images/edit-icon.svg new file mode 100644 index 00000000..e5cce7f4 --- /dev/null +++ b/public/images/edit-icon.svg @@ -0,0 +1,4 @@ + + + + diff --git a/src/features/AddCardForm/index.tsx b/src/features/AddCardForm/index.tsx new file mode 100644 index 00000000..31440386 --- /dev/null +++ b/src/features/AddCardForm/index.tsx @@ -0,0 +1,44 @@ +import { SolidButton } from 'features/UserAccount/styled' + +import { + Form, + Column, + ButtonsBlock, + Input, +} from './styled' + +export const AddCardForm = () => ( +
+ + + + + + + + + Сохранить + + +
+) diff --git a/src/features/AddCardForm/styled.tsx b/src/features/AddCardForm/styled.tsx new file mode 100644 index 00000000..58d40c41 --- /dev/null +++ b/src/features/AddCardForm/styled.tsx @@ -0,0 +1,34 @@ +import styled from 'styled-components/macro' + +import { Input as InputBase } from 'features/Common' +import { InputWrapper } from 'features/Common/Input/styled' + +export const Form = styled.form`` + +export const Column = styled.div` + display: flex; + flex-direction: row; + justify-content: space-between; + flex-wrap: wrap; +` + +export const ButtonsBlock = styled.div` + display: flex; + margin-top: 40px; +` + +export const Input = styled(InputBase).attrs(() => ({ + withError: false, +}))` + width: auto; + + ${InputWrapper} { + height: 50px; + padding: 0 24px; + margin-top: 10px; + } + + :first-child ${InputWrapper} { + margin-top: 0; + } +` diff --git a/src/features/App/AuthenticatedApp.tsx b/src/features/App/AuthenticatedApp.tsx index 16274879..092e6834 100644 --- a/src/features/App/AuthenticatedApp.tsx +++ b/src/features/App/AuthenticatedApp.tsx @@ -15,7 +15,7 @@ import { MatchPage } from 'features/MatchPage' import { PlayerPage } from 'features/PlayerPage' import { TournamentPage } from 'features/TournamentPage' import { ExtendedSearchStore, ExtendedSearchPage } from 'features/ExtendedSearchPage' -import { UserAccountForm } from 'features/UserAccount' +import { UserAccount } from 'features/UserAccount' import { MatchSwitchesStore } from 'features/MatchSwitches' import { UserFavoritesStore } from 'features/UserFavorites/store' @@ -36,7 +36,7 @@ export const AuthenticatedApp = () => { {/* в Switch как прямой children можно рендерить только Route или Redirect */} - + diff --git a/src/features/BuyMatchPopup/components/PaymentPeriods/index.tsx b/src/features/BuyMatchPopup/components/PaymentPeriods/index.tsx deleted file mode 100644 index ec5d5966..00000000 --- a/src/features/BuyMatchPopup/components/PaymentPeriods/index.tsx +++ /dev/null @@ -1,59 +0,0 @@ -import styled, { css } from 'styled-components/macro' - -import { SubscriptionType } from 'requests' - -import { T9n } from 'features/T9n' -import { useBuyMatchPopupStore } from 'features/BuyMatchPopup/store' - -const List = styled.ul` - display: flex; - padding: 0 35px; - margin-top: 9px; -` - -type ItemProps = { - active?: boolean, -} - -const Item = styled.li.attrs(() => ({ - tabIndex: 0, -}))` - width: 50%; - font-size: 20px; - line-height: 42px; - - display: flex; - align-items: center; - justify-content: center; - color: rgba(255, 255, 255, 0.5); - cursor: pointer; - - ${({ active }) => ( - active - ? css` - border-bottom: 3px solid #fff; - color: #fff; - ` - : '' - )} -` - -export const PaymentPeriods = () => { - const { onPeriodSelect, selectedPeriod } = useBuyMatchPopupStore() - return ( - - onPeriodSelect(SubscriptionType.Month)} - > - - - onPeriodSelect(SubscriptionType.Year)} - > - - - - ) -} diff --git a/src/features/BuyMatchPopup/components/Subscriptions/index.tsx b/src/features/BuyMatchPopup/components/Subscriptions/index.tsx index a1e79b80..e050f5a0 100644 --- a/src/features/BuyMatchPopup/components/Subscriptions/index.tsx +++ b/src/features/BuyMatchPopup/components/Subscriptions/index.tsx @@ -1,8 +1,9 @@ import styled from 'styled-components/macro' import { T9n } from 'features/T9n' +import { useBuyMatchPopupStore } from 'features/BuyMatchPopup' +import { PaymentPeriodTabs } from 'features/PaymentPeriodTabs' -import { PaymentPeriods } from '../PaymentPeriods' import { SubscriptionsList } from '../SubscriptionsList' const Wrapper = styled.div` @@ -20,12 +21,18 @@ const Title = styled.span` padding: 0 35px; ` -export const Subscriptions = () => ( - - - - <T9n t='choose_subscription' /> - - - -) +export const Subscriptions = () => { + const { onPeriodSelect, selectedPeriod } = useBuyMatchPopupStore() + return ( + + + + <T9n t='choose_subscription' /> + + + + ) +} diff --git a/src/features/Combobox/index.tsx b/src/features/Combobox/index.tsx index aaa60374..c387bf2c 100644 --- a/src/features/Combobox/index.tsx +++ b/src/features/Combobox/index.tsx @@ -36,6 +36,7 @@ export const Combobox = (props: Props) => { maxLength, title, withArrow, + withError, } = props const { @@ -105,7 +106,7 @@ export const Combobox = (props: Props) => { )} - + {withError && } ) } diff --git a/src/features/Combobox/types.tsx b/src/features/Combobox/types.tsx index 3a8e2125..eef97a98 100644 --- a/src/features/Combobox/types.tsx +++ b/src/features/Combobox/types.tsx @@ -28,4 +28,5 @@ export type Props = Pick, ( options: Array, value?: string, withArrow?: boolean, + withError?: boolean, } diff --git a/src/features/Common/Button/styled.tsx b/src/features/Common/Button/styled.tsx index b7543b77..fd00b4d6 100644 --- a/src/features/Common/Button/styled.tsx +++ b/src/features/Common/Button/styled.tsx @@ -13,6 +13,11 @@ const baseButtonStyles = css` font-style: normal; font-size: 20px; outline-color: white; + cursor: pointer; + + :disabled { + opacity: 0.5; + } ` export const outlineButtonStyles = css` @@ -31,7 +36,6 @@ export const solidButtonStyles = css` color: #fff; font-weight: bold; - cursor: pointer; border-color: transparent; background: ${({ theme: { colors } }) => colors.primary}; diff --git a/src/features/Common/Input/index.tsx b/src/features/Common/Input/index.tsx index a4c65069..47c1cf1d 100644 --- a/src/features/Common/Input/index.tsx +++ b/src/features/Common/Input/index.tsx @@ -18,6 +18,7 @@ import { type Props = { autoComplete?: string, + className?: string, defaultValue?: string, editIcon?: boolean, inputWidth?: number, @@ -33,10 +34,12 @@ type Props = { title?: string, type?: string, value?: string, + withError?: boolean, } & WrapperProps export const Input = ({ autoComplete = '', + className, defaultValue, editIcon = false, error, @@ -54,13 +57,14 @@ export const Input = ({ title, type, value, + withError = true, wrapperWidth, }: Props) => { const { translate } = useLexicsStore() const isUserAccountPage = useRouteMatch(PAGES.useraccount)?.isExact || false return ( - + + {editIcon && } - {editIcon && } - + {withError && } ) } diff --git a/src/features/Common/Input/styled.tsx b/src/features/Common/Input/styled.tsx index 01abfca1..ae1bfadd 100644 --- a/src/features/Common/Input/styled.tsx +++ b/src/features/Common/Input/styled.tsx @@ -228,9 +228,11 @@ export const Icon = styled.div<{ image: string }>` position: absolute; right: 22px; top: 50%; - width: 15px; - height: 25px; + width: 24px; + height: 24px; + transform: translateY(-50%); background-image: url(/images/${({ image }) => `${image}.svg`}); background-size: 100%; background-repeat: no-repeat; + cursor: pointer; ` diff --git a/src/features/Common/SportName/index.tsx b/src/features/Common/SportName/index.tsx index ed7a4678..44107cb3 100644 --- a/src/features/Common/SportName/index.tsx +++ b/src/features/Common/SportName/index.tsx @@ -1,19 +1,18 @@ import { SportTypes } from 'config' -import { getSportColor, getSportLexic } from 'helpers' - -import { useLexicsStore } from 'features/LexicsStore' +import { getSportLexic } from 'helpers' import { Text } from './styled' -type SportNameProps = { sport: SportTypes } - -export const SportName = ({ sport }: SportNameProps) => { - const { translate } = useLexicsStore() - - return ( - - {translate(getSportLexic(sport))} - - ) +type SportNameProps = { + className?: string, + sport: SportTypes, } + +export const SportName = ({ className, sport }: SportNameProps) => ( + +) diff --git a/src/features/Common/SportName/styled.tsx b/src/features/Common/SportName/styled.tsx index 86cce731..c07511e2 100644 --- a/src/features/Common/SportName/styled.tsx +++ b/src/features/Common/SportName/styled.tsx @@ -1,11 +1,19 @@ import styled from 'styled-components/macro' -import { devices } from 'config/devices' +import { devices, SportTypes } from 'config' -export const Text = styled.span<{ color: string }>` +import { getSportColor } from 'helpers' + +import { T9n } from 'features/T9n' + +type Props = { + sport: SportTypes, +} + +export const Text = styled(T9n)` margin-right: 10px; font-size: 11px; - color: ${({ color }) => color}; + color: ${({ sport }) => getSportColor(sport)}; letter-spacing: 0.02em; text-transform: uppercase; diff --git a/src/features/Menu/index.tsx b/src/features/Menu/index.tsx index 1035e217..00e7b27c 100644 --- a/src/features/Menu/index.tsx +++ b/src/features/Menu/index.tsx @@ -32,7 +32,7 @@ export const Menu = () => { } - + diff --git a/src/features/PaymentPeriodTabs/index.tsx b/src/features/PaymentPeriodTabs/index.tsx new file mode 100644 index 00000000..c80a4342 --- /dev/null +++ b/src/features/PaymentPeriodTabs/index.tsx @@ -0,0 +1,65 @@ +import styled, { css } from 'styled-components/macro' + +import { SubscriptionType } from 'requests' + +import { T9n } from 'features/T9n' + +const List = styled.ul` + display: flex; + padding: 0 35px; + margin-top: 9px; +` + +type ItemProps = { + active?: boolean, +} + +export const Item = styled.li.attrs(() => ({ + tabIndex: 0, +}))` + width: 50%; + font-size: 20px; + line-height: 42px; + + display: flex; + align-items: center; + justify-content: center; + color: rgba(255, 255, 255, 0.5); + cursor: pointer; + + ${({ active }) => ( + active + ? css` + border-bottom: 3px solid #fff; + color: #fff; + ` + : '' + )} +` + +type Props = { + className?: string, + onPeriodSelect: (period: SubscriptionType) => void, + selectedPeriod: SubscriptionType, +} + +export const PaymentPeriodTabs = ({ + className, + onPeriodSelect, + selectedPeriod, +}: Props) => ( + + onPeriodSelect(SubscriptionType.Month)} + > + + + onPeriodSelect(SubscriptionType.Year)} + > + + + +) diff --git a/src/features/UserAccount/components/BankCard/index.tsx b/src/features/UserAccount/components/BankCard/index.tsx new file mode 100644 index 00000000..a132f4c5 --- /dev/null +++ b/src/features/UserAccount/components/BankCard/index.tsx @@ -0,0 +1,27 @@ +import { Radio } from 'features/Common/Radio' + +import { InlineButton } from '../../styled' +import { CardNumberWrapper } from './styled' + +type Props = { + checked?: boolean, + number: string, + type: 'visa' | 'mastercard', +} + +export const BankCard = ({ + checked, + number, + type, +}: Props) => ( + + {}} + /> + + Удалить + + +) diff --git a/src/features/UserAccount/components/BankCard/styled.tsx b/src/features/UserAccount/components/BankCard/styled.tsx new file mode 100644 index 00000000..2b872d73 --- /dev/null +++ b/src/features/UserAccount/components/BankCard/styled.tsx @@ -0,0 +1,52 @@ +import styled from 'styled-components/macro' + +import { devices } from 'config/devices' + +import { Label } from 'features/Common/Radio/styled' +import { RadioSvg } from 'features/Common/Radio/Icon' + +import { InlineButton } from '../../styled' + +export const CardNumberWrapper = styled.div` + width: 100%; + height: 50px; + display: flex; + align-items: center; + justify-content: space-between; + background-color: #3F3F3F; + border-radius: 2px; + margin-bottom: 10px; + overflow: hidden; + + ${Label} { + font-size: 20px; + line-height: 24px; + margin-left: 25px; + text-transform: capitalize; + } + + ${RadioSvg} { + margin-right: 24px; + } + + @media ${devices.tablet} { + max-width: 415px; + + ${Label} { + font-size: 16px; + } + } + + @media ${devices.mobile} { + max-width: 335px; + + ${Label} { + font-size: 14px; + line-height: 24px; + } + } + + :hover ${InlineButton} { + transform: translateX(0); + } +` diff --git a/src/features/UserAccount/components/CardNumber/index.tsx b/src/features/UserAccount/components/CardNumber/index.tsx deleted file mode 100644 index fc5f5e93..00000000 --- a/src/features/UserAccount/components/CardNumber/index.tsx +++ /dev/null @@ -1,29 +0,0 @@ -import { Radio } from 'features/Common/Radio' -import { T9n } from 'features/T9n' - -import { VisaLogoWrapper } from '../VisaLogo' -import { CardNumberWrapper, CardNumberTextWrapper } from './styled' - -type Props = { - checked?: boolean, - label: string, - visa?: boolean, -} - -export const CardNumber = ({ - checked, - label, - visa, -}: Props) => ( - - {}} - /> - - - - - -) diff --git a/src/features/UserAccount/components/CardNumber/styled.tsx b/src/features/UserAccount/components/CardNumber/styled.tsx deleted file mode 100644 index 025a8dde..00000000 --- a/src/features/UserAccount/components/CardNumber/styled.tsx +++ /dev/null @@ -1,105 +0,0 @@ -import styled from 'styled-components/macro' - -import { devices } from 'config/devices' - -import { Label } from 'features/Common/Radio/styled' -import { PriceAmount, PriceDetails } from 'features/Price/styled' - -export const CardNumberWrapper = styled.div` - display: flex; - align-items: center; - justify-content: space-between; - height: 48px; - background-color: #3F3F3F; - border-radius: 2px; - margin: 20px 0; - width: 100%; - - ${Label} { - font-size: 20px; - line-height: 24px; - - &::before { - margin-left: 22px; - } - } - - @media ${devices.tablet} { - max-width: 415px; - - ${Label} { - font-size: 16px; - - &::before { - margin-left: 12px; - margin-right: 12px; - } - } - } - - @media ${devices.mobile} { - max-width: 335px; - margin: 10px 0; - - ${Label} { - font-size: 14px; - line-height: 24px; - - &::before { - margin-left: 6px; - margin-right: 6px; - } - } - } -` - -export const TextWrapper = styled.p` - font-family: Montserrat, sans-serif; - font-style: normal; - font-weight: normal; - font-size: 14px; - line-height: 24px; - color: #666666; - white-space: nowrap; - margin-right: 0; - - &:hover { - cursor: pointer; - } -` - -export const CardNumberTextWrapper = styled(TextWrapper)` - margin-right: 24px; - - @media ${devices.mobile} { - margin-right: 5px; - } -` - -type Props = { - noMarginRight?: boolean, -} - -export const PriceWrapper = styled.div` - margin-left: auto; - margin-right: 24px; - - ${PriceAmount} { - font-size: 24px; - line-height: 21px; - } - - ${PriceDetails} { - font-size: 12px; - line-height: 12px; - } - - @media ${devices.mobile} { - ${PriceAmount} { - font-size: 17px; - } - ${PriceDetails} { - font-size: 10px; - } - } -` diff --git a/src/features/UserAccount/components/PageBankCards/index.tsx b/src/features/UserAccount/components/PageBankCards/index.tsx new file mode 100644 index 00000000..dabb85d2 --- /dev/null +++ b/src/features/UserAccount/components/PageBankCards/index.tsx @@ -0,0 +1,33 @@ +import { useToggle } from 'hooks' + +import { T9n } from 'features/T9n' +import { AddCardForm } from 'features/AddCardForm' + +import { BankCard } from '../BankCard' +import { OutlineButton, Icon } from '../../styled' +import { FormWrapper, Wrapper } from './styled' + +export const PageBankCards = () => { + const { isOpen, toggle } = useToggle() + + return ( + + + + + + {isOpen + ? + : ( + + + + + )} + + + ) +} diff --git a/src/features/UserAccount/components/PageBankCards/styled.tsx b/src/features/UserAccount/components/PageBankCards/styled.tsx new file mode 100644 index 00000000..b19757ba --- /dev/null +++ b/src/features/UserAccount/components/PageBankCards/styled.tsx @@ -0,0 +1,14 @@ +import styled from 'styled-components/macro' + +import { devices } from 'config' + +export const Wrapper = styled.div`` + +export const FormWrapper = styled.div` + width: 560px; + margin-top: 40px; + + @media ${devices.tablet} { + max-width: auto; + } +` diff --git a/src/features/UserAccount/components/PagePaymentsHistory/index.tsx b/src/features/UserAccount/components/PagePaymentsHistory/index.tsx new file mode 100644 index 00000000..707d2e97 --- /dev/null +++ b/src/features/UserAccount/components/PagePaymentsHistory/index.tsx @@ -0,0 +1,57 @@ +import { + Table, + THead, + Th, + TBody, + TRow, + Td, +} from './styled' + +export const PagePaymentsHistory = () => ( + + + + + + + + + + + + + + + + + + + + + +
+ Дата платежа + + Подписка + + Тип + + Сумма +
+ 12.01.21 + + Матч Спартак-Динамо + + На год + + 1999 руб. + + 22.12.20 + + Все матчи Спартака + + На месяц + + 999 руб. +
+) diff --git a/src/features/UserAccount/components/PagePaymentsHistory/styled.tsx b/src/features/UserAccount/components/PagePaymentsHistory/styled.tsx new file mode 100644 index 00000000..10d583e0 --- /dev/null +++ b/src/features/UserAccount/components/PagePaymentsHistory/styled.tsx @@ -0,0 +1,58 @@ +import styled from 'styled-components/macro' + +import { devices } from 'config' + +export const Table = styled.table`` + +export const THead = styled.thead`` + +export const Th = styled.th` + width: 250px; + padding: 0; + padding-bottom: 25px; + font-weight: 500; + font-size: 18px; + line-height: 22px; + text-transform: uppercase; + color: rgba(255, 255, 255, 0.6); + text-align: start; + + :nth-child(1) { + width: 250px; + } + + :nth-child(2) { + width: 312px; + } + + :nth-child(3) { + width: 190px; + } + + @media ${devices.tablet} { + :nth-child(1) { + width: 200px; + } + + :nth-child(2) { + width: 270px; + } + + :nth-child(3) { + width: 150px; + } + } +` + +export const TBody = styled.tbody`` + +export const TRow = styled.tr`` + +export const Td = styled.td` + padding: 0; + padding-bottom: 20px; + font-size: 18px; + line-height: 22px; + text-align: start; + color: #FFFFFF; +` diff --git a/src/features/UserAccount/hooks/useCities.tsx b/src/features/UserAccount/components/PagePersonalInfo/hooks/useCities.tsx similarity index 100% rename from src/features/UserAccount/hooks/useCities.tsx rename to src/features/UserAccount/components/PagePersonalInfo/hooks/useCities.tsx diff --git a/src/features/UserAccount/hooks/useCountries.tsx b/src/features/UserAccount/components/PagePersonalInfo/hooks/useCountries.tsx similarity index 100% rename from src/features/UserAccount/hooks/useCountries.tsx rename to src/features/UserAccount/components/PagePersonalInfo/hooks/useCountries.tsx diff --git a/src/features/UserAccount/hooks/useUserInfo.tsx b/src/features/UserAccount/components/PagePersonalInfo/hooks/useUserInfo.tsx similarity index 100% rename from src/features/UserAccount/hooks/useUserInfo.tsx rename to src/features/UserAccount/components/PagePersonalInfo/hooks/useUserInfo.tsx diff --git a/src/features/UserAccount/hooks/useUserInfoForm.tsx b/src/features/UserAccount/components/PagePersonalInfo/hooks/useUserInfoForm.tsx similarity index 100% rename from src/features/UserAccount/hooks/useUserInfoForm.tsx rename to src/features/UserAccount/components/PagePersonalInfo/hooks/useUserInfoForm.tsx diff --git a/src/features/UserAccount/hooks/useValidateForm.tsx b/src/features/UserAccount/components/PagePersonalInfo/hooks/useValidateForm.tsx similarity index 100% rename from src/features/UserAccount/hooks/useValidateForm.tsx rename to src/features/UserAccount/components/PagePersonalInfo/hooks/useValidateForm.tsx diff --git a/src/features/UserAccount/components/PagePersonalInfo/index.tsx b/src/features/UserAccount/components/PagePersonalInfo/index.tsx new file mode 100644 index 00000000..753dc2b0 --- /dev/null +++ b/src/features/UserAccount/components/PagePersonalInfo/index.tsx @@ -0,0 +1,151 @@ +import { formIds } from 'config/form' + +import { Combobox } from 'features/Combobox' +import { Input } from 'features/Common' +import { T9n } from 'features/T9n' +import { Error } from 'features/Common/Input/styled' + +import { useUserInfo } from './hooks/useUserInfo' + +import { SolidButton } from '../../styled' +import { Form, ButtonWrapper } from './styled' + +const labelWidth = 76 + +const { + address1, + address2, + city, + country, + firstname, + formError, + lastname, + password, + phone, + region, +} = formIds + +export const PagePersonalInfo = () => { + const { + cities, + countries, + handleSubmit, + onCitySelect, + onCountrySelect, + onPhoneBlur, + onRegionOrCityChange, + readFormError, + readFormValue, + saveButton, + updateFormValue, + } = useUserInfo() + + return ( +
+ + + + + + + + + + + + + + + + + ) +} diff --git a/src/features/UserAccount/components/PagePersonalInfo/styled.tsx b/src/features/UserAccount/components/PagePersonalInfo/styled.tsx new file mode 100644 index 00000000..e2969935 --- /dev/null +++ b/src/features/UserAccount/components/PagePersonalInfo/styled.tsx @@ -0,0 +1,37 @@ +import styled from 'styled-components/macro' + +import { devices } from 'config/devices' + +import { Column, InputWrapper } from 'features/Common/Input/styled' + +export const Form = styled.div` + min-width: 560px; + + ${Column}:first-child ${InputWrapper} { + margin-top: 0; + } + + ${InputWrapper} { + height: 50px; + margin-top: 10px; + } + + @media ${devices.tablet} { + min-width: auto; + } +` + +export const ButtonWrapper = styled.div` + display: flex; + flex-direction: column; + align-items: start; + margin-top: 35px; + + @media ${devices.tablet} { + align-self: center; + } + + @media ${devices.mobile} { + width: 335px; + } +` diff --git a/src/features/UserAccount/components/PageSubscriptions/index.tsx b/src/features/UserAccount/components/PageSubscriptions/index.tsx new file mode 100644 index 00000000..e139e0a9 --- /dev/null +++ b/src/features/UserAccount/components/PageSubscriptions/index.tsx @@ -0,0 +1,97 @@ +import map from 'lodash/map' + +import { SportTypes } from 'config' + +import type { MatchSubscriptions } from 'requests' +import { SubscriptionType } from 'requests' + +import { useToggle } from 'hooks' + +import { SubscriptionModal } from '../SubscriptionsModal' +import { UserSubscriptionsList } from '../UserSubscriptionsList' +import { Wrapper, SubscriptionsWrapper } from './styled' +import { SolidButton, Icon } from '../../styled' + +const data: Record = { + [SportTypes.FOOTBALL]: [ + { + description: 'Доступ к прямой трансляции, записи и хайлайты матча', + header: 'подписка на матч спартак-динамо', + price: 999, + subscription_id: 1, + type: SubscriptionType.Month, + }, + { + description: 'все матчи спартака в сезоне 2020-2021', + header: 'подписка на матч спартак-динамо', + price: 999, + subscription_id: 2, + type: SubscriptionType.Month, + }, + { + description: 'Доступ к прямой трансляции, записи и хайлайты матча', + header: 'подписка на матч спартак-динамо', + price: 999, + subscription_id: 3, + type: SubscriptionType.Month, + }, + ], + [SportTypes.BASKETBALL]: [], + [SportTypes.HOCKEY]: [ + { + description: 'все матчи спартака в сезоне 2020-2021', + header: 'подписка на матч спартак-динамо', + price: 999, + subscription_id: 4, + type: SubscriptionType.Month, + }, + { + description: 'Доступ к прямой трансляции, записи и хайлайты матча', + header: 'подписка на матч спартак-динамо', + price: 999, + subscription_id: 5, + type: SubscriptionType.Month, + }, + { + description: 'Доступ к прямой трансляции, записи и хайлайты матча', + header: 'подписка на матч спартак-динамо', + price: 999, + subscription_id: 6, + type: SubscriptionType.Month, + }, + ], +} + +export const PageSubscriptions = () => { + const { + close, + isOpen, + open, + } = useToggle() + + return ( + + + { + map(data, (subscriptions, sport: SportTypes) => ( + + )) + } + + + + + Выбрать подписку + + + + + ) +} diff --git a/src/features/UserAccount/components/PageSubscriptions/styled.tsx b/src/features/UserAccount/components/PageSubscriptions/styled.tsx new file mode 100644 index 00000000..fac54bff --- /dev/null +++ b/src/features/UserAccount/components/PageSubscriptions/styled.tsx @@ -0,0 +1,16 @@ +import styled from 'styled-components/macro' + +import { popupScrollbarStyles } from 'features/PopupComponents' + +export const Wrapper = styled.div` + width: 100%; +` + +export const SubscriptionsWrapper = styled.div` + width: 100%; + height: 480px; + overflow-y: auto; + margin-bottom: 28px; + + ${popupScrollbarStyles} +` diff --git a/src/features/UserAccount/components/PageTitle/index.tsx b/src/features/UserAccount/components/PageTitle/index.tsx deleted file mode 100644 index bc7661df..00000000 --- a/src/features/UserAccount/components/PageTitle/index.tsx +++ /dev/null @@ -1,26 +0,0 @@ -import { Link, useLocation } from 'react-router-dom' - -import { PAGES } from 'config' - -import { Logo } from 'features/Logo' -import { BlockTitle } from 'features/Login/styled' - -import { PageTitleWrapper, TitleTextWrapper } from './styled' - -type Props = { - titleText: string, -} - -export const PageTitle = ({ titleText }: Props) => { - const location = useLocation() - return ( - - - - - - - - - ) -} diff --git a/src/features/UserAccount/components/PageTitle/styled.tsx b/src/features/UserAccount/components/PageTitle/styled.tsx deleted file mode 100644 index 7ece73e8..00000000 --- a/src/features/UserAccount/components/PageTitle/styled.tsx +++ /dev/null @@ -1,30 +0,0 @@ -import styled from 'styled-components/macro' - -import { devices } from 'config/devices' - -import { BlockTitle } from 'features/Login/styled' - -export const PageTitleWrapper = styled.div` - display: flex; - justify-content: flex-start; - align-items: flex-end; - - @media ${devices.tablet} { - flex-direction: column; - align-items: center; - } -` - -export const TitleTextWrapper = styled.div` - margin-left: 14px; - - ${BlockTitle} { - margin-bottom: 0; - line-height: 28px; - } - - @media ${devices.tablet} { - margin-left: 0; - margin-top: 20px; - } -` diff --git a/src/features/UserAccount/components/PlusIcon/index.tsx b/src/features/UserAccount/components/PlusIcon/index.tsx deleted file mode 100644 index 9bc65a52..00000000 --- a/src/features/UserAccount/components/PlusIcon/index.tsx +++ /dev/null @@ -1 +0,0 @@ -export * from './styled' diff --git a/src/features/UserAccount/components/PlusIcon/styled.tsx b/src/features/UserAccount/components/PlusIcon/styled.tsx deleted file mode 100644 index f7e21eff..00000000 --- a/src/features/UserAccount/components/PlusIcon/styled.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import styled from 'styled-components/macro' - -import { devices } from 'config/devices' - -export const PlusIconWrapper = styled.span` - width: 20px; - height: 20px; - margin-right: 22px; - margin-left: 10px; - background: url('/images/plusIcon.svg') no-repeat; - - @media ${devices.laptop} { - background: url('/images/plusIcon-gray.svg') no-repeat; - } -` diff --git a/src/features/UserAccount/components/Subscription/index.tsx b/src/features/UserAccount/components/Subscription/index.tsx deleted file mode 100644 index c8afa5db..00000000 --- a/src/features/UserAccount/components/Subscription/index.tsx +++ /dev/null @@ -1,65 +0,0 @@ -import { Price } from 'features/Price' -import { Radio } from 'features/Common/Radio' -import { Checkbox } from 'features/Common/Checkbox' - -import { - CheckboxWrapper, - SubscriptionWrapper, - BoldTextWrapper, - NormalTextWrapper, -} from './styled' -import { PriceWrapper } from '../CardNumber/styled' - -type Props = { - amount: number, - checked?: boolean, - id: string, - inputType?: string, - label?: string, - noMarginBottom?: boolean, - noMarginTop?: boolean, - packageAction?: string, - packageName?: string, - selectSubscription: () => void, -} - -export const Subscription = ({ - amount, - checked, - id, - inputType, - label, - noMarginBottom, - noMarginTop, - packageAction, - packageName, - selectSubscription, -}: Props) => ( - - {inputType === 'radio' && ( - - )} - {inputType === 'checkbox' && ( - - - - )} - {packageName && {packageName}} - {packageAction && {packageAction}} - - - - -) diff --git a/src/features/UserAccount/components/Subscription/styled.tsx b/src/features/UserAccount/components/Subscription/styled.tsx deleted file mode 100644 index b179b50a..00000000 --- a/src/features/UserAccount/components/Subscription/styled.tsx +++ /dev/null @@ -1,84 +0,0 @@ -import styled, { css } from 'styled-components/macro' - -import { Label as CheckboxLabel } from 'features/Common/Checkbox/styled' -import { Label as RadioLabel } from 'features/Common/Radio/styled' - -import { TextWrapper } from '../CardNumber/styled' - -type Props = { - noMarginBottom?: boolean, - noMarginTop?: boolean, -} - -export const SubscriptionWrapperStyles = css` - display: flex; - align-items: center; - justify-content: flex-start; - height: 48px; - background-color: #3F3F3F; - border-top: ${({ noMarginBottom, noMarginTop }) => (noMarginBottom && noMarginTop ? '1px solid #000' : '')}; - border-bottom: ${({ noMarginBottom, noMarginTop }) => (noMarginBottom && noMarginTop ? '1px solid #000' : '')}; - border-radius: ${({ noMarginBottom, noMarginTop }) => { - switch (true) { - case noMarginTop && noMarginBottom: - return '0' - case noMarginTop: - return '0 0 2px 2px' - case noMarginBottom: - return '2px 2px 0 0' - default: - return '2px' - } - }}; - - - - margin-top: ${({ noMarginTop }) => (noMarginTop ? '0' : '20px')}; - margin-bottom: ${({ noMarginBottom }) => (noMarginBottom ? '0' : '20px')}; - width: 100%; - ${RadioLabel}::before { - margin-left: 22px; - } -` - -export const SubscriptionWrapper = styled.div` - ${SubscriptionWrapperStyles}; - - label{ - font-size: 16px; - } - &:nth-child(n+1) { - border-bottom: ${({ noMarginBottom }) => (noMarginBottom ? '1px solid #000' : '')}; - border-top: ${({ noMarginBottom, noMarginTop }) => (noMarginBottom && noMarginTop ? 'none' : '')}; - } -` - -export const CheckboxWrapper = styled.div` - ${CheckboxLabel} { - font-weight: bold; - font-size: 16px; - line-height: 24px; - - &::before { - margin-left: 22px; - } - } -` - -export const BoldTextWrapper = styled(TextWrapper)` - color: #fff; - font-weight: bold; - font-size: 20px; - margin-right: 24px; - - &:hover { - cursor: default; -} -` - -export const NormalTextWrapper = styled(TextWrapper)` - color: #fff; - font-weight: normal; - font-size: 16px; - margin-right: 24px; -` diff --git a/src/features/UserAccount/components/SubscriptionsBySport/index.tsx b/src/features/UserAccount/components/SubscriptionsBySport/index.tsx new file mode 100644 index 00000000..030df53f --- /dev/null +++ b/src/features/UserAccount/components/SubscriptionsBySport/index.tsx @@ -0,0 +1,105 @@ +import styled from 'styled-components/macro' + +import map from 'lodash/map' + +import { SportTypes } from 'config' + +import { SubscriptionType } from 'requests' + +import { popupScrollbarStyles } from 'features/PopupComponents' + +import { SubscriptionsList } from '../SubscriptionsList' + +type Subscription = { + header: string, + id: number, + price: number, + type: SubscriptionType, +} + +export type Subscriptions = Array + +const Wrapper = styled.div` + width: 100%; + height: 474px; + overflow-y: auto; + margin-top: 36px; + + ${popupScrollbarStyles} +` + +const data: Record = { + [SportTypes.FOOTBALL]: [ + { + header: 'Российская премьер-лига', + id: 1, + price: 199, + type: SubscriptionType.Month, + }, + { + header: 'Primera División', + id: 2, + price: 999, + type: SubscriptionType.Month, + }, + { + header: 'Manchester United', + id: 3, + price: 999, + type: SubscriptionType.Month, + }, + { + header: 'Российская премьер-лига', + id: 4, + price: 199, + type: SubscriptionType.Month, + }, + ], + [SportTypes.HOCKEY]: [ + { + header: 'Российская премьер-лига', + id: 1, + price: 199, + type: SubscriptionType.Month, + }, + { + header: 'Primera División', + id: 2, + price: 999, + type: SubscriptionType.Month, + }, + { + header: 'Manchester United', + id: 3, + price: 999, + type: SubscriptionType.Month, + }, + { + header: 'Российская премьер-лига', + id: 4, + price: 199, + type: SubscriptionType.Month, + }, + { + header: 'Российская премьер-лига', + id: 5, + price: 199, + type: SubscriptionType.Month, + }, + ], + [SportTypes.BASKETBALL]: [], +} + +export const SubscriptionsBySport = () => ( + + { + map(data, (subscriptions, sport: SportTypes) => ( + + )) + } + +) diff --git a/src/features/UserAccount/components/SubscriptionsForm/index.tsx b/src/features/UserAccount/components/SubscriptionsForm/index.tsx deleted file mode 100644 index 9974933e..00000000 --- a/src/features/UserAccount/components/SubscriptionsForm/index.tsx +++ /dev/null @@ -1,97 +0,0 @@ -import { Fragment } from 'react' - -import map from 'lodash/map' -import isNumber from 'lodash/isNumber' -import isArray from 'lodash/isArray' -import find from 'lodash/find' - -import type { SportList } from 'requests/getSportList' - -import { useLexicsStore } from 'features/LexicsStore' - -import type { Subscription, UserSubscriptions } from '../../hooks/useUserSubscriptions' -import { UserAccountButton } from '../UserAccountButton' -import { UserAccountSubscription } from '../UserAccountSubscription' -import { UserAccountSubscriptionMatch } from '../UserAccountSubscriptionMatch' -import { TextNoBorder } from '../TextNoBorder' - -import { - UserAccountBlockTitle, - SubscriptionTitle, -} from './styled' - -type Props = { - deleteUserSubscription: (subscription: Subscription, sport: number) => void, - open: () => void, - selectedSubscription: number | null, - selectedSubscriptionLexic: string, - sportList: SportList, - userSubscriptions: any, -} - -export const SubscriptionsForm = ({ - deleteUserSubscription, - open, - selectedSubscription, - selectedSubscriptionLexic, - sportList, - userSubscriptions, -}: Props) => { - const { translate } = useLexicsStore() - - return ( - - - {isNumber(selectedSubscription) && ( - - )} - {map(userSubscriptions, (subscription) => { - const sportName = find(sportList, (item) => subscription.sport === item.id) - return ( - - {sportName && } - {map(subscription, (item: UserSubscriptions) => { - if (isArray(item)) { - return map(item, (subscriptionObj) => { - if (subscriptionObj.date) { - return ( - deleteUserSubscription(subscriptionObj, subscription.sport) - } - /> - ) - } - return ( - deleteUserSubscription(subscriptionObj, subscription.sport) - } - /> - ) - }) - } - return null - })} - - ) - })} - - - - ) -} diff --git a/src/features/UserAccount/components/SubscriptionsForm/styled.tsx b/src/features/UserAccount/components/SubscriptionsForm/styled.tsx deleted file mode 100644 index 1fdab860..00000000 --- a/src/features/UserAccount/components/SubscriptionsForm/styled.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import styled from 'styled-components/macro' - -import { devices } from 'config/devices' - -import { BlockTitle } from 'features/Login/styled' -import { T9n } from 'features/T9n' - -export const UserAccountBlockTitle = styled(BlockTitle)` - align-self: flex-start; - - @media ${devices.tablet} { - align-self: center; - } -` - -export const SubscriptionTitle = styled(T9n)` - color: white; - font-weight: 500; - font-size: 25px; - align-self: flex-start; - margin-top: 40px; -` diff --git a/src/features/UserAccount/components/SubscriptionsList/index.tsx b/src/features/UserAccount/components/SubscriptionsList/index.tsx new file mode 100644 index 00000000..59aeb164 --- /dev/null +++ b/src/features/UserAccount/components/SubscriptionsList/index.tsx @@ -0,0 +1,48 @@ +import isEmpty from 'lodash/isEmpty' +import map from 'lodash/map' + +import { SportTypes } from 'config' + +import type { Subscriptions } from '../SubscriptionsBySport' +import { + Wrapper, + SportName, + Header, + Count, + List, + Item, + Checkbox, + Price, +} from './styled' + +type Props = { + list: Subscriptions, + sport: SportTypes, +} + +export const SubscriptionsList = ({ list, sport }: Props) => { + if (isEmpty(list)) return null + return ( + +
+ + 2 +
+ + { + map(list, ({ + header, + id, + price, + type, + }) => ( + + + + + )) + } + +
+ ) +} diff --git a/src/features/UserAccount/components/SubscriptionsList/styled.tsx b/src/features/UserAccount/components/SubscriptionsList/styled.tsx new file mode 100644 index 00000000..53575c0e --- /dev/null +++ b/src/features/UserAccount/components/SubscriptionsList/styled.tsx @@ -0,0 +1,83 @@ +import styled, { css } from 'styled-components/macro' + +import { Checkbox as CheckboxBase, SportName as SportNameBase } from 'features/Common' +import { CheckboxSvg } from 'features/Common/Checkbox/Icon' +import { Label } from 'features/Common/Checkbox/styled' + +import { Price as BasePrice } from 'features/Price' +import { PriceAmount, PriceDetails } from 'features/Price/styled' + +export const Wrapper = styled.div` + :not(:first-child) { + margin-top: 21px; + } +` + +export const Header = styled.div` + display: flex; + padding: 0 90px; +` + +const textStyles = css` + font-style: normal; + font-weight: normal; + font-size: 20px; + line-height: 21px; +` + +export const SportName = styled(SportNameBase)` + color: #fff; + ${textStyles} +` + +export const Count = styled.span` + color: rgba(255, 255, 255, 0.5); + ${textStyles} +` + +export const List = styled.ul` + margin-top: 4px; + padding-left: 40px; + padding-right: 32px; +` + +export const Item = styled.li` + height: 50px; + display: flex; + justify-content: space-between; + align-items: center; + font-weight: 600; + font-size: 20px; + line-height: 50px; + color: #fff; +` + +export const Checkbox = styled(CheckboxBase)` + align-items: center; + + ${CheckboxSvg} { + margin-right: 25px; + align-self: center; + } + + ${Label} { + font-style: normal; + font-weight: 600; + font-size: 20px; + line-height: 50px; + } +` + +export const Price = styled(BasePrice)` + ${PriceAmount} { + font-size: 24px; + line-height: 24px; + font-weight: normal; + } + + ${PriceDetails} { + font-weight: 500; + font-size: 12px; + line-height: 18px; + } +` diff --git a/src/features/UserAccount/components/SubscriptionsModal/index.tsx b/src/features/UserAccount/components/SubscriptionsModal/index.tsx index 8af8d061..0bec2f0c 100644 --- a/src/features/UserAccount/components/SubscriptionsModal/index.tsx +++ b/src/features/UserAccount/components/SubscriptionsModal/index.tsx @@ -1,68 +1,39 @@ -import map from 'lodash/map' - -import type { SubscriptionType } from 'requests/getSubscriptions' - -import { Modal } from 'features/Modal' -import { useLexicsStore } from 'features/LexicsStore' - -import { Subscription } from '../Subscription' +import { SubscriptionType } from 'requests' +import { SubscriptionsBySport } from '../SubscriptionsBySport' import { - AddSubscriptionModal, - Line, - ModalTitle, - SubscriptionsWrapper, + Modal, + PaymentPeriodTabs, + Header, + ButtonsWrapper, SaveButton, + CancelButton, } from './styled' type Props = { close: () => void, isOpen: boolean, - saveSubscription: () => void, - selectedSubscription: number | null, - setSelectedSubscription: (arg: number | null) => void, - subscriptions: Array, } export const SubscriptionModal = ({ close, isOpen, - saveSubscription, - selectedSubscription, - setSelectedSubscription, - subscriptions, -}: Props) => { - const { translate } = useLexicsStore() +}: Props) => ( + +
+ {}} + selectedPeriod={SubscriptionType.Month} + /> + - return ( - - - - - - {map(subscriptions, (subscription) => ( - { - setSelectedSubscription(subscription.id) - }} - /> - ))} - - - Save - - - - ) -} + + Отменить + Сохранить + + +) diff --git a/src/features/UserAccount/components/SubscriptionsModal/styled.tsx b/src/features/UserAccount/components/SubscriptionsModal/styled.tsx index 601131f5..42e5a81b 100644 --- a/src/features/UserAccount/components/SubscriptionsModal/styled.tsx +++ b/src/features/UserAccount/components/SubscriptionsModal/styled.tsx @@ -1,62 +1,74 @@ -import styled from 'styled-components/macro' +import styled, { css } from 'styled-components/macro' import { devices } from 'config/devices' -import { customScrollbar, customStylesMixin } from 'features/Common' +import { PaymentPeriodTabs as PaymentPeriodTabsBase, Item } from 'features/PaymentPeriodTabs' +import { popupScrollbarStyles } from 'features/PopupComponents' +import { Modal as ModalBase } from 'features/Modal' +import { ModalWindow } from 'features/Modal/styled' import { T9n } from 'features/T9n' -import { OutlinedButton } from '../../styled' +import { SolidButton, OutlineButton } from '../../styled' -export const AddSubscriptionModal = styled.div` - width: 538px; - height: 452px; - display: flex; - flex-direction: column; - align-items: center; +export const Modal = styled(ModalBase)` + background-color: rgba(0, 0, 0, 0.7); - @media ${devices.mobile} { - width: 100%; - } + ${ModalWindow} { + height: 728px; + width: 615px; + padding: 0; + border-radius: 5px; + } ` -export const ModalTitle = styled(T9n)` +export const Header = styled(T9n)` display: block; + width: 100%; + padding-top: 18px; + font-weight: bold; font-size: 24px; - font-weight: normal; + line-height: 50px; + text-align: center; +` + +export const PaymentPeriodTabs = styled(PaymentPeriodTabsBase)` + padding: 0 40px; + margin-top: 9px; - @media ${devices.mobile} { - font-size: 18px; + ${Item} { + line-height: 36px; } ` -export const Line = styled.hr` - position:absolute; - width: 100%; - top: 40px; - height: 1px; - border: 1px solid #3F3F3F; +export const ButtonsWrapper = styled.div` + display: flex; + padding: 0 40px; + margin-top: 16px; ` -export const SaveButton = styled(OutlinedButton)` - width: 192px; - height: 36px; - display: block; +const buttonStyles = css` + width: 50%; font-weight: normal; - margin-left: auto; - margin-top: auto; + font-size: 20px; + line-height: 50px; + justify-content: center; +` - @media ${devices.mobile} { - margin-right: auto; - } +export const SaveButton = styled(SolidButton)` + ${buttonStyles} +` + +export const CancelButton = styled(OutlineButton)` + ${buttonStyles} + margin-right: 10px; ` export const SubscriptionsWrapper = styled.div` margin-top: 45px; width: 100%; height: 100%; - overflow: auto; - ${customScrollbar}; - ${customStylesMixin}; + overflow-y: auto; + ${popupScrollbarStyles}; @media ${devices.tablet} { background-color: transparent; diff --git a/src/features/UserAccount/components/TextNoBorder/index.tsx b/src/features/UserAccount/components/TextNoBorder/index.tsx deleted file mode 100644 index c37b59a0..00000000 --- a/src/features/UserAccount/components/TextNoBorder/index.tsx +++ /dev/null @@ -1,23 +0,0 @@ -import { Price } from 'features/Price' - -import { TextNoBorderWrapper, TextNoBorderTextWrapper } from './styled' -import { PriceWrapper } from '../CardNumber/styled' - -type Props = { - amount: number, - text: string, -} - -export const TextNoBorder = ({ - amount, - text, -}: Props) => ( - - - {text} - - - - - -) diff --git a/src/features/UserAccount/components/TextNoBorder/styled.tsx b/src/features/UserAccount/components/TextNoBorder/styled.tsx deleted file mode 100644 index b6c7337d..00000000 --- a/src/features/UserAccount/components/TextNoBorder/styled.tsx +++ /dev/null @@ -1,40 +0,0 @@ -import styled from 'styled-components/macro' - -import { devices } from 'config/devices' - -import { PriceWrapper, TextWrapper } from '../CardNumber/styled' - -export const TextNoBorderWrapper = styled.div` - display: flex; - align-items: center; - justify-content: space-between; - height: 48px; - background-color: transparent; - border: none; - margin-top: 20px; - width: 100%; - - ${PriceWrapper} { - margin-right: 0; - } - - @media ${devices.laptop} { - margin-top: 38px; - } - - @media ${devices.tablet} { - max-width: 415px; - } - - @media ${devices.mobile} { - max-width: 335px; - } -` - -export const TextNoBorderTextWrapper = styled(TextWrapper)` - font-size: 20px; - - @media ${devices.tablet} { - font-size: 14px; - } -` diff --git a/src/features/UserAccount/components/UserAccountButton/index.tsx b/src/features/UserAccount/components/UserAccountButton/index.tsx deleted file mode 100644 index c7611fe5..00000000 --- a/src/features/UserAccount/components/UserAccountButton/index.tsx +++ /dev/null @@ -1,18 +0,0 @@ -import { T9n } from 'features/T9n' - -import { PlusIconWrapper } from '../PlusIcon' -import { UserAccountButtonWrapper, PlusIconTextWrapper } from './styled' - -type Props = { - open?: () => void, - text: string, -} - -export const UserAccountButton = ({ open, text }: Props) => ( - - - - - - -) diff --git a/src/features/UserAccount/components/UserAccountButton/styled.tsx b/src/features/UserAccount/components/UserAccountButton/styled.tsx deleted file mode 100644 index 426ce3d9..00000000 --- a/src/features/UserAccount/components/UserAccountButton/styled.tsx +++ /dev/null @@ -1,51 +0,0 @@ -import styled from 'styled-components/macro' - -import { devices } from 'config/devices' - -import { outlineButtonStyles } from 'features/Common/Button' - -import { TextWrapper } from '../CardNumber/styled' - -export const UserAccountButtonWrapper = styled.div` - ${outlineButtonStyles}; - width: 288px; - margin-top: 20px; - display: flex; - align-items: center; - align-self: flex-start; - color: white; - font-weight: bold; - border-color: #0033CC; - background-color: #0033CC; - - &:hover { - cursor: pointer; - } - - @media ${devices.laptop} { - background-color: transparent; - width: 100%; - color: #494949; - border-color: #494949; - } - - @media ${devices.tablet} { - max-width: 415px; - align-self: center; - } - - @media ${devices.mobile} { - max-width: 335px; - align-self: center; - margin-top: 10px; - } -` - -export const PlusIconTextWrapper = styled(TextWrapper)` - font-size: 20px; - color: white; - - @media ${devices.laptop} { - color: #494949; - } -` diff --git a/src/features/UserAccount/components/UserAccountSubscription/index.tsx b/src/features/UserAccount/components/UserAccountSubscription/index.tsx deleted file mode 100644 index d952b7b5..00000000 --- a/src/features/UserAccount/components/UserAccountSubscription/index.tsx +++ /dev/null @@ -1,58 +0,0 @@ -import { T9n } from 'features/T9n' -import type { ObjectWithName } from 'features/Name' -import { Name } from 'features/Name' -import { Price } from 'features/Price' - -import { - UserAccountSubscriptionWrapper, - UserAccountBoldTextWrapper, - UserAccountNormalTextWrapper, - UserAccountText, - UserAccountDeleteButton, -} from './styled' -import { PriceWrapper } from '../CardNumber/styled' - -type Props = { - amount: number, - deleteSubscription?: () => void, - label?: ObjectWithName, - noMarginBottom?: boolean, - noMarginTop?: boolean, - packageAction?: string, - packageName?: string, -} - -export const UserAccountSubscription = ({ - amount, - deleteSubscription, - label, - noMarginBottom, - noMarginTop, - packageAction, - packageName, -}: Props) => ( - - - - - {packageName - && ( - - - - )} - {packageAction - && {packageAction}} - - - - {deleteSubscription && ( - - - - )} - -) diff --git a/src/features/UserAccount/components/UserAccountSubscription/styled.tsx b/src/features/UserAccount/components/UserAccountSubscription/styled.tsx deleted file mode 100644 index 2750de99..00000000 --- a/src/features/UserAccount/components/UserAccountSubscription/styled.tsx +++ /dev/null @@ -1,112 +0,0 @@ -import styled, { css } from 'styled-components/macro' - -import { devices } from 'config/devices' - -import { Label as CheckboxLabel } from 'features/Common/Checkbox/styled' -import { Label as RadioLabel } from 'features/Common/Radio/styled' - -import { TextWrapper } from '../CardNumber/styled' - -type Props = { - noMarginBottom?: boolean, - noMarginTop?: boolean, -} - -export const SubscriptionWrapperStyles = css` - display: flex; - align-items: center; - justify-content: flex-start; - height: 48px; - background-color: #3F3F3F; - border-top: ${({ noMarginBottom, noMarginTop }) => (noMarginBottom && noMarginTop ? '1px solid #000' : '')}; - border-bottom: ${({ noMarginBottom, noMarginTop }) => (noMarginBottom && noMarginTop ? '1px solid #000' : '')}; - border-radius: ${({ noMarginBottom, noMarginTop }) => { - switch (true) { - case noMarginTop && noMarginBottom: - return '0' - case noMarginTop: - return '0 0 2px 2px' - case noMarginBottom: - return '2px 2px 0 0' - default: - return '2px' - } - }}; - margin-top: ${({ noMarginTop }) => (noMarginTop ? '0' : '20px')}; - margin-bottom: ${({ noMarginBottom }) => (noMarginBottom ? '0' : '20px')}; - padding-left: 20px; - width: 100%; - ${RadioLabel}::before { - margin-left: 22px; - } -` - -export const UserAccountDeleteButton = styled.button` - width: 80px; - height: 100%; - background: red; - cursor: pointer; - border: none; - color: white; - font-size: 15px; - font-weight: 600; - display: none; -` - -export const UserAccountSubscriptionWrapper = styled.div` - ${SubscriptionWrapperStyles}; - &:hover { - ${UserAccountDeleteButton} { - display: block; - } - } - - &:nth-child(n+1) { - border-bottom: ${({ noMarginBottom }) => (noMarginBottom ? '1px solid #000' : '')}; - border-top: ${({ noMarginBottom, noMarginTop }) => (noMarginBottom && noMarginTop ? 'none' : '')}; - } - - @media ${devices.tablet} { - max-width: 415px; - } - - @media ${devices.mobile} { - max-width: 355px; - } -` - -export const CheckboxWrapper = styled.div` - ${CheckboxLabel} { - font-weight: bold; - font-size: 16px; - line-height: 24px; - - &::before { - margin-left: 22px; - } - } -` - -export const UserAccountText = styled.p` - color: #fff; - font-size: 18px; - cursor: default; -` - -export const UserAccountBoldTextWrapper = styled(TextWrapper)` - color: #fff; - font-weight: bold; - font-size: 20px; - margin-right: 24px; - - &:hover { - cursor: default; -} -` - -export const UserAccountNormalTextWrapper = styled(TextWrapper)` - color: #fff; - font-weight: normal; - font-size: 16px; - margin-right: 24px; -` diff --git a/src/features/UserAccount/components/UserAccountSubscriptionMatch/index.tsx b/src/features/UserAccount/components/UserAccountSubscriptionMatch/index.tsx deleted file mode 100644 index 7b3a3d4d..00000000 --- a/src/features/UserAccount/components/UserAccountSubscriptionMatch/index.tsx +++ /dev/null @@ -1,71 +0,0 @@ -import { Fragment } from 'react' - -import format from 'date-fns/format' - -import type { Match } from 'features/UserAccount/hooks/useUserSubscriptions' -import { Name } from 'features/Name' -import { Price } from 'features/Price' -import { T9n } from 'features/T9n' - -import { - UserAccountSubscriptionWrapper, - UserAccountBoldTextWrapper, - UserAccountTextLeftPart, - UserAccountNormalTextWrapper, - UserAccountText, - UserAccountDate, - UserAccountDeleteButton, - UserAccountTeams, -} from './styled' -import { PriceWrapper } from '../CardNumber/styled' - -type Props = { - amount: number, - deleteSubscription?: () => void, - matchData: Match, - noMarginBottom?: boolean, - noMarginTop?: boolean, - packageAction?: string, - packageName?: string, -} - -export const UserAccountSubscriptionMatch = ({ - amount, - deleteSubscription, - matchData, - noMarginBottom, - noMarginTop, - packageAction, - packageName, -}: Props) => ( - - - - - {format(new Date(matchData.date), 'dd.MM.yyyy')} - - - - - - - - - - - {packageName - && {packageName}} - {packageAction - && {packageAction}} - - - - {deleteSubscription && ( - - - - )} - -) diff --git a/src/features/UserAccount/components/UserAccountSubscriptionMatch/styled.tsx b/src/features/UserAccount/components/UserAccountSubscriptionMatch/styled.tsx deleted file mode 100644 index dab38986..00000000 --- a/src/features/UserAccount/components/UserAccountSubscriptionMatch/styled.tsx +++ /dev/null @@ -1,117 +0,0 @@ -import styled, { css } from 'styled-components/macro' - -import { Label as CheckboxLabel } from 'features/Common/Checkbox/styled' -import { Label as RadioLabel } from 'features/Common/Radio/styled' - -import { TextWrapper } from '../CardNumber/styled' - -type Props = { - noMarginBottom?: boolean, - noMarginTop?: boolean, -} - -export const SubscriptionWrapperStyles = css` - display: flex; - align-items: center; - justify-content: flex-start; - height: 75px; - background-color: #3F3F3F; - border-top: ${({ noMarginBottom, noMarginTop }) => (noMarginBottom && noMarginTop ? '1px solid #000' : '')}; - border-bottom: ${({ noMarginBottom, noMarginTop }) => (noMarginBottom && noMarginTop ? '1px solid #000' : '')}; - border-radius: ${({ noMarginBottom, noMarginTop }) => { - switch (true) { - case noMarginTop && noMarginBottom: - return '0' - case noMarginTop: - return '0 0 2px 2px' - case noMarginBottom: - return '2px 2px 0 0' - default: - return '2px' - } - }}; - margin-top: ${({ noMarginTop }) => (noMarginTop ? '0' : '20px')}; - margin-bottom: ${({ noMarginBottom }) => (noMarginBottom ? '0' : '20px')}; - padding-left: 20px; - width: 100%; - ${RadioLabel}::before { - margin-left: 22px; - } -` - -export const UserAccountDeleteButton = styled.button` - width: 80px; - height: 100%; - background: red; - cursor: pointer; - border: none; - color: white; - font-size: 15px; - font-weight: 600; - display: none; -` -export const UserAccountTextLeftPart = styled.div`` - -export const UserAccountSubscriptionWrapper = styled.div` - ${SubscriptionWrapperStyles}; - &:hover { - ${UserAccountDeleteButton} { - display: block; - } - } - - &:nth-child(n+1) { - border-bottom: ${({ noMarginBottom }) => (noMarginBottom ? '1px solid #000' : '')}; - border-top: ${({ noMarginBottom, noMarginTop }) => (noMarginBottom && noMarginTop ? 'none' : '')}; - } -` - -export const CheckboxWrapper = styled.div` - ${CheckboxLabel} { - font-weight: bold; - font-size: 16px; - line-height: 24px; - - &::before { - margin-left: 22px; - } - } -` - -export const UserAccountDate = styled.span` - color: #fff; - font-size: 17px; - cursor: default; -` -export const UserAccountText = styled.span` - color: #fff; - font-size: 18px; - cursor: default; - font-weight: 800; - margin-left: 20px; -` - -export const UserAccountTeams = styled.p` - color: #fff; - font-size: 18px; - cursor: default; - margin-top: 15px; -` - -export const UserAccountBoldTextWrapper = styled(TextWrapper)` - color: #fff; - font-weight: bold; - font-size: 20px; - margin-right: 24px; - - &:hover { - cursor: default; -} -` - -export const UserAccountNormalTextWrapper = styled(TextWrapper)` - color: #fff; - font-weight: normal; - font-size: 16px; - margin-right: 24px; -` diff --git a/src/features/UserAccount/components/UserSubscriptionsList/index.tsx b/src/features/UserAccount/components/UserSubscriptionsList/index.tsx new file mode 100644 index 00000000..bd22f099 --- /dev/null +++ b/src/features/UserAccount/components/UserSubscriptionsList/index.tsx @@ -0,0 +1,68 @@ +import isEmpty from 'lodash/isEmpty' +import map from 'lodash/map' + +import { SportTypes } from 'config' + +import type { MatchSubscriptions } from 'requests' + +import { InlineButton } from '../../styled' +import { + Wrapper, + SportName, + List, + Item, + Subscription, + InfoWrapper, + Header, + Description, + Price, + SubscriptionEnd, + ActionsWrapper, +} from './styled' + +type Props = { + list: MatchSubscriptions, + sport: SportTypes, +} + +export const UserSubscriptionsList = ({ list, sport }: Props) => { + if (isEmpty(list)) return null + return ( + + + + { + map(list, ({ + description, + header, + price, + subscription_id, + type, + }) => ( + + + +
+ {header} +
+ + {description} + +
+ + + + + + Удалить + + +
+ Следующее списание 31.02.2020 +
+ )) + } +
+
+ ) +} diff --git a/src/features/UserAccount/components/UserSubscriptionsList/styled.tsx b/src/features/UserAccount/components/UserSubscriptionsList/styled.tsx new file mode 100644 index 00000000..04d49916 --- /dev/null +++ b/src/features/UserAccount/components/UserSubscriptionsList/styled.tsx @@ -0,0 +1,109 @@ +import styled from 'styled-components/macro' + +import { SportName as SportNameBase } from 'features/Common/SportName' +import { Price as BasePrice } from 'features/Price' +import { PriceAmount, PriceDetails } from 'features/Price/styled' + +import { InlineButton } from '../../styled' + +export const Wrapper = styled.div` + :not(:first-child) { + margin-top: 24px; + } +` + +export const SportName = styled(SportNameBase)` + font-style: normal; + font-weight: 500; + font-size: 18px; + line-height: 22px; + color: #fff; +` + +export const List = styled.ul` + margin-top: 6px; +` + +export const Item = styled.li` + display: flex; + align-items: center; +` + +export const Price = styled(BasePrice)` + margin-right: 20px; + + ${PriceAmount} { + font-size: 24px; + line-height: 24px; + font-weight: normal; + } + + ${PriceDetails} { + font-weight: 500; + font-size: 12px; + line-height: 18px; + } +` + +export const ActionsWrapper = styled.div` + height: 100%; + display: flex; + justify-content: end; + align-items: center; + transform: translateX(83px); + transition: transform 0.3s ease-in-out; + + ${InlineButton} { + transform: translateX(0); + } +` + +export const Subscription = styled.div` + width: 800px; + height: 70px; + display: flex; + margin: 5px 0; + align-items: center; + justify-content: space-between; + background-color: #3F3F3F; + box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3); + border-radius: 2px; + overflow: hidden; + + :hover ${ActionsWrapper} { + transform: translateX(0); + } +` + +export const InfoWrapper = styled.div` + width: 68%; + display: flex; + padding: 14px 0 14px 20px; + flex-direction: column; + color: #fff; +` + +export const Header = styled.span` + font-style: normal; + font-weight: 600; + font-size: 16px; + line-height: 23px; + text-transform: uppercase; +` + +export const Description = styled.p` + font-style: normal; + font-weight: 500; + font-size: 16px; + line-height: 20px; + text-transform: capitalize; +` + +export const SubscriptionEnd = styled.span` + margin-left: 24px; + font-style: normal; + font-weight: 500; + font-size: 16px; + line-height: 24px; + color: rgba(255, 255, 255, 0.3); +` diff --git a/src/features/UserAccount/components/VisaLogo/index.tsx b/src/features/UserAccount/components/VisaLogo/index.tsx deleted file mode 100644 index 9bc65a52..00000000 --- a/src/features/UserAccount/components/VisaLogo/index.tsx +++ /dev/null @@ -1 +0,0 @@ -export * from './styled' diff --git a/src/features/UserAccount/components/VisaLogo/styled.tsx b/src/features/UserAccount/components/VisaLogo/styled.tsx deleted file mode 100644 index f29d6ebf..00000000 --- a/src/features/UserAccount/components/VisaLogo/styled.tsx +++ /dev/null @@ -1,22 +0,0 @@ -import styled, { css } from 'styled-components/macro' - -import { devices } from 'config/devices' - -type Props = { - visa?: boolean, -} - -export const CardLogoStyles = css` - width: ${({ visa }) => `${visa ? 37 : 30}px`}; - height: ${({ visa }) => `${visa ? 12 : 19}px`}; - margin-right: 82px; - background: ${({ visa }) => `url(/images/${visa ? 'visaLogo.png' : 'masterLogo.png'}) no-repeat`}; - - @media ${devices.tablet} { - margin-right: 5px; - } -` - -export const VisaLogoWrapper = styled.span` - ${CardLogoStyles} -` diff --git a/src/features/UserAccount/hooks/useSubscriptions.tsx b/src/features/UserAccount/hooks/useSubscriptions.tsx deleted file mode 100644 index 73c003bf..00000000 --- a/src/features/UserAccount/hooks/useSubscriptions.tsx +++ /dev/null @@ -1,31 +0,0 @@ -import { - useEffect, - useState, -} from 'react' - -import map from 'lodash/map' - -import type { SubscriptionType } from 'requests/getSubscriptions' -import { getSubscriptions } from 'requests/getSubscriptions' - -import { useLexicsStore } from 'features/LexicsStore' - -export const useSubscriptions = () => { - const [subscriptions, setSubscriptions] = useState>([]) - - const { addLexicsConfig } = useLexicsStore() - - useEffect(() => { - getSubscriptions().then((res) => { - const lexicsArray = map(res, (subscription) => ( - String(subscription.lexic) - )) - addLexicsConfig(lexicsArray) - setSubscriptions(res) - }) - }, [addLexicsConfig]) - - return { - subscriptions, - } -} diff --git a/src/features/UserAccount/hooks/useUserSubscriptions.tsx b/src/features/UserAccount/hooks/useUserSubscriptions.tsx deleted file mode 100644 index 943ae635..00000000 --- a/src/features/UserAccount/hooks/useUserSubscriptions.tsx +++ /dev/null @@ -1,99 +0,0 @@ -import { - useEffect, - useState, -} from 'react' - -import type { SportList } from 'requests/getSportList' -import { - SubscriptionAction, - saveUserCustomSubscription, -} from 'requests/saveUserCustomSubscription' -import { getSportList } from 'requests/getSportList' -import { getUserSubscriptions } from 'requests/getUserSubscriptions' -import { saveUserSubscription } from 'requests/saveUserSubscription' - -import { useToggle } from 'hooks' - -export type Subscription = { - id: number, - name_eng: string, - name_rus: string, - type?: number, -} - -type Name = { - name_eng: string, - name_rus: string, -} - -export type Match = { - date: Date, - id: number, - team1: Name, - team2: Name, - tournament: Name, -} - -export type UserSubscriptions = { - matches?: Array, - sport: number, - teams?: Array, - tournaments?: Array, -} - -export const useUserSubscriptions = () => { - const [userSubscriptions, setUserSubscriptions] = useState>([]) - const [selectedSubscription, setSelectedSubscription] = useState(null) - const [selectedSubscriptionLexic, setSelectedSubscriptionLexic] = useState('') - const [sportList, setSportList] = useState([]) - - const { - close, - isOpen, - open, - } = useToggle() - - useEffect(() => { - getUserSubscriptions().then((res) => { - setUserSubscriptions(res.custom) - setSelectedSubscription(res.id) - setSelectedSubscriptionLexic(`${res.lexic}`) - }) - - getSportList().then(setSportList) - }, []) - - const saveSubscription = async () => { - await saveUserSubscription(selectedSubscription) - close() - await getUserSubscriptions().then((res) => { - setSelectedSubscription(res.id) - setSelectedSubscriptionLexic(`${res.lexic}`) - }) - } - - const deleteUserSubscription = async (subscription: Subscription, sport: number) => { - await saveUserCustomSubscription({ - action: SubscriptionAction.REMOVE, - id: subscription.id, - sport, - type: subscription.type as number, - }) - await getUserSubscriptions().then((res) => { - setUserSubscriptions(res.custom) - }) - } - - return { - close, - deleteUserSubscription, - isOpen, - open, - saveSubscription, - selectedSubscription, - selectedSubscriptionLexic, - setSelectedSubscription, - sportList, - userSubscriptions, - } -} diff --git a/src/features/UserAccount/index.tsx b/src/features/UserAccount/index.tsx index a8ffca19..88d3d634 100644 --- a/src/features/UserAccount/index.tsx +++ b/src/features/UserAccount/index.tsx @@ -1,222 +1,67 @@ +import { Link, Route } from 'react-router-dom' + +import { PAGES } from 'config' import { userAccountLexics } from 'config/lexics/userAccount' -import { formIds } from 'config/form' -import { Combobox } from 'features/Combobox' -import { Input } from 'features/Common' -import { Form } from 'features/Login/styled' -import { T9n } from 'features/T9n' -import { Error } from 'features/Common/Input/styled' import { useLexicsConfig } from 'features/LexicsStore' import { FormStore } from 'features/FormStore' +import { Logo } from 'features/Logo' -import { useUserInfo } from './hooks/useUserInfo' -import { useUserSubscriptions } from './hooks/useUserSubscriptions' -import { useSubscriptions } from './hooks/useSubscriptions' -import { CardNumber } from './components/CardNumber' -import { UserAccountButton } from './components/UserAccountButton' -import { PageTitle } from './components/PageTitle' - -import { SubscriptionModal } from './components/SubscriptionsModal' -import { SubscriptionsForm } from './components/SubscriptionsForm' - +import { PagePersonalInfo } from './components/PagePersonalInfo' +import { PageBankCards } from './components/PageBankCards' +import { PageSubscriptions } from './components/PageSubscriptions' +import { PagePaymentsHistory } from './components/PagePaymentsHistory' import { - FormWrapper, - OutlinedButton, UserAccountWrapper, - UserAccountFormWrapper, - UserAccountComponentWrapper, - ButtonWrapper, - UserAccountBlockTitle, + ContentWrapper, + Aside, + Navigations, + LogoWrapper, + StyledLink, } from './styled' -const labelWidth = 110 - -const UserAccount = () => { +export const UserAccount = () => { useLexicsConfig(userAccountLexics) - const { - cities, - countries, - handleSubmit, - onCitySelect, - onCountrySelect, - onPhoneBlur, - onRegionOrCityChange, - readFormError, - readFormValue, - saveButton, - updateFormValue, - } = useUserInfo() - - const { - close, - deleteUserSubscription, - isOpen, - open, - saveSubscription, - selectedSubscription, - selectedSubscriptionLexic, - setSelectedSubscription, - sportList, - userSubscriptions, - } = useUserSubscriptions() - - const { - subscriptions, - } = useSubscriptions() - return ( - - - - - -
- - - - - - - - - - - - - - - - - - -
- -
- - - - - - -
- -
- - -
-
-
- - {/* Select subscription modal */} - - -
+ + + + + + + + + + + + + + + + + + + ) } - -export const UserAccountForm = () => ( - - - -) diff --git a/src/features/UserAccount/styled.tsx b/src/features/UserAccount/styled.tsx index 7205543e..7c105a71 100644 --- a/src/features/UserAccount/styled.tsx +++ b/src/features/UserAccount/styled.tsx @@ -1,92 +1,78 @@ +import { NavLink } from 'react-router-dom' + import styled from 'styled-components/macro' import { devices } from 'config/devices' -import { Form, BlockTitle } from 'features/Login/styled' -import { outlineButtonStyles } from 'features/Common/Button' -import { customScrollbar, customStylesMixin } from 'features/Common' +import { ButtonSolid, ButtonOutline } from 'features/Common/Button' -export const OutlinedButton = styled.button` - ${outlineButtonStyles}; - width: 288px; - margin-top: 20px; - align-self: flex-start; +export const SolidButton = styled(ButtonSolid)` + width: auto; + height: 50px; + padding: 0 20px; color: white; font-weight: bold; - border-color: #0033CC; - background-color: #0033CC; - - &:hover { - cursor: pointer; - } - - @media ${devices.laptop} { - background-color: transparent; - color: #0033CC; - } + background-color: #294FC4; + box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3); + border-color: transparent; + border-radius: 5px; + display: flex; + align-items: center; @media ${devices.mobile} { width: 100%; } ` -export const UserAccountBlockTitle = styled(BlockTitle)` - align-self: flex-start; - - @media ${devices.tablet} { - align-self: center; - } -` - -export const UserAccountFormWrapper = styled.div` - display: flex; - justify-content: center; - flex-wrap: wrap; - - @media ${devices.desktop} { - flex-direction: column; - - } - - @media ${devices.laptop} { - flex-wrap: nowrap; - padding-left: 188px; - } - - @media ${devices.tablet} { - padding-left: 0; - } -` - -export const ButtonWrapper = styled.div` +export const OutlineButton = styled(ButtonOutline)` + width: auto; + height: 50px; + padding: 0 20px; + color: white; + font-weight: 600; + box-shadow: 0px 1px 1px rgba(0, 0, 0, 0.3); + border-color: #fff; + border-radius: 5px; + font-size: 20px; display: flex; - align-self: flex-start; - flex-direction: column; align-items: center; - @media ${devices.tablet} { - align-self: center; - } - @media ${devices.mobile} { - width: 335px; + width: 100%; } ` -export const UserAccountWrapper = styled.div` - margin-top: 140px; +type IconProps = { + src: string, +} + +export const Icon = styled.span` + display: inline-block; + width: 25px; + height: 25px; + margin-right: 14px; + background-image: url(/images/${({ src }) => src}.svg); + background-size: contain; + background-repeat: no-repeat; +` - @media ${devices.desktop} { - margin-top: 63px; - padding-left: 46px; - } +export const ContentWrapper = styled.div` + width: 100%; + display: flex; + padding-top: 116px; + padding-left: 70px; - @media ${devices.tablet} { + @media ${devices.tablet} { + padding-top: 0; padding-left: 0; } ` -export const UserAccountComponentWrapper = styled.div` +export const UserAccountWrapper = styled.div` + width: 100%; + height: 100%; + display: flex; + padding: 70px 0 70px 70px; @media ${devices.laptop} { justify-self: flex-start; @@ -95,85 +81,61 @@ export const UserAccountComponentWrapper = styled.div` @media ${devices.tablet} { justify-self: center; + flex-direction: column; width: auto; + padding: 70px 20px 70px 20px; } - ` -export const FormWrapper = styled.div` - margin-right: 48px; +export const Aside = styled.aside`` - ${Form} { - width: 560px; - } - - &:last-child { - margin-right: 0; - } - - @media ${devices.desktop} { - margin-right: 0; - margin-top: 97px; - - ${Form} { - margin: 0; - } - - &:nth-child(2) { - margin-top: 47px; - } - &:last-child { - margin-bottom: 100px; - } - - } +export const LogoWrapper = styled.div` + margin-bottom: 50px; @media ${devices.tablet} { - ${Form}{ - width: auto; - } - } - - @media ${devices.mobile} { - margin-top: 57px; + margin-bottom: 20px; } ` -export const AddSubscriptionModal = styled.div` - width: 538px; - height: 452px; - display: flex; - flex-direction: column; - align-items: center; -` +export const Navigations = styled.nav` + width: 388px; + height: 622px; + display: flex; + flex-direction: column; + border-right: 1px solid rgba(255, 255, 255, 0.4); -export const ModalTitle = styled.p` - font-size: 24px; - font-weight: normal; + @media ${devices.tablet} { + height: auto; + width: 100%; + border: none; + margin-bottom: 20px; + } ` -export const Line = styled.hr` - position:absolute; - width: 100%; - top: 40px; - height: 1px; - border: 1px solid #3F3F3F; -` +export const StyledLink = styled(NavLink).attrs(() => ({ + activeStyle: { color: 'rgba(255, 255, 255)' }, +}))` + font-weight: bold; + font-size: 25px; + line-height: 68px; + color: rgba(255, 255, 255, 0.4); -export const SaveButton = styled(OutlinedButton)` - width: 192px; - height: 36px; - display: block; - font-weight: normal; - margin-left: auto; - margin-top: auto; + @media ${devices.tablet} { + line-height: 48px; + } ` -export const SubscriptionsWrapper = styled.div` - margin-top: 45px; - width: 100%; +export const InlineButton = styled.button` + border: none; height: 100%; - overflow: auto; - ${customScrollbar} - ${customStylesMixin} + margin: 0; + padding: 12px; + color: white; + background-color: #EB5757; + font-weight: 600; + font-size: 13px; + line-height: 14px; + cursor: pointer; + transition: transform 0.3s ease-in-out; + transform: translateX(101%); `