Files
flipper/iOS/Plugins/FlipperKitLayoutPlugin/FlipperKitLayoutComponentKitSupport/CKInsetComponent+Sonar.mm
Andres Suarez 79023ee190 Update copyright headers from Facebook to Meta
Reviewed By: bhamodi

Differential Revision: D33331422

fbshipit-source-id: 016e8dcc0c0c7f1fc353a348b54fda0d5e2ddc01
2021-12-27 14:31:45 -08:00

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