Skip to content

Commit

Permalink
UnderlineNav: Display loading counters only for items with the "count…
Browse files Browse the repository at this point in the history
…er" prop (#4745)

* shows LoadingCounter only when counter prop is given

* shows LoadingCounter only when counter prop is given

* test(vrt): update snapshots

* Update .changeset/erken-gelen-oturur.md

---------

Co-authored-by: Katie Langerman <18661030+langermank@users.noreply.github.com>
Co-authored-by: Josh Black <joshblack@users.noreply.github.com>
Co-authored-by: Armağan <broccolinisoup@github.com>
  • Loading branch information
4 people authored Nov 12, 2024
1 parent 1fb1160 commit 3f508c7
Show file tree
Hide file tree
Showing 11 changed files with 12 additions and 7 deletions.
5 changes: 5 additions & 0 deletions .changeset/erken-gelen-oturur.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@primer/react': patch
---

UnderlineNav: Display loading counters only for items with the "counter" prop.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -220,17 +220,17 @@ export const UnderlineItem = forwardRef(
{children}
</span>
)}
{loadingCounters ? (
<span data-component="counter">
<LoadingCounter />
</span>
) : (
counter !== undefined && (
{counter !== undefined ? (
loadingCounters ? (
<span data-component="counter">
<LoadingCounter />
</span>
) : (
<span data-component="counter">
<CounterLabel>{counter}</CounterLabel>
</span>
)
)}
) : null}
</StyledUnderlineItem>
)
},
Expand Down

0 comments on commit 3f508c7

Please sign in to comment.