Skip to content

Commit

Permalink
upodate CTAs on the pricing page to lead to org creation when user is…
Browse files Browse the repository at this point in the history
… signed in (#13129)
  • Loading branch information
shughes26 authored Oct 16, 2024
1 parent 253448b commit 380fc90
Show file tree
Hide file tree
Showing 4 changed files with 31 additions and 10 deletions.
2 changes: 1 addition & 1 deletion assets/js/bundle.js

Large diffs are not rendered by default.

25 changes: 18 additions & 7 deletions layouts/page/pricing.html
Original file line number Diff line number Diff line change
Expand Up @@ -74,15 +74,26 @@ <h4 class="text-center">{{ $tier.title }}</h4>
</div>
{{ if eq $index 0 }}
<div class="flex flex-wrap flex-col justify-center align-center items-center text-center my-4 h-14 lg:h-24 xl:h-14">
<pricing-cta button-class="text-white text-s bg-violet-600 border-2 border-violet-600 rounded-lg py-2 px-2 hover:bg-violet-500"></pricing-cta>
<pricing-cta button-class="text-white text-s bg-violet-600 border-2 border-violet-600 rounded-lg py-2 px-2 hover:bg-violet-500 text-nowrap" signed-in-text="Create an Organization" signed-out-text="Sign Up"></pricing-cta>
</div>
{{ else if eq $index 1 }}
<div class="flex flex-wrap justify-center items-center text-center my-4 h-14 lg:h-24 xl:h-14">
<pricing-cta button-class="text-white text-s bg-violet-600 border-2 border-violet-600 rounded-lg py-2 px-2 hover:bg-violet-500 text-nowrap" signed-in-text="{{ $tier.primary_cta }}" signed-out-text="{{ $tier.primary_cta }}"></pricing-cta>
</div>
{{ else if eq $index 2 }}
<div class="flex flex-wrap justify-center items-center text-center my-4 h-14 lg:h-24 xl:h-14">
<pricing-cta button-class="text-white text-s bg-violet-600 border-2 border-violet-600 rounded-lg py-2 px-2 hover:bg-violet-500 text-nowrap mr-1 mb-0 lg:mb-1 xl:mb-0" signed-in-text="{{ $tier.primary_cta }}" signed-out-text="{{ $tier.primary_cta }}"></pricing-cta>
{{ if $tier.secondary_cta }}
<a href="{{ $tier.secondary_cta_link }}" class="text-violet-600 text-s border-2 border-violet-600 rounded-lg py-2 px-2 hover:bg-violet-100">{{ $tier.secondary_cta }}</a>
{{ end }}
</div>
{{ else }}
<div class="flex flex-wrap justify-center items-center text-center my-4 h-14 lg:h-24 xl:h-14">
<a href="{{ $tier.primary_cta_link}}" class="text-white text-s bg-violet-600 border-2 border-violet-600 rounded-lg py-2 px-2 hover:bg-violet-500 mr-1 mb-0 lg:mb-1 xl:mb-0">{{ $tier.primary_cta }}</a>
{{ if $tier.secondary_cta }}
<a href="{{ $tier.secondary_cta_link }}" class="text-violet-600 text-s border-2 border-violet-600 rounded-lg py-2 px-2 hover:bg-violet-100">{{ $tier.secondary_cta }}</a>
{{ end }}
</div>
<div class="flex flex-wrap justify-center items-center text-center my-4 h-14 lg:h-24 xl:h-14">
<a href="{{ $tier.primary_cta_link}}" class="text-white text-s bg-violet-600 border-2 border-violet-600 rounded-lg py-2 px-2 hover:bg-violet-500 mr-1 mb-0 lg:mb-1 xl:mb-0">{{ $tier.primary_cta }}</a>
{{ if $tier.secondary_cta }}
<a href="{{ $tier.secondary_cta_link }}" class="text-violet-600 text-s border-2 border-violet-600 rounded-lg py-2 px-2 hover:bg-violet-100">{{ $tier.secondary_cta }}</a>
{{ end }}
</div>
{{ end }}
<div class="border-dotted border-2 border-gray-200 rounded-lg px-4">
<div class="text-sm">{{ $tier.items | markdownify }}</div>
Expand Down
4 changes: 4 additions & 0 deletions theme/stencil/src/components.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export namespace Components {
}
interface PricingCta {
"buttonClass": string;
"signedInText": string;
"signedOutText": string;
}
interface PulumiApiDocFilterableNav {
"baseDirectory": string;
Expand Down Expand Up @@ -525,6 +527,8 @@ declare namespace LocalJSX {
}
interface PricingCta {
"buttonClass"?: string;
"signedInText"?: string;
"signedOutText"?: string;
}
interface PulumiApiDocFilterableNav {
"baseDirectory"?: string;
Expand Down
10 changes: 8 additions & 2 deletions theme/stencil/src/components/pricing-cta/pricing-cta.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@ export class pricingCta {
@Prop()
buttonClass = "";

@Prop()
signedInText: string;

@Prop()
signedOutText: string;

@State()
loading = true;

Expand Down Expand Up @@ -38,12 +44,12 @@ export class pricingCta {

if (this.isLoggedIn) {
return(
<a class={this.buttonClass} href="https://app.pulumi.com/?create-organization=1" target="_blank">Create an Organization</a>
<a class={this.buttonClass} href="https://app.pulumi.com/?create-organization=1" target="_blank">{this.signedInText}</a>
);
}

return (
<a class={this.buttonClass} href="https://app.pulumi.com/signup/" target="_blank">Sign Up</a>
<a class={this.buttonClass} href="https://app.pulumi.com/signup/" target="_blank">{this.signedOutText}</a>
);
}

Expand Down

0 comments on commit 380fc90

Please sign in to comment.