Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

stats overview card: add description icon position #5232

Merged
merged 2 commits into from
Dec 13, 2022
Merged

stats overview card: add description icon position #5232

merged 2 commits into from
Dec 13, 2022

Conversation

kamilst96
Copy link
Contributor

I want to place description icon before description text in StatsOverviewWidget.

Screenshot:
1

I extended description icon setter:
descriptionIcon(?string $icon, ?string $position = null)

Is it acceptable, or should it be like this?
descriptionIcon(?string $icon)
descriptionIconPosition(?string $position)

I am also not sure what to do about duplicated dynamic component.

@what-the-diff
Copy link
Contributor

what-the-diff bot commented Dec 13, 2022

  • Added descriptionIconPosition to the Card component.
  • Updated card and stats-overview-widget/card components with new property (descriptionIconPosition).
  • Updated Card class with getDescriptionIconPosition method, which returns null by default or value passed in via $position parameter of descriptionIcon() function call on a given instance of this class.

@zepfietje zepfietje added the enhancement New feature or request label Dec 13, 2022
@zepfietje zepfietje added this to the v2 milestone Dec 13, 2022
@danharrin danharrin merged commit acccca1 into filamentphp:2.x Dec 13, 2022
@danharrin
Copy link
Member

Thanks

@zepfietje
Copy link
Member

Isn't it better to explicitly name after?

@danharrin
Copy link
Member

after by default. the property usually returns null

@zepfietje
Copy link
Member

For buttons we do use before as default instead of null though.

@danharrin
Copy link
Member

feel free to change it if you want

@kamilst96 kamilst96 deleted the description-icon-before branch December 13, 2022 17:24
@gldtn
Copy link

gldtn commented Dec 29, 2023

Sorry to post here guys, but this is the closest thing I found while searching, how can I set description icon position in filament 3? I tried passing to the stat ->descriptionIconPosition, tried something like protected static ?string $descriptionIconPosition = 'before';

but can't find any documentation on this

@danharrin
Copy link
Member

danharrin commented Dec 30, 2023

second param of descriptionIcon()

@gldtn
Copy link

gldtn commented Dec 30, 2023

Thank you @danharrin!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants