From 74be4deb8c4d4456d1acaf50a50a1fed7b4a5704 Mon Sep 17 00:00:00 2001 From: Ahmed-Naguib93 Date: Wed, 18 Dec 2024 17:32:02 +0200 Subject: [PATCH] feat: Update tab bat icons [ignore-commit-lint] --- Horizon/Horizon/Resources/Localizable.xcstrings | 6 +++--- .../Features/HorizonTabBarController.swift | 16 ++++++++++++---- .../Foundation/Icons/HorizonUI.Icons.swift | 4 ++++ 3 files changed, 19 insertions(+), 7 deletions(-) diff --git a/Horizon/Horizon/Resources/Localizable.xcstrings b/Horizon/Horizon/Resources/Localizable.xcstrings index b329ddc64e..575fd22f86 100644 --- a/Horizon/Horizon/Resources/Localizable.xcstrings +++ b/Horizon/Horizon/Resources/Localizable.xcstrings @@ -34,9 +34,6 @@ }, "Are you sure you want to proceed?" : { - }, - "Career" : { - }, "Check Answer" : { @@ -133,6 +130,9 @@ }, "Search" : { + }, + "Skillspace" : { + }, "Submit Assignment" : { diff --git a/Horizon/Horizon/Sources/Features/HorizonTabBarController.swift b/Horizon/Horizon/Sources/Features/HorizonTabBarController.swift index 59ef214c5e..5cd917ccb2 100644 --- a/Horizon/Horizon/Sources/Features/HorizonTabBarController.swift +++ b/Horizon/Horizon/Sources/Features/HorizonTabBarController.swift @@ -19,6 +19,7 @@ import Core import HorizonUI import UIKit +import SwiftUI final class HorizonTabBarController: UITabBarController, UITabBarControllerDelegate { // MARK: - Properties @@ -73,7 +74,8 @@ final class HorizonTabBarController: UITabBarController, UITabBarControllerDeleg vc.navigationBar.scrollEdgeAppearance = appearance vc.tabBarItem.title = String(localized: "Home", bundle: .horizon) - vc.tabBarItem.image = UIImage(systemName: "house") + vc.tabBarItem.image = getHorizonImage(name: "home") + vc.tabBarItem.selectedImage = getHorizonImage(name: "home_filled") return vc } @@ -82,7 +84,8 @@ final class HorizonTabBarController: UITabBarController, UITabBarControllerDeleg rootViewController: CoreHostingController(LearnAssembly.makeCoursesView()) ) vc.tabBarItem.title = String(localized: "Learn", bundle: .horizon) - vc.tabBarItem.image = UIImage(systemName: "list.bullet") + vc.tabBarItem.image = getHorizonImage(name: "book_2") + vc.tabBarItem.selectedImage = getHorizonImage(name: "book_2_filled") return vc } @@ -95,8 +98,9 @@ final class HorizonTabBarController: UITabBarController, UITabBarControllerDeleg rootViewController: CoreHostingController(Storybook()) ) vc.navigationBar.prefersLargeTitles = true - vc.tabBarItem.title = String(localized: "Career", bundle: .horizon) - vc.tabBarItem.image = UIImage(systemName: "point.bottomleft.filled.forward.to.point.topright.scurvepath") + vc.tabBarItem.title = String(localized: "Skillspace", bundle: .horizon) + vc.tabBarItem.image = getHorizonImage(name: "hub") + vc.tabBarItem.selectedImage = getHorizonImage(name: "hub_filled") return vc } @@ -117,6 +121,10 @@ final class HorizonTabBarController: UITabBarController, UITabBarControllerDeleg TabBarBadgeCounts.messageItem = inboxSplit.tabBarItem return inboxSplit } + + private func getHorizonImage(name: String) -> UIImage? { + UIImage(named: name, in: Bundle.horizonUI, with: nil) + } } extension HorizonTabBarController { diff --git a/packages/HorizonUI/Sources/HorizonUI/Sources/Foundation/Icons/HorizonUI.Icons.swift b/packages/HorizonUI/Sources/HorizonUI/Sources/Foundation/Icons/HorizonUI.Icons.swift index d220c35a81..4083fdf125 100644 --- a/packages/HorizonUI/Sources/HorizonUI/Sources/Foundation/Icons/HorizonUI.Icons.swift +++ b/packages/HorizonUI/Sources/HorizonUI/Sources/Foundation/Icons/HorizonUI.Icons.swift @@ -429,3 +429,7 @@ public extension HorizonUI { extension Image { static let huiIcons = HorizonUI.icons } + +public extension Bundle { + static let horizonUI = Bundle.module +}