diff --git a/Apps/LekaApp/Sources/_NEWCodeBase/Models/CompanyModel.swift b/Apps/LekaApp/Sources/_NEWCodeBase/Models/CompanyModel.swift index 00cbd5daae..b1ce8f2780 100644 --- a/Apps/LekaApp/Sources/_NEWCodeBase/Models/CompanyModel.swift +++ b/Apps/LekaApp/Sources/_NEWCodeBase/Models/CompanyModel.swift @@ -27,10 +27,17 @@ protocol Profile: Identifiable, Hashable { struct Caregiver: Profile { // MARK: Lifecycle - init(name: String = "", avatar: String = "", professions: [Profession] = []) { + init(name: String = "", + avatar: String = "", + professions: [Profession] = [], + colorScheme: ColorScheme = .light, + accentColor: Color = DesignKitAsset.Colors.lekaDarkBlue.swiftUIColor) + { self.name = name self.avatar = avatar self.professions = professions + self.preferredColorScheme = colorScheme + self.preferredAccentColor = accentColor } // MARK: Internal @@ -39,6 +46,8 @@ struct Caregiver: Profile { var name: String var avatar: String var professions: [Profession] + var preferredColorScheme: ColorScheme + var preferredAccentColor: Color } // MARK: - Carereceiver diff --git a/Apps/LekaApp/Sources/_NEWCodeBase/Views/MainView/RootOwnerViewModel.swift b/Apps/LekaApp/Sources/_NEWCodeBase/Views/MainView/RootOwnerViewModel.swift index 938175288b..d05a432cc9 100644 --- a/Apps/LekaApp/Sources/_NEWCodeBase/Views/MainView/RootOwnerViewModel.swift +++ b/Apps/LekaApp/Sources/_NEWCodeBase/Views/MainView/RootOwnerViewModel.swift @@ -28,11 +28,11 @@ class RootOwnerViewModel: ObservableObject { @Published var mockCaregiversSet: [Caregiver] = [ Caregiver(name: "Chantal", avatar: DesignKitAsset.Avatars.avatarsBoy4f.name, professions: [Caregiver.Profession.motorTherapist]), - Caregiver(name: "Gaëtan", avatar: DesignKitAsset.Avatars.avatarsLekaSunglassesBlue.name, professions: [Caregiver.Profession.occupationalTherapist]), + Caregiver(name: "Gaëtan", avatar: DesignKitAsset.Avatars.avatarsLekaSunglassesBlue.name, professions: [Caregiver.Profession.occupationalTherapist], colorScheme: .dark, accentColor: .green), Caregiver(name: "Fabrizio", avatar: DesignKitAsset.Avatars.avatarsPictogramsAnimalsFarmBirdYellow0071.name, professions: [Caregiver.Profession.speechTherapist]), Caregiver(name: "Hakima", avatar: DesignKitAsset.Avatars.avatarsPictogramsFoodsFruitsPearYellow00FC.name, professions: [Caregiver.Profession.other(profession: "chirurgien")]), Caregiver(name: "Eric", avatar: DesignKitAsset.Avatars.avatarsBoy2a.name, professions: [Caregiver.Profession.motorTherapist]), - Caregiver(name: "Razmo", avatar: DesignKitAsset.Avatars.avatarsBoy3b.name, professions: [Caregiver.Profession.motorTherapist]), + Caregiver(name: "Razmo", avatar: DesignKitAsset.Avatars.avatarsBoy3b.name, professions: [Caregiver.Profession.motorTherapist], colorScheme: .dark, accentColor: .orange), Caregiver(name: "Corinne", avatar: DesignKitAsset.Avatars.avatarsGirl1d.name, professions: [Caregiver.Profession.motorTherapist]), Caregiver(name: "Alphonso", avatar: DesignKitAsset.Avatars.avatarsPictogramsFoodsFruitsAppleRed0101.name, professions: [Caregiver.Profession.motorTherapist]), Caregiver(name: "Gargantua", avatar: DesignKitAsset.Avatars.avatarsPictogramsFoodsFruitsCherryRed00FF.name, professions: [Caregiver.Profession.motorTherapist]), diff --git a/Apps/LekaApp/Sources/_NEWCodeBase/Views/Profiles/CaregiverAvatarCell.swift b/Apps/LekaApp/Sources/_NEWCodeBase/Views/Profiles/CaregiverAvatarCell.swift index cb1d7407ca..b07e4a3bff 100644 --- a/Apps/LekaApp/Sources/_NEWCodeBase/Views/Profiles/CaregiverAvatarCell.swift +++ b/Apps/LekaApp/Sources/_NEWCodeBase/Views/Profiles/CaregiverAvatarCell.swift @@ -9,6 +9,7 @@ struct CaregiverAvatarCell: View { // MARK: Internal @ObservedObject private var rootOwnerViewModel: RootOwnerViewModel = .shared + @ObservedObject private var styleManager: StyleManager = .shared let caregiver: Caregiver @@ -16,6 +17,8 @@ struct CaregiverAvatarCell: View { Button { // TODO: (@team) - Add caregiver selection logic w/ Firebase self.rootOwnerViewModel.currentCaregiver = self.caregiver + self.styleManager.colorScheme = self.caregiver.preferredColorScheme + self.styleManager.accentColor = self.caregiver.preferredAccentColor self.rootOwnerViewModel.isWelcomeViewPresented = false } label: { VStack(spacing: 10) {