Стили для Stepper унифицированы в рамках профиля пользователя

Форма включения двухфакторной аутентификации перекрашена в зелёный
TODO: на странице смены email stepper имеет зелёный цвет
This commit is contained in:
ErickSkrauch 2017-08-04 01:53:50 +03:00 committed by SleepWalker
parent 823ed33dea
commit a50541a8fa
6 changed files with 18 additions and 83 deletions

View File

@ -1,7 +1,6 @@
import React, { Component, PropTypes } from 'react'; import React, { Component, PropTypes } from 'react';
import { FormattedMessage as Message } from 'react-intl'; import { FormattedMessage as Message } from 'react-intl';
import classNames from 'classnames';
import Helmet from 'react-helmet'; import Helmet from 'react-helmet';
import { Motion, spring } from 'react-motion'; import { Motion, spring } from 'react-motion';
@ -10,6 +9,7 @@ import { BackButton } from 'components/profile/ProfileForm';
import styles from 'components/profile/profileForm.scss'; import styles from 'components/profile/profileForm.scss';
import helpLinks from 'components/auth/helpLinks.scss'; import helpLinks from 'components/auth/helpLinks.scss';
import MeasureHeight from 'components/MeasureHeight'; import MeasureHeight from 'components/MeasureHeight';
import Stepper from 'components/ui/stepper';
import changeEmail from './changeEmail.scss'; import changeEmail from './changeEmail.scss';
import messages from './ChangeEmail.intl.json'; import messages from './ChangeEmail.intl.json';
@ -95,12 +95,8 @@ export default class ChangeEmail extends Component {
</div> </div>
</div> </div>
<div className={changeEmail.steps}> <div className={changeEmail.stepper}>
{(new Array(STEPS_TOTAL)).fill(0).map((_, step) => ( <Stepper totalSteps={STEPS_TOTAL} activeStep={activeStep} />
<div className={classNames(changeEmail.step, {
[changeEmail.activeStep]: step <= activeStep
})} key={step} />
))}
</div> </div>
<div className={styles.form}> <div className={styles.form}>

View File

@ -1,66 +1,12 @@
@import '~components/ui/colors.scss'; @import '~components/ui/colors.scss';
.steps { .stepper {
width: 35%; composes: stepper from 'components/profile/profileForm.scss';
margin: 0 auto;
height: 40px;
display: flex;
align-items: center;
}
.step { .activeStep {
position: relative; &:after {
text-align: right; background: $violet;
width: 100%; }
height: 4px;
background: #d8d5ce;
&:first-child {
width: 12px;
}
&:before {
content: '';
display: block;
position: absolute;
height: 4px;
left: 0;
right: 100%;
top: 50%;
margin-top: -2px;
background: #aaa;
transition: 0.4s ease 0.1s;
}
&:after {
content: '';
display: inline-block;
position: relative;
top: -7px;
z-index: 1;
width: 12px;
height: 12px;
border-radius: 100%;
background: #aaa;
transition: background 0.4s ease;
}
}
.activeStep {
&:before {
right: 0;
transition-delay: 0;
}
&:after {
background: $violet;
transition-delay: 0.3s;
} }
} }
@ -71,7 +17,6 @@
line-height: 1.2; line-height: 1.2;
} }
.stepForms { .stepForms {
white-space: nowrap; white-space: nowrap;
} }

View File

@ -93,7 +93,7 @@ export default class MultiFactorAuth extends Component {
<div className={styles.formBody}> <div className={styles.formBody}>
<Message {...messages.mfaTitle}> <Message {...messages.mfaTitle}>
{(pageTitle) => ( {(pageTitle) => (
<h3 className={styles.violetTitle}> <h3 className={styles.title}>
<Helmet title={pageTitle} /> <Helmet title={pageTitle} />
{pageTitle} {pageTitle}
</h3> </h3>
@ -108,7 +108,7 @@ export default class MultiFactorAuth extends Component {
</div> </div>
</div> </div>
<div className={mfaStyles.stepper}> <div className={styles.stepper}>
<Stepper totalSteps={STEPS_TOTAL} activeStep={activeStep} /> <Stepper totalSteps={STEPS_TOTAL} activeStep={activeStep} />
</div> </div>
@ -116,7 +116,7 @@ export default class MultiFactorAuth extends Component {
{this.renderStepForms()} {this.renderStepForms()}
<Button <Button
color="violet" color="green"
type="submit" type="submit"
block block
label={buttonLabel} label={buttonLabel}

View File

@ -1,13 +1,2 @@
@import '~components/ui/colors.scss'; @import '~components/ui/colors.scss';
.stepper {
width: 35%;
margin: 0 auto;
}
.currentAccountEmail {
text-align: center;
text-overflow: ellipsis;
overflow: hidden;
line-height: 1.2;
}

View File

@ -84,6 +84,11 @@
margin-top: 25px; margin-top: 25px;
} }
.stepper {
width: 35%;
margin: 0 auto;
}
@media (max-width: 525px) { @media (max-width: 525px) {
.contentWithBackButton .title { .contentWithBackButton .title {
padding-top: 23px; padding-top: 23px;

View File

@ -57,7 +57,7 @@
} }
&:after { &:after {
background: $violet; background: $green;
transition-delay: 0.3s; transition-delay: 0.3s;
} }
} }