Skip to content

Commit 680f92a

Browse files
authored
Merge pull request #3255 from appirio-tech/hotfix/added_support_for_hidding_project_price
[HOTFIX/MASTER]added support for hiding price in forms
2 parents 875eac1 + 0b151a2 commit 680f92a

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

src/projects/create/components/FillProjectDetails.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ class FillProjectDetails extends Component {
6868
template={template}
6969
currentWizardStep={currentWizardStep}
7070
project={dirtyProject}
71+
hidePrice={template.hidePrice}
7172
/>
7273
)
7374
}

src/projects/create/components/HeaderWithProgress.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,20 @@ import './HeaderWithProgress.scss'
99

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

12-
function HeaderWithProgress({project, template, currentWizardStep}) {
12+
function HeaderWithProgress({project, template, currentWizardStep, hidePrice}) {
1313
const flatProject = flatten(removeValuesOfHiddenNodes(template, project), { safe: true })
1414
const { priceEstimate } = getProductEstimate({scope: template}, flatProject)
1515
const progress = currentWizardStep ? getWizardProgress(template, currentWizardStep) : 0
1616

1717
const currentStep = template.sections[(currentWizardStep || {}).sectionIndex || 0]
18-
1918
return (
2019
<div styleName="HeaderWithProgress">
2120
<div styleName="content">
2221
<div styleName="title-estimate">
2322
<h3>{currentStep.title}</h3>
24-
<div>From ${numberWithCommas(priceEstimate)}</div>
23+
{ !hidePrice ?
24+
<div>From ${numberWithCommas(priceEstimate)}</div> : ''
25+
}
2526
</div>
2627
<div styleName="progress-bar">
2728
<div styleName="progress" style={{width: (progress*100)+'%'}} />
@@ -35,6 +36,7 @@ HeaderWithProgress.propTypes = {
3536
project: PT.object.isRequired,
3637
template: PT.object.isRequired,
3738
currentWizardStep: PT.object,
39+
hidePrice: PT.bool,
3840
}
3941

4042
export default HeaderWithProgress

0 commit comments

Comments
 (0)