From cf49ab8c1cf7d58858494a8f784407c25012cd5c Mon Sep 17 00:00:00 2001 From: Dave Skender <8432125+DaveSkender@users.noreply.github.com> Date: Sat, 11 Nov 2023 06:27:28 -0500 Subject: [PATCH] refactor: control flow syntax (#102) --- .../site-card/site-card.component.html | 11 ++-- src/app/pages/bubbles/bubbles.component.html | 26 +++++----- .../card-catalog/card-catalog.component.html | 52 +++++++++++++------ src/app/pages/home/home.component.html | 8 ++- 4 files changed, 62 insertions(+), 35 deletions(-) diff --git a/src/app/components/site-card/site-card.component.html b/src/app/components/site-card/site-card.component.html index aae1711..16bc09b 100644 --- a/src/app/components/site-card/site-card.component.html +++ b/src/app/components/site-card/site-card.component.html @@ -7,15 +7,18 @@

{{ card.title }}

- + @if (!card.imageType) { + + } -
- + @if (card.imageType === 'usa-icon') { +
+
+ }
diff --git a/src/app/pages/bubbles/bubbles.component.html b/src/app/pages/bubbles/bubbles.component.html index 0e4d282..a994bf6 100644 --- a/src/app/pages/bubbles/bubbles.component.html +++ b/src/app/pages/bubbles/bubbles.component.html @@ -18,15 +18,17 @@
- + @for (card of cards; track card; let i = $index) { + + }
@@ -40,8 +42,8 @@ It'd be difficult to do this using the standard Layout grid. + href="https://designsystem.digital.gov/utilities/layout-grid/" + target="_blank" + rel="noopener noreferrer nofollow">Layout grid.

diff --git a/src/app/pages/card-catalog/card-catalog.component.html b/src/app/pages/card-catalog/card-catalog.component.html index f6c0661..7662de0 100644 --- a/src/app/pages/card-catalog/card-catalog.component.html +++ b/src/app/pages/card-catalog/card-catalog.component.html @@ -21,7 +21,8 @@
-
+ @if (!classic) { +

Showing {{ cards.length }} of {{ totalCards }} cards

-
    + @if (cards.length < totalCards) { +
    + }
+ } -
+ @if (classic) { +

Showing {{cardStart}}-{{cardEnd}} of {{totalCards}} cards

+ } diff --git a/src/app/pages/home/home.component.html b/src/app/pages/home/home.component.html index d50592c..ff9540e 100644 --- a/src/app/pages/home/home.component.html +++ b/src/app/pages/home/home.component.html @@ -23,9 +23,11 @@

    -
  • + @for (card of cards; track card; let i = $index) { +
  • + }
  • @@ -40,7 +42,8 @@

    -
      + @if (cards.length > 9) { +
      + }

      About us