mirror of
https://github.com/elyby/accounts-frontend.git
synced 2025-01-16 08:33:15 +05:30
#305: implement Stepper theming for green and violet colors
This commit is contained in:
parent
991931eef3
commit
f5c1ef4217
@ -18,8 +18,6 @@ import messages from './ChangeEmail.intl.json';
|
|||||||
const STEPS_TOTAL = 3;
|
const STEPS_TOTAL = 3;
|
||||||
|
|
||||||
export default class ChangeEmail extends Component {
|
export default class ChangeEmail extends Component {
|
||||||
static displayName = 'ChangeEmail';
|
|
||||||
|
|
||||||
static propTypes = {
|
static propTypes = {
|
||||||
onChangeStep: PropTypes.func,
|
onChangeStep: PropTypes.func,
|
||||||
lang: PropTypes.string.isRequired,
|
lang: PropTypes.string.isRequired,
|
||||||
@ -96,8 +94,8 @@ export default class ChangeEmail extends Component {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={changeEmail.stepper}>
|
<div className={styles.stepper}>
|
||||||
<Stepper totalSteps={STEPS_TOTAL} activeStep={activeStep} />
|
<Stepper color="violet" totalSteps={STEPS_TOTAL} activeStep={activeStep} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className={styles.form}>
|
<div className={styles.form}>
|
||||||
|
@ -1,15 +1,3 @@
|
|||||||
@import '~components/ui/colors.scss';
|
|
||||||
|
|
||||||
.stepper {
|
|
||||||
composes: stepper from 'components/profile/profileForm.scss';
|
|
||||||
|
|
||||||
.activeStep {
|
|
||||||
&:after {
|
|
||||||
background: $violet;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.currentAccountEmail {
|
.currentAccountEmail {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
text-overflow: ellipsis;
|
text-overflow: ellipsis;
|
||||||
|
@ -15,7 +15,6 @@ import mfa from 'services/api/mfa';
|
|||||||
import Instructions from './instructions';
|
import Instructions from './instructions';
|
||||||
import KeyForm from './keyForm';
|
import KeyForm from './keyForm';
|
||||||
import Confirmation from './confirmation';
|
import Confirmation from './confirmation';
|
||||||
import mfaStyles from './mfa.scss';
|
|
||||||
import messages from './MultiFactorAuth.intl.json';
|
import messages from './MultiFactorAuth.intl.json';
|
||||||
|
|
||||||
const STEPS_TOTAL = 3;
|
const STEPS_TOTAL = 3;
|
||||||
|
@ -1,2 +0,0 @@
|
|||||||
@import '~components/ui/colors.scss';
|
|
||||||
|
|
@ -1,17 +1,27 @@
|
|||||||
export const SKIN_DARK = 'dark';
|
// @flow
|
||||||
export const SKIN_LIGHT = 'light';
|
export type Color = 'green'
|
||||||
|
|'blue'
|
||||||
|
|'darkBlue'
|
||||||
|
|'violet'
|
||||||
|
|'lightViolet'
|
||||||
|
|'orange'
|
||||||
|
|'red'
|
||||||
|
|'black'
|
||||||
|
|'white';
|
||||||
|
|
||||||
export const COLOR_GREEN = 'green';
|
export type Skin = 'dark'|'light';
|
||||||
export const COLOR_BLUE = 'blue';
|
|
||||||
export const COLOR_DARK_BLUE = 'darkBlue';
|
|
||||||
export const COLOR_VIOLET = 'violet';
|
|
||||||
export const COLOR_LIGHT_VIOLET = 'lightViolet';
|
|
||||||
export const COLOR_ORANGE = 'orange';
|
|
||||||
export const COLOR_RED = 'red';
|
|
||||||
export const COLOR_BLACK = 'black';
|
|
||||||
export const COLOR_WHITE = 'white';
|
|
||||||
|
|
||||||
export const colors = [
|
export const COLOR_GREEN: Color = 'green';
|
||||||
|
export const COLOR_BLUE: Color = 'blue';
|
||||||
|
export const COLOR_DARK_BLUE: Color = 'darkBlue';
|
||||||
|
export const COLOR_VIOLET: Color = 'violet';
|
||||||
|
export const COLOR_LIGHT_VIOLET: Color = 'lightViolet';
|
||||||
|
export const COLOR_ORANGE: Color = 'orange';
|
||||||
|
export const COLOR_RED: Color = 'red';
|
||||||
|
export const COLOR_BLACK: Color = 'black';
|
||||||
|
export const COLOR_WHITE: Color = 'white';
|
||||||
|
|
||||||
|
export const colors: Array<Color> = [
|
||||||
COLOR_GREEN,
|
COLOR_GREEN,
|
||||||
COLOR_BLUE,
|
COLOR_BLUE,
|
||||||
COLOR_DARK_BLUE,
|
COLOR_DARK_BLUE,
|
||||||
@ -23,4 +33,7 @@ export const colors = [
|
|||||||
COLOR_WHITE
|
COLOR_WHITE
|
||||||
];
|
];
|
||||||
|
|
||||||
export const skins = [SKIN_DARK, SKIN_LIGHT];
|
export const SKIN_DARK: Skin = 'dark';
|
||||||
|
export const SKIN_LIGHT: Skin = 'light';
|
||||||
|
|
||||||
|
export const skins: Array<Skin> = [SKIN_DARK, SKIN_LIGHT];
|
||||||
|
@ -3,17 +3,23 @@ import React from 'react';
|
|||||||
|
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
|
|
||||||
|
import { COLOR_GREEN } from 'components/ui';
|
||||||
|
|
||||||
import styles from './stepper.scss';
|
import styles from './stepper.scss';
|
||||||
|
|
||||||
|
import type { Color } from 'components/ui';
|
||||||
|
|
||||||
export default function Stepper({
|
export default function Stepper({
|
||||||
totalSteps,
|
totalSteps,
|
||||||
activeStep
|
activeStep,
|
||||||
|
color = COLOR_GREEN
|
||||||
} : {
|
} : {
|
||||||
totalSteps: number,
|
totalSteps: number,
|
||||||
activeStep: number
|
activeStep: number,
|
||||||
|
color: Color
|
||||||
}) {
|
}) {
|
||||||
return (
|
return (
|
||||||
<div className={styles.steps}>
|
<div className={classNames(styles.steps, styles[`${color}Steps`])}>
|
||||||
{(new Array(totalSteps)).fill(0).map((_, step) => (
|
{(new Array(totalSteps)).fill(0).map((_, step) => (
|
||||||
<div className={classNames(styles.step, {
|
<div className={classNames(styles.step, {
|
||||||
[styles.activeStep]: step <= activeStep
|
[styles.activeStep]: step <= activeStep
|
||||||
|
@ -65,3 +65,19 @@
|
|||||||
transition-delay: 0.3s;
|
transition-delay: 0.3s;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.greenSteps {
|
||||||
|
.activeStep {
|
||||||
|
&:after {
|
||||||
|
background: $green;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.violetSteps {
|
||||||
|
.activeStep {
|
||||||
|
&:after {
|
||||||
|
background: $violet;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user