feat(pricing): separate companies and individuals

This commit is contained in:
Oliver Davies 2023-09-14 14:32:05 +01:00
parent e5473613d1
commit e242b54a5d
2 changed files with 147 additions and 108 deletions

View file

@ -13,10 +13,13 @@ export const priceFormatter = new Intl.NumberFormat('en-GB', {
style: 'currency', style: 'currency',
}); });
<div class="space-y-6"> <div class="space-y-4">
{products && products.map(product => ( <div>
<h2>For companies</h2>
{products && products.company.map(product => (
<article class="space-y-4"> <article class="space-y-4">
<h2> <h3>
{product.title} - <> </> {product.title} - <> </>
{product.price {product.price
? ( ? (
@ -26,7 +29,7 @@ export const priceFormatter = new Intl.NumberFormat('en-GB', {
) )
: 'Free!' : 'Free!'
} }
</h2> </h3>
<div> <div>
<p> <p>
@ -40,4 +43,36 @@ export const priceFormatter = new Intl.NumberFormat('en-GB', {
</footer> </footer>
</article> </article>
))} ))}
</div>
<div>
<h2>For individuals</h2>
{products && products.individuals.map(product => (
<article class="space-y-4">
<h3>
{product.title} - <> </>
{product.price
? (
<>{priceFormatter.format(product.price)}
{product.perMonth && (<> per month</>)}
</>
)
: 'Free!'
}
</h3>
<div>
<p>
{product.description}
{product.isLimited && (<> <strong>Limited places available!</strong></>)}
</p>
</div>
<footer>
<a href={product.link.href}>{product.link.text} &rarr;</a>
</footer>
</article>
))}
</div>
</div> </div>

View file

@ -1,4 +1,5 @@
[ {
"company": [
{ {
"title": "Diagnosis", "title": "Diagnosis",
"description": "An in-depth investigation into a single issue where I'll provide a report with my findings and advice on the next steps. Once you've purchased, you can book a Zoom call with me to discuss what you want me to investigate.", "description": "An in-depth investigation into a single issue where I'll provide a report with my findings and advice on the next steps. Once you've purchased, you can book a Zoom call with me to discuss what you want me to investigate.",
@ -36,7 +37,9 @@
"text": "Schedule a talk", "text": "Schedule a talk",
"href": "https://buy.stripe.com/eVa4h0bgSaPM6NqcMU" "href": "https://buy.stripe.com/eVa4h0bgSaPM6NqcMU"
} }
}, }
],
"individuals": [
{ {
"title": "1-on-1 development coaching", "title": "1-on-1 development coaching",
"description": "The same as development team coaching, but for individual Developers and soloists.", "description": "The same as development team coaching, but for individual Developers and soloists.",
@ -82,4 +85,5 @@
"href": "https://github.com/opdavies/drupal-module-template" "href": "https://github.com/opdavies/drupal-module-template"
} }
} }
] ]
}