Automattic / Gravatar-SDK-iOS

Gravatar SDK is a Swift library that allows you to integrate Gravatar features into your own iOS applications.
https://gravatar.com
Mozilla Public License 2.0
36 stars 1 forks source link

Add a reusable SwiftUI Toast #350

Closed pinarol closed 1 month ago

pinarol commented 1 month ago

Closes #344

From figma:

Screenshot 2024-08-12 at 15 43 15

Description

https://github.com/user-attachments/assets/3d89d702-7a1f-4d1f-a89f-27b761a2af9b

Testing Steps

You can also play around with ToastContainerView preview.

wpmobilebot commented 1 month ago
Gravatar UIKit Prototype Build📲 You can test the changes from this Pull Request in Gravatar UIKit Prototype Build by scanning the QR code below to install the corresponding build.
App NameGravatar UIKit Prototype Build Gravatar UIKit Prototype Build
Build Number1077
Version1.0
Bundle IDcom.automattic.gravatar-sdk-demo-uikit.prototype-build
Commitda8749cb26a4631fed378bc61eb0347dcf2b9a6f
App Center BuildGravatar SDK Demo - UIKit #26
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.
wpmobilebot commented 1 month ago
Gravatar SwiftUI Prototype Build📲 You can test the changes from this Pull Request in Gravatar SwiftUI Prototype Build by scanning the QR code below to install the corresponding build.
App NameGravatar SwiftUI Prototype Build Gravatar SwiftUI Prototype Build
Build Number1077
Version1.0
Bundle IDcom.automattic.gravatar-sdk-demo-swiftui.prototype-build
Commitda8749cb26a4631fed378bc61eb0347dcf2b9a6f
App Center BuildGravatar SDK Demo - SwiftUI #25
Automatticians: You can use our internal self-serve MC tool to give yourself access to App Center if needed.
pinarol commented 1 month ago

.transition(.opacity.combined(with: .move(edge: .bottom)))

This looks nice. I am adding.

It would be great to have a dismiss by the swipe down gesture. I believe many people would try this by default as first attempt of dismissing (more than tapping in a button).

This is not a very simple thing to get right and not sure it should be in the 1st iteration. If we take care of the "must have" features timely we can tackle this I think. We can also consider "tap to any place to close" and keep things simple for now.

pinarol commented 1 month ago

Invalid frame dimension (negative or non-finite).

Seems like that line was unnecessary anyway so I removed it. The error is gone.

pinarol commented 1 month ago

Ready for another look @etoledom