Ott 1337 layout personal data (#456)

* refactor(#1337): refactoring layout of personal data in user account for tablet and laptop

* refactor(#1337): refactoring some styles

* refactor(#1337): refactoring css
keep-around/af30b88d367751c9e05a735e4a0467a96238ef47
Иван Пиминов 4 years ago committed by GitHub
parent ca155c4a9a
commit 46ad1ec3f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 19
      src/features/Common/Input/styled.tsx
  2. 9
      src/features/Common/NewInput/styled.tsx
  3. 6
      src/features/Common/PasswordInput/index.tsx
  4. 10
      src/features/MatchSwitches/styled.tsx
  5. 4
      src/features/UserAccount/components/Header/index.tsx
  6. 15
      src/features/UserAccount/components/LogoutButton/index.tsx
  7. 47
      src/features/UserAccount/components/PersonalInfoForm/styled.tsx
  8. 18
      src/features/UserAccount/components/ScoreSwitch/index.tsx
  9. 34
      src/features/UserAccount/styled.tsx

@ -43,7 +43,7 @@ export const LabelTitle = styled.p<TitleProps>`
font-style: normal; font-style: normal;
font-weight: normal; font-weight: normal;
white-space: nowrap; white-space: nowrap;
font-size: 16px; font-size: 0.8rem;
line-height: 24px; line-height: 24px;
letter-spacing: -0.01em; letter-spacing: -0.01em;
padding-top: 2px; padding-top: 2px;
@ -58,6 +58,8 @@ export const LabelTitle = styled.p<TitleProps>`
} }
@media ${devices.tablet} { @media ${devices.tablet} {
font-size: 1.6rem;
width: 9rem;
${({ isUserAccountPage }) => (isUserAccountPage ${({ isUserAccountPage }) => (isUserAccountPage
? css` ? css`
display: none; display: none;
@ -81,12 +83,12 @@ type InputProps = {
const inputStyles = css<InputProps>` const inputStyles = css<InputProps>`
flex-grow: 1; flex-grow: 1;
font-weight: 600; font-weight: 600;
font-size: 20px; font-size: 0.9rem;
line-height: 24px; line-height: 1.1rem;
width: ${({ inputWidth }) => (inputWidth ? `${inputWidth}px` : '')}; width: ${({ inputWidth }) => (inputWidth ? `${inputWidth}px` : '')};
background-color: transparent; background-color: transparent;
border: transparent; border: transparent;
margin-left: 24px; margin-left: 1.1rem;
color: ${({ theme: { colors } }) => colors.text100}; color: ${({ theme: { colors } }) => colors.text100};
&[type='password'] { &[type='password'] {
@ -111,6 +113,10 @@ const inputStyles = css<InputProps>`
font-size: 12px; font-size: 12px;
` `
: ''}; : ''};
@media ${devices.tablet} {
font-size: 1.8rem;
}
` `
export const InputStyled = styled.input<InputProps>` export const InputStyled = styled.input<InputProps>`
@ -136,7 +142,7 @@ export const Column = styled.div<ColumnProps>`
@media ${devices.laptop} { @media ${devices.laptop} {
${({ isUserAccountPage }) => (!isUserAccountPage ${({ isUserAccountPage }) => (!isUserAccountPage
? css` ? css`
max-width: 415px; width: 100%;
` `
: '')} : '')}
} }
@ -146,7 +152,8 @@ export const Column = styled.div<ColumnProps>`
? css` ? css`
max-width: 415px; max-width: 415px;
` `
: '')} : css`
width: 100%;`)}
} }
@media ${devices.mobile} { @media ${devices.mobile} {

@ -1,5 +1,6 @@
import styled, { css } from 'styled-components/macro' import styled, { css } from 'styled-components/macro'
import { devices } from 'config'
import { isMobileDevice } from 'config/userAgent' import { isMobileDevice } from 'config/userAgent'
export const Wrapper = styled.div` export const Wrapper = styled.div`
@ -24,14 +25,18 @@ export const Label = styled.label`
height: 100%; height: 100%;
color: rgba(255, 255, 255, 0.5); color: rgba(255, 255, 255, 0.5);
font-weight: normal; font-weight: normal;
font-size: 16px; font-size: 0.8rem;
line-height: 20px; line-height: 0.9rem;
letter-spacing: -0.01em; letter-spacing: -0.01em;
${isMobileDevice ${isMobileDevice
? css` ? css`
font-size: 12px; font-size: 12px;
` `
: ''}; : ''};
@media ${devices.tablet} {
font-size: 1.6rem;
}
` `
const resetStyles = css` const resetStyles = css`

@ -2,6 +2,7 @@ import type { ComponentProps } from 'react'
import styled, { css } from 'styled-components/macro' import styled, { css } from 'styled-components/macro'
import { devices } from 'config'
import { isMobileDevice } from 'config/userAgent' import { isMobileDevice } from 'config/userAgent'
import { useToggle } from 'hooks' import { useToggle } from 'hooks'
@ -26,6 +27,11 @@ const VisibilityButton = styled(BaseButton)`
transform: translateY(-50%); transform: translateY(-50%);
` `
: ''}; : ''};
@media ${devices.tablet} {
width: 2.2rem;
height: 1.5rem;
margin-right: 1.7rem;
}
` `
type Props = ComponentProps<typeof NewInput> type Props = ComponentProps<typeof NewInput>

@ -1,6 +1,8 @@
import styled, { css } from 'styled-components/macro' import styled, { css } from 'styled-components/macro'
import { isMobileDevice } from 'config/userAgent' import { isMobileDevice } from 'config/userAgent'
import { devices } from 'config'
import { T9n } from 'features/T9n' import { T9n } from 'features/T9n'
export const Switch = styled.div` export const Switch = styled.div`
@ -61,8 +63,12 @@ export const Icon = styled.div<IconProps>`
width: 51px; width: 51px;
height: 31px; height: 31px;
` `
: ''}; : ''}
`
@media ${devices.tablet} {
width: 2.7rem;
height: 1.5rem;
}`
export const Wrapper = styled.div` export const Wrapper = styled.div`
margin-right: 2.45rem; margin-right: 2.45rem;

@ -16,9 +16,9 @@ const HeaderStyled = styled.header`
margin-bottom: 45px; margin-bottom: 45px;
height: 50px; height: 50px;
padding-top: 8px; padding-top: 8px;
@media ${devices.tablet} { @media ${devices.tablet} {
margin-bottom: 20px; margin-bottom: 0;
} }
${isMobileDevice ${isMobileDevice

@ -1,6 +1,7 @@
import styled, { css } from 'styled-components/macro' import styled, { css } from 'styled-components/macro'
import { isMobileDevice } from 'config/userAgent' import { isMobileDevice } from 'config/userAgent'
import { devices } from 'config'
import { useAuthStore } from 'features/AuthStore' import { useAuthStore } from 'features/AuthStore'
import { T9n } from 'features/T9n' import { T9n } from 'features/T9n'
@ -10,15 +11,12 @@ const Button = styled.button`
background-color: transparent; background-color: transparent;
padding: 0; padding: 0;
cursor: pointer; cursor: pointer;
margin-top: 3.0rem;
position: absolute;
left: 0;
bottom: 0;
display: flex; display: flex;
align-items: center; align-items: center;
font-weight: 500; font-weight: 500;
font-size: 25px; font-size: 1.2rem;
line-height: 68px; line-height: 3.2rem;
color: #FFFFFF; color: #FFFFFF;
${isMobileDevice ${isMobileDevice
? css` ? css`
@ -27,6 +25,11 @@ const Button = styled.button`
height: 25px; height: 25px;
` `
: ''}; : ''};
@media ${devices.tablet} {
font-size: 2.8rem;
position: static;
}
` `
const ExitIcon = styled.span` const ExitIcon = styled.span`

@ -16,8 +16,8 @@ export const Form = styled.div`
} }
${InputWrapper} { ${InputWrapper} {
height: 50px; height: 2.4rem;
margin-top: 10px; margin-top: 0.5rem;
${isMobileDevice ${isMobileDevice
? css` ? css`
height: 40px; height: 40px;
@ -25,11 +25,17 @@ export const Form = styled.div`
padding-left: 0; padding-left: 0;
` `
: ''}; : ''};
@media ${devices.tablet} {
height: 4.6rem;
margin-top: 1rem;
}
} }
@media ${devices.tablet} { @media ${devices.tablet} {
min-width: auto; width: 100%;
} }
${isMobileDevice ${isMobileDevice
? css` ? css`
width: 100%; width: 100%;
@ -41,32 +47,40 @@ export const ButtonWrapper = styled.div`
display: flex; display: flex;
flex-direction: column; flex-direction: column;
align-items: start; align-items: start;
margin-top: 40px; margin-top: 1.9rem;
@media ${devices.tablet} {
align-self: center;
}
` `
export const SectionTitle = styled.span` export const SectionTitle = styled.span`
display: inline-block; display: inline-block;
margin-top: 20px; margin-top: 0.9rem;
margin-bottom: 4px; margin-bottom: 4px;
font-weight: 600; font-weight: 600;
font-size: 12px; font-size: 0.6rem;
line-height: 18px; line-height: 0.9rem;
text-transform: uppercase; text-transform: uppercase;
color: ${({ theme }) => theme.colors.text50}; color: ${({ theme }) => theme.colors.text50};
@media ${devices.tablet} {
margin-top: 2rem;
font-size: 1.4rem;
line-height: 1.7rem;
}
` `
export const PasswordInput = styled(PasswordInputBase)` export const PasswordInput = styled(PasswordInputBase)`
height: 50px; height: 2.4rem;
margin-bottom: 10px; margin-bottom: 0.5rem;
padding-left: 24px; padding-left: 1.1rem;
${InputStyled} { ${InputStyled} {
padding: 0; padding: 0;
padding-left: 24px; padding-left: 24px;
@media ${devices.tablet} {
font-size: 1.8rem;
font-weight: 600;
}
} }
${isMobileDevice ${isMobileDevice
? css` ? css`
@ -74,4 +88,9 @@ export const PasswordInput = styled(PasswordInputBase)`
padding-left: 10px; padding-left: 10px;
` `
: ''}; : ''};
@media ${devices.tablet} {
height: 4.6rem;
margin-bottom: 1rem;
}
` `

@ -1,6 +1,8 @@
import styled, { css } from 'styled-components/macro' import styled, { css } from 'styled-components/macro'
import { isMobileDevice } from 'config/userAgent' import { isMobileDevice } from 'config/userAgent'
import { devices } from 'config'
import { useMatchSwitchesStore } from 'features/MatchSwitches' import { useMatchSwitchesStore } from 'features/MatchSwitches'
import { import {
Switch, Switch,
@ -13,21 +15,29 @@ type TWrapper = {
} }
const Wrapper = styled.div<TWrapper>` const Wrapper = styled.div<TWrapper>`
margin-top: 90px; margin-top: 4.3rem;
display: ${({ isHidden }) => (isHidden ? 'none' : 'block')}; display: ${({ isHidden }) => (isHidden ? 'none' : 'block')};
${isMobileDevice ${isMobileDevice
? css` ? css`
margin-top: 0; margin-top: 0;
` `
: ''}; : ''}
@media ${devices.tablet} {
margin-top: 2rem;
}
` `
const Title = styled(TitleBase)` const Title = styled(TitleBase)`
margin-right: 28px; margin-right: 1.3rem;
font-weight: normal; font-weight: normal;
font-size: 25px; font-size: 1.2rem;
text-transform: none; text-transform: none;
align-self: flex-start; align-self: flex-start;
@media ${devices.tablet} {
font-size: 2.6rem;
}
` `
type Props = { type Props = {

@ -9,8 +9,8 @@ import { ButtonSolid, ButtonOutline } from 'features/Common/Button'
export const SolidButton = styled(ButtonSolid)` export const SolidButton = styled(ButtonSolid)`
width: auto; width: auto;
height: 50px; height: 2.4rem;
padding: 0 20px; padding: 0 0.94rem;
color: white; color: white;
font-weight: bold; font-weight: bold;
background-color: #294fc4; background-color: #294fc4;
@ -19,6 +19,13 @@ export const SolidButton = styled(ButtonSolid)`
border-radius: 5px; border-radius: 5px;
display: flex; display: flex;
align-items: center; align-items: center;
@media ${devices.tablet} {
height: 5rem;
font-size: 2.0rem;
width: 100%;
justify-content: center;
}
@media ${devices.mobile} { @media ${devices.mobile} {
width: 100%; width: 100%;
@ -73,7 +80,7 @@ export const Icon = styled.span<IconProps>`
export const ContentWrapper = styled.div` export const ContentWrapper = styled.div`
width: 100%; width: 100%;
display: flex; display: flex;
padding-left: 70px; padding-left: 3.3rem;
@media ${devices.tablet} { @media ${devices.tablet} {
padding-top: 0; padding-top: 0;
@ -119,6 +126,10 @@ export const Body = styled.div`
export const Aside = styled.aside` export const Aside = styled.aside`
position: relative; position: relative;
height: 100%; height: 100%;
@media ${devices.tablet} {
height: auto;
}
${isMobileDevice ${isMobileDevice
? css` ? css`
height: auto; height: auto;
@ -127,17 +138,17 @@ export const Aside = styled.aside`
` `
export const Navigations = styled.nav` export const Navigations = styled.nav`
width: 424px; width: 20rem;
height: 622px; height: 29.3rem;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
border-right: 1px solid rgba(255, 255, 255, 0.4); border-right: 1px solid rgba(255, 255, 255, 0.4);
@media ${devices.tablet} { @media ${devices.tablet} {
height: auto; height: auto;
width: 100%; width: 100%;
border: none; border: none;
margin-bottom: 20px; margin-bottom: 0;
} }
@media ${devices.mobile} { @media ${devices.mobile} {
@ -155,8 +166,8 @@ export const StyledLink = styled(NavLink).attrs(
}), }),
)<StyledLinkProps>` )<StyledLinkProps>`
font-weight: bold; font-weight: bold;
font-size: 25px; font-size: 1.2rem;
line-height: 68px; line-height: 3.2rem;
color: rgba(255, 255, 255, 0.4); color: rgba(255, 255, 255, 0.4);
${({ disabled }) => (disabled ${({ disabled }) => (disabled
@ -167,9 +178,10 @@ export const StyledLink = styled(NavLink).attrs(
: css` : css`
color: rgba(255, 255, 255, 0.4); color: rgba(255, 255, 255, 0.4);
`)} `)}
@media ${devices.tablet} { @media ${devices.tablet} {
line-height: 48px; font-size: 2.8rem;
line-height: 5.3rem;
} }
@media ${devices.mobile} { @media ${devices.mobile} {

Loading…
Cancel
Save