From e2dbe974f163226235f284c9f6fc0cacb9e87c00 Mon Sep 17 00:00:00 2001 From: Jens Deprez Date: Wed, 8 Jan 2025 13:54:42 +0100 Subject: [PATCH] Conditional removal of the image: This ensures the image wrapper is not rendered if imageUrlFormatted evaluates to null. --- src/components/lod-card/lod-card.tsx | 109 ++++++++++++++------------- src/index.html | 87 +++++++++++++++++++++ 2 files changed, 143 insertions(+), 53 deletions(-) diff --git a/src/components/lod-card/lod-card.tsx b/src/components/lod-card/lod-card.tsx index 04cd7b7..c88c399 100644 --- a/src/components/lod-card/lod-card.tsx +++ b/src/components/lod-card/lod-card.tsx @@ -57,52 +57,53 @@ export class LodCard { return readMoreText && readMoreText !== "" ? readMoreText : "Lees meer"; } - render() { - return ( -
  • -
    -
    - {this.cardTitle &&

    {this.cardTitle}

    } +render() { + return ( +
  • +
    +
    + {this.cardTitle &&

    {this.cardTitle}

    } - {this.tagSplitted?.length > 0 && ( -
    -
      - {this.tagSplitted?.map((tag) => ( -
    • - {tag} -
    • - ))} -
    -
    - )} - -
    - {this.description && this.description !== "" && ( -

    {this.description}

    - )} - - {this.address && this.address !== "" && ( - - {this.address} - - )} - {this.date && this.date !== "" && } + {this.tagSplitted?.length > 0 && ( +
    +
      + {this.tagSplitted?.map((tag) => ( +
    • + {tag} +
    • + ))} +
    + )} + +
    + {this.description && this.description !== "" && ( +

    {this.description}

    + )} - {this.readMoreUrl && ( - - {this.readMoreTextFormatted} - over {this.cardTitle} + {this.address && this.address !== "" && ( + + {this.address} )} + {this.date && this.date !== "" && }
    - +
    +
    + + {this.imageUrlFormatted && (
    @@ -115,19 +116,21 @@ export class LodCard {
    -
    -
    - {this.readMoreUrl && ( - - )} -
  • - ); - } + )} +
    +
    + {this.readMoreUrl && ( + + )} +
  • + ); +} + } diff --git a/src/index.html b/src/index.html index 6a900ce..43324af 100644 --- a/src/index.html +++ b/src/index.html @@ -55,6 +55,93 @@ Meest recente reglementen Stad Gent + +