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

KOA-5354 Enable shadowless cards #1344

Merged
merged 9 commits into from
Jun 24, 2022
Merged

Conversation

frugoman
Copy link
Contributor

Cards without shadow
Given that the apis of SwiftUI and UIKit differ, the solution is different on the 2 systems, with SwiftUI being the preferred one.

Remember to include the following changes:

If you are curious about how we review, please read through the code review guidelines

@frugoman frugoman added the minor Non breaking change label Jun 22, 2022
@frugoman frugoman enabled auto-merge (squash) June 22, 2022 17:02
@frugoman frugoman disabled auto-merge June 22, 2022 17:03
@frugoman frugoman enabled auto-merge (squash) June 22, 2022 17:03
@@ -43,7 +43,7 @@ public struct BPKCard<Content: View>: View {
}
}

private var elevation: Elevation
private var elevation: Elevation?
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is there a specific reason to make the elevation nullable?
If the user doesn't provide an elevation, we will fallback to 'default'.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I thought about it like if you want no elevation, this could be represented as nil, as a lack of being a shadow.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel it might be better to be explicit about it.
considering:

  • Not supplying = .default
  • Making it nil = no shadow
  • Passing in .none = no shadow

If we make it non nullable, then we fallback to default and people supply .none to hide the shadow.


extension View {
@ViewBuilder
func shadow(_ shadow: BPKShadow?) -> some View {
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is internal on purpose

Copy link
Contributor

@gert-janvercauteren gert-janvercauteren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code looks good!

Please update the README.md for both SwiftUI and UIKit components :D

Copy link
Contributor

@gert-janvercauteren gert-janvercauteren left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@frugoman frugoman merged commit 638a159 into main Jun 24, 2022
@frugoman frugoman deleted the KOA-5354_no-shadows-card-panel branch June 24, 2022 10:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
minor Non breaking change
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants