Skip to content

Commit

Permalink
✨ (LekaApp): Appearance is now own by each caregiver
Browse files Browse the repository at this point in the history
  • Loading branch information
HPezz committed Feb 7, 2024
1 parent e34e5fb commit b4fae4c
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 3 deletions.
11 changes: 10 additions & 1 deletion Apps/LekaApp/Sources/_NEWCodeBase/Models/CompanyModel.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -39,6 +46,8 @@ struct Caregiver: Profile {
var name: String
var avatar: String
var professions: [Profession]
var preferredColorScheme: ColorScheme
var preferredAccentColor: Color
}

// MARK: - Carereceiver
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ struct CaregiverAvatarCell: View {
// MARK: Internal

@ObservedObject private var rootOwnerViewModel: RootOwnerViewModel = .shared
@ObservedObject private var styleManager: StyleManager = .shared

let caregiver: Caregiver

var body: some 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) {
Expand Down

0 comments on commit b4fae4c

Please sign in to comment.