File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed
Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ struct HubMenu: View {
3030
3131 LazyVGrid ( columns: gridItemLayout, spacing: Constants . itemSpacing) {
3232 ForEach ( viewModel. menuElements, id: \. self) { menu in
33- HubMenuElement ( image: menu. icon, text: menu. title, onTapGesture: {
33+ HubMenuElement ( image: menu. icon, imageColor : menu . iconColor , text: menu. title, onTapGesture: {
3434 switch menu {
3535 case . woocommerceAdmin:
3636 ServiceLocator . analytics. track ( . hubMenuOptionTapped, withProperties: [ " option " : " admin_menu " ] )
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import SwiftUI
44///
55struct HubMenuElement : View {
66 let image : UIImage
7+ let imageColor : UIColor
78 let text : String
89 let onTapGesture : ( ( ) -> Void )
910
@@ -19,8 +20,10 @@ struct HubMenuElement: View {
1920 Color ( UIColor ( light: . listBackground,
2021 dark: . secondaryButtonBackground) )
2122 Image ( uiImage: image)
23+ . renderingMode ( . template)
2224 . resizable ( )
2325 . scaledToFit ( )
26+ . foregroundColor ( Color ( imageColor) )
2427 . frame ( width: iconSize, height: iconSize)
2528 }
2629 . frame ( width: imageSize, height: imageSize, alignment: . center)
@@ -42,7 +45,9 @@ struct HubMenuElement: View {
4245struct HubMenuElement_Previews : PreviewProvider {
4346 static var previews : some View {
4447 HubMenuElement ( image: . starOutlineImage( ) ,
45- text: " Menu " , onTapGesture: { } )
48+ imageColor: . blue,
49+ text: " Menu " ,
50+ onTapGesture: { } )
4651 . previewLayout ( . fixed( width: 160 , height: 160 ) )
4752 . previewDisplayName ( " Hub Menu Element " )
4853 }
You can’t perform that action at this time.
0 commit comments