Sha256: 7c8b465da7ec0cea4d148d3150d8212eb617c7dcadbb7a91daada6a31c2dafe9
Contents?: true
Size: 1.28 KB
Versions: 38
Compression:
Stored size: 1.28 KB
Contents
/* @flow */ import React from 'react' import { Body, Title } from '../' type ProgressPillsProps = { active?: Number, steps?: Number, title?: String, value?: String, dark?: Boolean, } const showSteps = (steps, active, dark) => { const items = [] for (let step = 1; step <= steps; step++) { items.push(ProgressPill({ step, active, dark })) } return items } const ProgressPill = ({ active, dark, step, }: ProgressPillProps) => ( <div className={`pb_progress_pill${step <= active ? '_active' : '_inactive'}${dark ? '_dark' : null}`} key={step} /> ) const ProgressPills = ({ active = 0, steps = 3, title = null, value = null, dark = false }: ProgressPillsProps) => { const darkClass = dark ? '_dark' : '' return ( <div className={`pb_progress_pills_kit${darkClass}`}> <If condition={title}> <div className="progress_pills_status"> <Title dark={dark} size={4} tag="h4" text={title} /> <Body color="light" dark={dark} text={value} /> </div> </If> <div className="progress_pills"> {showSteps(steps, active, dark)} </div> </div> ) } export default ProgressPills
Version data entries
38 entries across 38 versions & 1 rubygems