Decathlon / vitamin-ios

Decathlon Design System UI components for iOS & iPadOS applications
https://www.decathlon.design
Apache License 2.0
46 stars 14 forks source link

feat: add full width support for SwiftUI button #123

Closed jdanthinne closed 1 year ago

jdanthinne commented 1 year ago

Changes description

Add full width support for SwiftUI button

Context

Currently, SwiftUI button can't be sized to full width using .frame(maxWidth: .infinity).

Checklist

Does this introduce a breaking change?

CLAassistant commented 1 year ago

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.


Jérôme Danthinne seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account.
You have signed the CLA already but the status is still pending? Let us recheck it.

sonarcloud[bot] commented 1 year ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

daniel-dumortier commented 1 year ago

Thanks for the contribution, @jdanthinne ! Would you mind adding code to Showcase app to demonstrate this new feature ?

I think a quick way could be to add a second toggle below "show enabled state" on ButtonsView to allow toggling between normal and fullWidth buttons (only for the first two buttons of each cell, i.e. buttons that do have a label).

Thanks in advance

daniel-dumortier commented 1 year ago

And could you also create a pull request from a feature branch of your fork, and not from your main branch ?

jdanthinne commented 1 year ago

Done here: https://github.com/Decathlon/vitamin-ios/pull/124