Files
Wojciech Lewicki 98c14b4f45 chore: add CI for JS, iOS and Android formatting (#1782)
Added CI workflow and local pre-commit hook for formatting and linting the newly added JS, iOS and Android code.
2022-08-16 12:00:32 +02:00

49 lines
1.1 KiB
Plaintext

/**
* Copyright (c) 2015-present, Horcrux.
* All rights reserved.
*
* This source code is licensed under the MIT-style license found in the
* LICENSE file in the root directory of this source tree.
*/
#import "RNSVGGroupManager.h"
#import "RNSVGCGFCRule.h"
#import "RNSVGGroup.h"
@implementation RNSVGGroupManager
RCT_EXPORT_MODULE()
- (RNSVGNode *)node
{
return [RNSVGGroup new];
}
RCT_EXPORT_VIEW_PROPERTY(font, NSDictionary)
RCT_CUSTOM_VIEW_PROPERTY(fontSize, id, RNSVGGroup)
{
if ([json isKindOfClass:[NSString class]]) {
NSString *stringValue = (NSString *)json;
view.font = @{@"fontSize" : stringValue};
} else {
NSNumber *number = (NSNumber *)json;
double num = [number doubleValue];
view.font = @{@"fontSize" : [NSNumber numberWithDouble:num]};
}
}
RCT_CUSTOM_VIEW_PROPERTY(fontWeight, id, RNSVGGroup)
{
if ([json isKindOfClass:[NSString class]]) {
NSString *stringValue = (NSString *)json;
view.font = @{@"fontWeight" : stringValue};
} else {
NSNumber *number = (NSNumber *)json;
double num = [number doubleValue];
view.font = @{@"fontWeight" : [NSNumber numberWithDouble:num]};
}
}
@end