Skip to content

Commit

Permalink
Merge pull request #179 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

fix logic cta_url
  • Loading branch information
prasetiyo28 authored Apr 3, 2024
2 parents f38d5aa + 9f50f78 commit a347a1a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -176,12 +176,15 @@ export class KompasMeteredRegister {
*/
private registerButtonTemplate = (): void => {
return (
// kondisi cta_url
<div>
{this.cta_url !== '' ? (
{!this.cta_url ? (
// 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>
Expand Down
2 changes: 2 additions & 0 deletions src/components/kompas-metered-register/readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ Dengan format dibawah ini:
| Property | Attribute | Description | Type | Default |
| -------------------------------- | -------------------------------- | ----------------------------------------------------------------------------------------------------- | --------- | ----------- |
| `countdownArticle` | `countdown-article` | prop countdownArticle untuk menghandle sudah berapa artikel gratis yang user baca. | `number` | `0` |
| `cta_url` | `cta_url` | prop cta_url untuk custom url di button. | `string` | `undefined` |
| `cta_text` | `cta_text` | prop cta_text untuk custom text di button. | `string` | `undefined` |
| `defaultExpandBanner` | `default-expand-banner` | prop defaultExpandBanner untuk menentukan keadaan awal komponen apakah dalam mode expand atau tidak. | `boolean` | `true` |
| `next_param` | `next_param` | Page Domain | `string` | `undefined` |
| `tracker_content_authors` | `tracker_content_authors` | Name of the authors (will only be sent if the user views article detail page) | `string` | `undefined` |
Expand Down

0 comments on commit a347a1a

Please sign in to comment.