-
Notifications
You must be signed in to change notification settings - Fork 5
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
IOS-10414 Add Skeleton components in SwiftUI and UIKit #388
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
public enum SkeletonType { | ||
case line(width: CGFloat) | ||
case text(numberOfLines: Int = 3) | ||
case circle(size: CGFloat) | ||
case row | ||
case rectangle(size: CGSize, isRounded: Bool) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe I would have a LineSkeletonView
, TextSkeletonView
,... to avoid executing a switch
eeeeverytime.
If you know the type you need, you are able to call the right View :/
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmm, I don't necessarily agree. IMO for such simple views that share common attributes between them and that are even reused in certain types it makes more sense to have them centralized. It brings consistency.
In the case of a higher level of complexity in the views and contain significant differences between them if I could agree to separate them.
But right now I see no compelling reasons, neither of testability nor of readability. WDTY?
} | ||
|
||
public var body: some View { | ||
switch type { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same. we are executing this switch
every time the view is rendered. Why don't you create several views?
|
||
final class SkeletonTests: XCTestCase { | ||
override class func setUp() { | ||
isRecording = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about the snapshots? I couldn't find them...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was waiting for the approval to launch the GH action of the record. But maybe it helps to see the snapshots already to review.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yes, it could help, thanks!
override class func setUp() { | ||
super.setUp() | ||
|
||
isRecording = false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what about the snapshots? I couldn't find them...
public struct Skeleton: View { | ||
enum Constants { | ||
static var lineHeight = 8.0 | ||
static var radius = 8.0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Radius should use tokens. Was our mistake because the specs were not defined well
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You're right, I didn't remember it either although I didn't see it in the specs. Fixed!
Record screenshots on PR comment: succeeded β
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice job! π€©
Screenshot tests report βοΈ All passing |
Record screenshots on PR comment: succeeded β
|
π This PR is included in version 31.3.0 π The release is available on GitHub release Your semantic-release bot π¦π |
ποΈ Jira ticket
https://jira.tid.es/browse/IOS-10414
π₯ What's the goal?
Implement the native Skeletons components designed by Mistica in the following spec:
https://www.figma.com/design/w7E0mmB92eio0zHw7h9iS2/%F0%9F%94%B8-Skeletons-Specs?node-id=986-1161&t=SJOFSJMtw5Mmpp22-0
π§ How do we do it?
The following changes have been made:
π§ͺ How can I verify this?
A version of the MisticaCatalog has been generated to test and visualize the Skeletons.
π AppCenter build
(Jul 22, 2024 at 17:56)