@@ -20,21 +20,21 @@ struct TabData: Codable {
2020 private var eventDispatcher : RCTEventDispatcherProtocol ?
2121 private var imageLoader : RCTImageLoaderProtocol ?
2222 private var iconSize = CGSize ( width: 27 , height: 27 )
23-
23+
2424 @objc var onPageSelected : RCTDirectEventBlock ?
25-
25+
2626 @objc var icons : NSArray ? {
2727 didSet {
2828 loadIcons ( icons)
2929 }
3030 }
31-
31+
3232 @objc var sidebarAdaptable : Bool = false {
3333 didSet {
3434 props. sidebarAdaptable = sidebarAdaptable
3535 }
3636 }
37-
37+
3838 @objc var disablePageAnimations : Bool = false {
3939 didSet {
4040 props. disablePageAnimations = disablePageAnimations
@@ -46,31 +46,31 @@ struct TabData: Codable {
4646 props. labeled = labeled
4747 }
4848 }
49-
49+
5050 @objc var ignoresTopSafeArea : Bool = false {
5151 didSet {
5252 props. ignoresTopSafeArea = ignoresTopSafeArea
5353 }
5454 }
55-
55+
5656 @objc var selectedPage : NSString ? {
5757 didSet {
5858 props. selectedPage = selectedPage as? String
5959 }
6060 }
61-
61+
6262 @objc var scrollEdgeAppearance : NSString ? {
6363 didSet {
6464 props. scrollEdgeAppearance = scrollEdgeAppearance as? String
6565 }
6666 }
67-
67+
6868 @objc var translucent : Bool = true {
6969 didSet {
7070 props. translucent = translucent
7171 }
7272 }
73-
73+
7474 @objc var items : NSArray ? {
7575 didSet {
7676 props. items = parseTabData ( from: items)
@@ -82,23 +82,23 @@ struct TabData: Codable {
8282 props. barTintColor = RCTConvert . uiColor ( barTintColor)
8383 }
8484 }
85-
85+
8686 @objc public convenience init ( eventDispatcher: RCTEventDispatcherProtocol , imageLoader: RCTImageLoader ) {
8787 self . init ( )
8888 self . eventDispatcher = eventDispatcher
8989 self . imageLoader = imageLoader
9090 }
91-
91+
9292 public override func didUpdateReactSubviews( ) {
9393 props. children = reactSubviews ( )
9494 }
95-
95+
9696 public override func layoutSubviews( ) {
9797 super. layoutSubviews ( )
9898 setupView ( )
9999 props. children = reactSubviews ( )
100100 }
101-
101+
102102 private func setupView( ) {
103103 if self . hostingController != nil {
104104 return
@@ -116,7 +116,7 @@ struct TabData: Codable {
116116 hostingController. didMove ( toParent: parentViewController)
117117 }
118118 }
119-
119+
120120 private func loadIcons( _ icons: NSArray ? ) {
121121 // TODO: Diff the arrays and update only changed items.
122122 // Now if the user passes `unfocusedIcon` we update every item.
@@ -127,8 +127,8 @@ struct TabData: Codable {
127127 with: imageSource. request,
128128 size: imageSource. size,
129129 scale: imageSource. scale,
130- clipped: true ,
131- resizeMode: RCTResizeMode . contain ,
130+ clipped: false ,
131+ resizeMode: RCTResizeMode . cover ,
132132 progressBlock: { _, _ in } ,
133133 partialLoad: { _ in } ,
134134 completionBlock: { error, image in
@@ -144,11 +144,11 @@ struct TabData: Codable {
144144 }
145145 }
146146 }
147-
147+
148148 private func parseTabData( from array: NSArray ? ) -> TabData ? {
149149 guard let array else { return nil }
150150 var items : [ TabInfo ] = [ ]
151-
151+
152152 for value in array {
153153 if let itemDict = value as? [ String : Any ] {
154154 items. append (
@@ -161,7 +161,7 @@ struct TabData: Codable {
161161 )
162162 }
163163 }
164-
164+
165165 return TabData ( tabs: items)
166166 }
167167}
0 commit comments