Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/projects/create/components/FillProjectDetails.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ class FillProjectDetails extends Component {
template={template}
currentWizardStep={currentWizardStep}
project={dirtyProject}
hidePrice={template.hidePrice}
/>
)
}
Expand Down
8 changes: 5 additions & 3 deletions src/projects/create/components/HeaderWithProgress.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,19 +9,20 @@ import './HeaderWithProgress.scss'

const numberWithCommas = (n) => n.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ',')

function HeaderWithProgress({project, template, currentWizardStep}) {
function HeaderWithProgress({project, template, currentWizardStep, hidePrice}) {
const flatProject = flatten(removeValuesOfHiddenNodes(template, project), { safe: true })
const { priceEstimate } = getProductEstimate({scope: template}, flatProject)
const progress = currentWizardStep ? getWizardProgress(template, currentWizardStep) : 0

const currentStep = template.sections[(currentWizardStep || {}).sectionIndex || 0]

return (
<div styleName="HeaderWithProgress">
<div styleName="content">
<div styleName="title-estimate">
<h3>{currentStep.title}</h3>
<div>From ${numberWithCommas(priceEstimate)}</div>
{ !hidePrice ?
<div>From ${numberWithCommas(priceEstimate)}</div> : ''
}
</div>
<div styleName="progress-bar">
<div styleName="progress" style={{width: (progress*100)+'%'}} />
Expand All @@ -35,6 +36,7 @@ HeaderWithProgress.propTypes = {
project: PT.object.isRequired,
template: PT.object.isRequired,
currentWizardStep: PT.object,
hidePrice: PT.bool,
}

export default HeaderWithProgress