diff --git a/public/images/plusIcon-gray.svg b/public/images/plusIcon-gray.svg new file mode 100644 index 00000000..5ed15c2b --- /dev/null +++ b/public/images/plusIcon-gray.svg @@ -0,0 +1,17 @@ + + + + + + + + + + + + + + + + + diff --git a/src/features/App/AuthenticatedApp.tsx b/src/features/App/AuthenticatedApp.tsx index a581b910..0328370f 100644 --- a/src/features/App/AuthenticatedApp.tsx +++ b/src/features/App/AuthenticatedApp.tsx @@ -3,6 +3,7 @@ import { Route, Redirect, Switch, + useRouteMatch, } from 'react-router-dom' import { indexLexics } from 'config/lexics/indexLexics' @@ -35,11 +36,12 @@ import { FormStore } from 'features/FormStore' export const AuthenticatedApp = () => { useLexicsConfig(indexLexics) const isMobile = useMediaQuery({ query: devices.tablet }) + const isUserAccountPage = useRouteMatch(PAGES.useraccount)?.isExact || false return ( { - isMobile + isMobile || isUserAccountPage ? null : ( diff --git a/src/features/Combobox/index.tsx b/src/features/Combobox/index.tsx index c9711cea..1123d578 100644 --- a/src/features/Combobox/index.tsx +++ b/src/features/Combobox/index.tsx @@ -1,8 +1,12 @@ import React from 'react' +import { useRouteMatch } from 'react-router-dom' import isEmpty from 'lodash/isEmpty' import map from 'lodash/map' +import { useLexicsStore } from 'features/LexicsStore' + +import { PAGES } from 'config' import { T9n } from 'features/T9n' import { OutsideClick } from 'features/OutsideClick' import { @@ -50,14 +54,16 @@ export const Combobox = (props: Props) => { query, toggle, } = useCombobox(props) + const { translate } = useLexicsStore() + const isUserAccountPage = useRouteMatch(PAGES.useraccount)?.isExact || false return ( - + {withArrow && ( diff --git a/src/features/Combobox/styled.tsx b/src/features/Combobox/styled.tsx index a25ca48e..8508df7e 100644 --- a/src/features/Combobox/styled.tsx +++ b/src/features/Combobox/styled.tsx @@ -17,8 +17,9 @@ export const PopOver = styled.ul` overflow: auto; z-index: 2; background: rgb(102, 102, 102); - ${customScrollbar}; - ${customStylesMixin}; + + ${customScrollbar}; + ${customStylesMixin}; ` export const ListOption = styled.li<{isHighlighted?: boolean}>` diff --git a/src/features/Common/Input/index.tsx b/src/features/Common/Input/index.tsx index face7227..0308112d 100644 --- a/src/features/Common/Input/index.tsx +++ b/src/features/Common/Input/index.tsx @@ -1,8 +1,10 @@ import type { ChangeEvent, FocusEvent } from 'react' import React from 'react' +import { useRouteMatch } from 'react-router-dom' import { T9n } from 'features/T9n' import { useLexicsStore } from 'features/LexicsStore' +import { PAGES } from 'config' import { WrapperProps, @@ -56,16 +58,17 @@ export const Input = ({ wrapperWidth, }: Props) => { const { translate } = useLexicsStore() + const isUserAccountPage = useRouteMatch(PAGES.useraccount)?.isExact || false return ( - + {editIcon && } diff --git a/src/features/Common/Input/styled.tsx b/src/features/Common/Input/styled.tsx index 94eb5451..4c61dd04 100644 --- a/src/features/Common/Input/styled.tsx +++ b/src/features/Common/Input/styled.tsx @@ -29,6 +29,7 @@ export const wrapperStyles = css` ` type TitleProps = { + isUserAccountPage?: boolean, labelWidth?: number, } @@ -48,12 +49,25 @@ export const LabelTitle = styled.p` width: ${({ labelWidth }) => (labelWidth ? `${labelWidth}px` : '')}; @media ${devices.laptop} { - display: none; + ${({ isUserAccountPage }) => (!isUserAccountPage + ? css` + display: none; + ` + : '')} + } + + @media ${devices.tablet} { + ${({ isUserAccountPage }) => (isUserAccountPage + ? css` + display: none; + ` + : '')} } ` type InputProps = { inputWidth?: number, + isUserAccountPage?: boolean, } export const inputStyles = css` @@ -86,7 +100,6 @@ export const inputStyles = css` } @media ${devices.laptop} { - margin-left: 5px; width: 100%; font-size: 20px; } @@ -101,7 +114,6 @@ export const InputStyled = styled.input` @media ${devices.laptop} { ::placeholder { - opacity: 1; font-style: normal; font-weight: normal; white-space: nowrap; @@ -110,10 +122,31 @@ export const InputStyled = styled.input` letter-spacing: -0.01em; margin-right: -10px; } + + + ${({ isUserAccountPage }) => (!isUserAccountPage + ? css` + ::placeholder { + opacity: 1; + } + ` + : '')} + + } + + @media ${devices.tablet} { + ${({ isUserAccountPage }) => (isUserAccountPage + ? css` + ::placeholder { + opacity: 1; + } + ` + : '')} } @media ${devices.mobile} { font-size: 14px; + margin-left: 0; ::placeholder { font-size: 14px; @@ -133,14 +166,30 @@ export const InputWrapper = styled.div` } ` +type ColumnProps = { + isUserAccountPage?: boolean, +} -export const Column = styled.div` +export const Column = styled.div` width: 100%; display: flex; flex-direction: column; @media ${devices.laptop} { - max-width: 415px; + ${({ isUserAccountPage }) => (!isUserAccountPage + ? css` + max-width: 415px; + ` + : '')} + } + + @media ${devices.tablet} { + ${({ isUserAccountPage }) => (isUserAccountPage + ? css` + max-width: 415px; + ` + : '')} + } @media ${devices.mobile} { @@ -176,6 +225,9 @@ export const Error = styled(T9n)` ` export const Icon = styled.div<{ image: string }>` + position: absolute; + right: 22px; + top: 50%; width: 15px; height: 25px; background-image: url(/images/${({ image }) => `${image}.svg`}); diff --git a/src/features/Common/Radio/index.tsx b/src/features/Common/Radio/index.tsx index 0b5ec028..b87247fb 100644 --- a/src/features/Common/Radio/index.tsx +++ b/src/features/Common/Radio/index.tsx @@ -1,4 +1,7 @@ import React, { InputHTMLAttributes } from 'react' +import { useRouteMatch } from 'react-router-dom' + +import { PAGES } from 'config' import { Wrapper, @@ -21,17 +24,22 @@ export const Radio = ({ label = '', name, onClick, -}: Props) => ( - - - - -) +}: Props) => { + const isUserAccountPage = useRouteMatch(PAGES.useraccount)?.isExact || false + + return ( + + + + + ) +} diff --git a/src/features/Common/Radio/styled.tsx b/src/features/Common/Radio/styled.tsx index 47fddc14..0b6e23f2 100644 --- a/src/features/Common/Radio/styled.tsx +++ b/src/features/Common/Radio/styled.tsx @@ -1,18 +1,25 @@ -import styled from 'styled-components/macro' +import styled, { css } from 'styled-components/macro' import { devices } from 'config/devices' -export const Wrapper = styled.div` +type WrapperProps = { + isUserAccountPage?: boolean, +} + +export const Wrapper = styled.div` @media ${devices.tablet} { - position: absolute; - left: 0; - top: 0; - width: 163px; - height: 100px; - border-radius: 10px; + ${({ isUserAccountPage }) => (!isUserAccountPage + ? css` + position: absolute; + left: 0; + top: 0; + width: 163px; + height: 100px; + border-radius: 10px; + ` + : '')} } - ` export const Label = styled.label` @@ -22,8 +29,11 @@ export const Label = styled.label` font-size: 18px; line-height: 21px; ` +type InputProps = { + isUserAccountPage?: boolean, +} -export const Input = styled.input` +export const Input = styled.input` position: absolute; z-index: -1; opacity: 0; @@ -51,16 +61,21 @@ export const Input = styled.input` } @media ${devices.tablet} { - &+${Label}::before { - width: 163px; - height: 100px; - border-radius: 10px; - margin-right: 0; - background-image: none; - } + ${({ isUserAccountPage }) => (!isUserAccountPage + ? css` + &+${Label}::before { + width: 163px; + height: 100px; + border-radius: 10px; + margin-right: 0; + background-image: none; + } - &:checked+${Label}::before { - background-image: none; - } + &:checked+${Label}::before { + background-image: none; + } + ` + : '')} } + ` diff --git a/src/features/Modal/styled.tsx b/src/features/Modal/styled.tsx index 153bffa3..a911e28a 100644 --- a/src/features/Modal/styled.tsx +++ b/src/features/Modal/styled.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components/macro' +import { devices } from 'config/devices' + import { CloseButton } from 'features/Common/CloseButton' export const ModalContainer = styled.div` @@ -21,6 +23,13 @@ export const ModalWindow = styled.div` padding: 15px; box-shadow: 0px 5px 30px rgba(0, 0, 0, 0.7); border-radius: 10px; + + @media ${devices.mobile} { + height: 100vh; + width: 100vw; + border-radius: 0; + } + ` export const ModalCloseButton = styled(CloseButton)` diff --git a/src/features/Register/components/Price/styled.tsx b/src/features/Register/components/Price/styled.tsx index 5dc20474..c9782a79 100644 --- a/src/features/Register/components/Price/styled.tsx +++ b/src/features/Register/components/Price/styled.tsx @@ -21,6 +21,10 @@ export const PriceAmount = styled.span` @media ${devices.tablet} { font-size: 36px; } + + @media ${devices.mobile} { + margin-left: 8px; + } ` export const PriceDetails = styled.span` diff --git a/src/features/UserAccount/components/CardNumber/styled.tsx b/src/features/UserAccount/components/CardNumber/styled.tsx index d19ecd7e..26df887f 100644 --- a/src/features/UserAccount/components/CardNumber/styled.tsx +++ b/src/features/UserAccount/components/CardNumber/styled.tsx @@ -1,5 +1,7 @@ import styled, { css } from 'styled-components/macro' +import { devices } from 'config/devices' + import { Label } from 'features/Common/Radio/styled' import { PriceAmount, PriceDetails } from 'features/Register/components/Price/styled' @@ -21,6 +23,34 @@ export const CardNumberWrapper = styled.div` 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` @@ -40,6 +70,10 @@ export const TextWrapper = styled.p` export const CardNumberTextWrapper = styled(TextWrapper)` margin-right: 24px; + + @media ${devices.mobile} { + margin-right: 5px; + } ` export type Props = { @@ -59,8 +93,18 @@ export const priceWrapperStyles = css` font-size: 12px; line-height: 12px; } + + @media ${devices.mobile} { + ${PriceAmount} { + font-size: 17px; + } + ${PriceDetails} { + font-size: 10px; + } + } ` export const PriceWrapper = styled.div` ${priceWrapperStyles} + ` diff --git a/src/features/UserAccount/components/PageTitle/styled.tsx b/src/features/UserAccount/components/PageTitle/styled.tsx index 75c4a046..7ece73e8 100644 --- a/src/features/UserAccount/components/PageTitle/styled.tsx +++ b/src/features/UserAccount/components/PageTitle/styled.tsx @@ -1,11 +1,18 @@ 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` @@ -15,4 +22,9 @@ export const TitleTextWrapper = styled.div` margin-bottom: 0; line-height: 28px; } + + @media ${devices.tablet} { + margin-left: 0; + margin-top: 20px; + } ` diff --git a/src/features/UserAccount/components/PlusIcon/styled.tsx b/src/features/UserAccount/components/PlusIcon/styled.tsx index 1af73b48..f7e21eff 100644 --- a/src/features/UserAccount/components/PlusIcon/styled.tsx +++ b/src/features/UserAccount/components/PlusIcon/styled.tsx @@ -1,9 +1,15 @@ 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/SubscriptionsForm/styled.tsx b/src/features/UserAccount/components/SubscriptionsForm/styled.tsx index 76f26ba0..1fdab860 100644 --- a/src/features/UserAccount/components/SubscriptionsForm/styled.tsx +++ b/src/features/UserAccount/components/SubscriptionsForm/styled.tsx @@ -1,10 +1,16 @@ 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)` diff --git a/src/features/UserAccount/components/SubscriptionsModal/styled.tsx b/src/features/UserAccount/components/SubscriptionsModal/styled.tsx index ec5f6373..601131f5 100644 --- a/src/features/UserAccount/components/SubscriptionsModal/styled.tsx +++ b/src/features/UserAccount/components/SubscriptionsModal/styled.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components/macro' +import { devices } from 'config/devices' + import { customScrollbar, customStylesMixin } from 'features/Common' import { T9n } from 'features/T9n' @@ -11,12 +13,20 @@ export const AddSubscriptionModal = styled.div` display: flex; flex-direction: column; align-items: center; + + @media ${devices.mobile} { + width: 100%; + } ` export const ModalTitle = styled(T9n)` display: block; font-size: 24px; font-weight: normal; + + @media ${devices.mobile} { + font-size: 18px; + } ` export const Line = styled.hr` @@ -34,6 +44,10 @@ export const SaveButton = styled(OutlinedButton)` font-weight: normal; margin-left: auto; margin-top: auto; + + @media ${devices.mobile} { + margin-right: auto; + } ` export const SubscriptionsWrapper = styled.div` @@ -43,4 +57,8 @@ export const SubscriptionsWrapper = styled.div` overflow: auto; ${customScrollbar}; ${customStylesMixin}; + + @media ${devices.tablet} { + background-color: transparent; + } ` diff --git a/src/features/UserAccount/components/TextNoBorder/styled.tsx b/src/features/UserAccount/components/TextNoBorder/styled.tsx index cc3a99d9..b6c7337d 100644 --- a/src/features/UserAccount/components/TextNoBorder/styled.tsx +++ b/src/features/UserAccount/components/TextNoBorder/styled.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components/macro' +import { devices } from 'config/devices' + import { PriceWrapper, TextWrapper } from '../CardNumber/styled' export const TextNoBorderWrapper = styled.div` @@ -15,8 +17,24 @@ export const TextNoBorderWrapper = styled.div` ${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/styled.tsx b/src/features/UserAccount/components/UserAccountButton/styled.tsx index 5ab5285b..426ce3d9 100644 --- a/src/features/UserAccount/components/UserAccountButton/styled.tsx +++ b/src/features/UserAccount/components/UserAccountButton/styled.tsx @@ -1,5 +1,7 @@ import styled from 'styled-components/macro' +import { devices } from 'config/devices' + import { outlineButtonStyles } from 'features/Common/Button' import { TextWrapper } from '../CardNumber/styled' @@ -19,9 +21,31 @@ export const UserAccountButtonWrapper = styled.div` &: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/styled.tsx b/src/features/UserAccount/components/UserAccountSubscription/styled.tsx index e397cd3c..2750de99 100644 --- a/src/features/UserAccount/components/UserAccountSubscription/styled.tsx +++ b/src/features/UserAccount/components/UserAccountSubscription/styled.tsx @@ -1,5 +1,7 @@ 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' @@ -63,6 +65,14 @@ export const UserAccountSubscriptionWrapper = styled.div` 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` diff --git a/src/features/UserAccount/components/VisaLogo/styled.tsx b/src/features/UserAccount/components/VisaLogo/styled.tsx index 70523242..f29d6ebf 100644 --- a/src/features/UserAccount/components/VisaLogo/styled.tsx +++ b/src/features/UserAccount/components/VisaLogo/styled.tsx @@ -1,5 +1,7 @@ import styled, { css } from 'styled-components/macro' +import { devices } from 'config/devices' + type Props = { visa?: boolean, } @@ -9,6 +11,10 @@ export const CardLogoStyles = css` 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` diff --git a/src/features/UserAccount/styled.tsx b/src/features/UserAccount/styled.tsx index 48234dd6..7205543e 100644 --- a/src/features/UserAccount/styled.tsx +++ b/src/features/UserAccount/styled.tsx @@ -1,5 +1,7 @@ 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' @@ -17,16 +19,43 @@ export const OutlinedButton = styled.button` &:hover { cursor: pointer; } + + @media ${devices.laptop} { + background-color: transparent; + color: #0033CC; + } + + @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` @@ -34,14 +63,42 @@ export const ButtonWrapper = styled.div` align-self: flex-start; flex-direction: column; align-items: center; + + @media ${devices.tablet} { + align-self: center; + } + + @media ${devices.mobile} { + width: 335px; + } ` export const UserAccountWrapper = styled.div` - width: 1776px; margin-top: 140px; + + @media ${devices.desktop} { + margin-top: 63px; + padding-left: 46px; + } + + @media ${devices.tablet} { + padding-left: 0; + } ` -export const UserAccountComponentWrapper = styled.div`` +export const UserAccountComponentWrapper = styled.div` + + @media ${devices.laptop} { + justify-self: flex-start; + width: 100%; + } + + @media ${devices.tablet} { + justify-self: center; + width: auto; + } + +` export const FormWrapper = styled.div` margin-right: 48px; @@ -53,6 +110,33 @@ export const FormWrapper = styled.div` &: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; + } + + } + + @media ${devices.tablet} { + ${Form}{ + width: auto; + } + } + + @media ${devices.mobile} { + margin-top: 57px; + } ` export const AddSubscriptionModal = styled.div`