mirror of
https://github.com/kremalicious/metamask-extension.git
synced 2024-12-23 09:52:26 +01:00
35 lines
876 B
JavaScript
35 lines
876 B
JavaScript
import React, { PureComponent } from 'react';
|
|
import PropTypes from 'prop-types';
|
|
import classnames from 'classnames';
|
|
|
|
export default class Breadcrumbs extends PureComponent {
|
|
static propTypes = {
|
|
className: PropTypes.string,
|
|
currentIndex: PropTypes.number,
|
|
total: PropTypes.number,
|
|
};
|
|
|
|
render() {
|
|
const { className, currentIndex, total } = this.props;
|
|
|
|
return (
|
|
<div className={classnames('breadcrumbs', className)}>
|
|
{Array(total)
|
|
.fill()
|
|
.map((_, i) => (
|
|
<div
|
|
key={i}
|
|
className="breadcrumb"
|
|
style={{
|
|
backgroundColor:
|
|
i === currentIndex
|
|
? 'var(--color-background-alternative)'
|
|
: 'var(--color-background-default)',
|
|
}}
|
|
/>
|
|
))}
|
|
</div>
|
|
);
|
|
}
|
|
}
|