Reviewed By: bhamodi Differential Revision: D33331422 fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
49 lines
1.2 KiB
Plaintext
49 lines
1.2 KiB
Plaintext
/*
|
|
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
*
|
|
* This source code is licensed under the MIT license found in the
|
|
* LICENSE file in the root directory of this source tree.
|
|
*/
|
|
|
|
#if FB_SONARKIT_ENABLED
|
|
|
|
#import "CKInsetComponent+Sonar.h"
|
|
|
|
#import <ComponentKit/CKDimension.h>
|
|
#import <FlipperKitLayoutHelpers/SKNamed.h>
|
|
#import <FlipperKitLayoutHelpers/SKObject.h>
|
|
|
|
#import "CKComponent+Sonar.h"
|
|
|
|
FB_LINKABLE(CKInsetComponent_Sonar)
|
|
@implementation CKInsetComponent (Sonar)
|
|
|
|
- (NSArray<SKNamed<NSDictionary<NSString*, NSObject*>*>*>*)
|
|
sonar_additionalDataOverride {
|
|
return @[
|
|
[SKNamed newWithName:@"CKInsetComponent"
|
|
withValue:@{@"insets" : SKObject([self insetsDictionary])}],
|
|
];
|
|
}
|
|
|
|
- (id)insetsDictionary {
|
|
CKRelativeDimension top;
|
|
CKRelativeDimension left;
|
|
CKRelativeDimension bottom;
|
|
CKRelativeDimension right;
|
|
[[self valueForKey:@"_top"] getValue:&top];
|
|
[[self valueForKey:@"_left"] getValue:&left];
|
|
[[self valueForKey:@"_right"] getValue:&bottom];
|
|
[[self valueForKey:@"_bottom"] getValue:&right];
|
|
return @{
|
|
@"top" : top.description(),
|
|
@"left" : left.description(),
|
|
@"bottom" : bottom.description(),
|
|
@"right" : right.description(),
|
|
};
|
|
}
|
|
|
|
@end
|
|
|
|
#endif
|