Skip to content

Refactor suffix rendering logic in flux:menu.item component#2630

Open
ghabriel25 wants to merge 1 commit into
livewire:mainfrom
ghabriel25:remove-uneccessary-check
Open

Refactor suffix rendering logic in flux:menu.item component#2630
ghabriel25 wants to merge 1 commit into
livewire:mainfrom
ghabriel25:remove-uneccessary-check

Conversation

@ghabriel25

Copy link
Copy Markdown
Contributor

Just a tiny refactor for flux:menu.item

Before

image

After

image

File Changed

  • stubs/resources/views/flux/menu/item.blade.php

@joshhanley

Copy link
Copy Markdown
Member

@ghabriel25 thanks for the PR! Personally, I prefer the before as I find it easier to read 😅 mainly because I know nothing in that block will happen if there is no suffix. But let's see what Caleb thinks

@ghabriel25

ghabriel25 commented May 27, 2026

Copy link
Copy Markdown
Contributor Author

@joshhanley It's okay. This refactor just following how other components handle conditional slot/text

@ganyicz

ganyicz commented May 28, 2026

Copy link
Copy Markdown
Collaborator

A more compelling argument here would be that the component renders more correctly now.

Before, the truthiness check would disregard the suffix if the value is 0 string.

SCR-20260528-inai

@ghabriel25

Copy link
Copy Markdown
Contributor Author

@ganyicz Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants