Skip to content

Commit

Permalink
Merge pull request #180 from pt-kompas-media-nusantara/feature/95510-…
Browse files Browse the repository at this point in the history
…change-copy-and-cta-metered-register-wall

call ctaUrl and ctaText from API
  • Loading branch information
prasetiyo28 authored Apr 3, 2024
2 parents a347a1a + 1fcb8ed commit e5807f5
Showing 1 changed file with 3 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -178,15 +178,15 @@ export class KompasMeteredRegister {
return (
// kondisi cta_url
<div>
{!this.cta_url ? (
{!this.textTemplate.ctaUrl ? (
// kalau cta_url kosong
<button onClick={this.redirectToRegister} class="bg-green-500 p-1.5 w-full md:w-auto rounded-md font-bold text-grey-100 px-5 text-sm md:text-base">
Daftar Akun
</button>
) : (
// kalau cta_url ada isi
<a href={this.cta_url}>
<button class="bg-green-500 p-1.5 w-full md:w-auto rounded-md font-bold text-grey-100 px-5 text-sm md:text-base">{this.cta_text}</button>
<a href={this.textTemplate.ctaUrl}>
<button class="bg-green-500 p-1.5 w-full md:w-auto rounded-md font-bold text-grey-100 px-5 text-sm md:text-base">{this.textTemplate.ctaText}</button>
</a>
)}
</div>
Expand Down Expand Up @@ -255,7 +255,6 @@ export class KompasMeteredRegister {
* fetch() mendapatkan respons 200
*/
this.textTemplate = await req.json();

const getCountdown = this.countdownArticle;
if (!getCountdown) {
this.isShowBanner = false;
Expand Down

0 comments on commit e5807f5

Please sign in to comment.