diff --git a/Apps/LekaApp/Sources/_NEWCodeBase/Views/AvatarPicker/AvatarPicker+ListView.swift b/Apps/LekaApp/Sources/_NEWCodeBase/Views/AvatarPicker/AvatarPicker+ListView.swift index 951f893f25..f307103aec 100644 --- a/Apps/LekaApp/Sources/_NEWCodeBase/Views/AvatarPicker/AvatarPicker+ListView.swift +++ b/Apps/LekaApp/Sources/_NEWCodeBase/Views/AvatarPicker/AvatarPicker+ListView.swift @@ -15,25 +15,27 @@ extension AvatarPicker { var body: some View { List { ForEach(Avatars.categories, id: \.self) { category in - Section(category.name) { - ScrollView(.horizontal) { - LazyHGrid(rows: self.rows, spacing: 50) { - ForEach(category.avatars, id: \.self) { icon in - Button { - self.selectedAvatar = icon - } label: { - AvatarCellLabel( - image: Avatars.iconToUIImage(icon: icon), - isSelected: .constant(self.selectedAvatar == icon) - ) + if category.visible { + Section(category.name) { + ScrollView(.horizontal) { + LazyHGrid(rows: self.rows, spacing: 50) { + ForEach(category.avatars, id: \.self) { icon in + Button { + self.selectedAvatar = icon + } label: { + AvatarCellLabel( + image: Avatars.iconToUIImage(icon: icon), + isSelected: .constant(self.selectedAvatar == icon) + ) + } + .animation(.easeIn, value: self.selectedAvatar) } - .animation(.easeIn, value: self.selectedAvatar) } + .padding() } - .padding() } + .listRowBackground(Color.clear) } - .listRowBackground(Color.clear) } .listRowInsets(EdgeInsets()) } diff --git a/Apps/LekaApp/Sources/_NEWCodeBase/Views/MainView/RootOwnerViewModel.swift b/Apps/LekaApp/Sources/_NEWCodeBase/Views/MainView/RootOwnerViewModel.swift index 1b42423acd..01d7a6c542 100644 --- a/Apps/LekaApp/Sources/_NEWCodeBase/Views/MainView/RootOwnerViewModel.swift +++ b/Apps/LekaApp/Sources/_NEWCodeBase/Views/MainView/RootOwnerViewModel.swift @@ -36,9 +36,9 @@ class RootOwnerViewModel: ObservableObject { // swiftlint:disable line_length @Published var mockCaregiversSet: [Caregiver] = [ Caregiver(id: UUID().uuidString, firstName: "Chantal", lastName: "Goya", avatar: Avatars.categories[0].avatars[2], professions: [Professions.list[6].id]), - Caregiver(id: UUID().uuidString, firstName: "Gaëtan", lastName: "Roussel", avatar: Avatars.categories[3].avatars[1], professions: [Professions.list[9].id], colorScheme: .dark, colorTheme: .green), + Caregiver(id: UUID().uuidString, firstName: "Gaëtan", lastName: "Roussel", avatar: "boy1", professions: [Professions.list[9].id], colorScheme: .dark, colorTheme: .green), Caregiver(id: UUID().uuidString, firstName: "Fabrizio", lastName: "Ferrari", avatar: Avatars.categories[4].avatars[1], professions: [Professions.list[10].id]), - Caregiver(id: UUID().uuidString, firstName: "Hakima", lastName: "Queen", avatar: Avatars.categories[2].avatars[1], professions: [Professions.list[10].id, Professions.list[1].id]), + Caregiver(id: UUID().uuidString, firstName: "Hakima", lastName: "Queen", avatar: "girl10", professions: [Professions.list[10].id, Professions.list[1].id]), Caregiver(id: UUID().uuidString, firstName: "Eric", lastName: "Clapton", avatar: Avatars.categories[1].avatars[0], professions: [Professions.list[10].id]), Caregiver(id: UUID().uuidString, firstName: "Razmo", lastName: "Kets", avatar: Avatars.categories[2].avatars[2], professions: [Professions.list[5].id], colorScheme: .dark, colorTheme: .orange), Caregiver(id: UUID().uuidString, firstName: "Corinne", lastName: "Lepage", avatar: Avatars.categories[5].avatars[1], professions: [Professions.list[4].id]), diff --git a/Apps/LekaApp/Sources/_NEWCodeBase/Views/Profiles/CreateCaregiverView.swift b/Apps/LekaApp/Sources/_NEWCodeBase/Views/Profiles/CreateCaregiverView.swift index 1220b3936d..295664b538 100644 --- a/Apps/LekaApp/Sources/_NEWCodeBase/Views/Profiles/CreateCaregiverView.swift +++ b/Apps/LekaApp/Sources/_NEWCodeBase/Views/Profiles/CreateCaregiverView.swift @@ -46,7 +46,7 @@ struct CreateCaregiverView: View { self.onDismissAction() } if self.newCaregiver.avatar.isEmpty { - self.newCaregiver.avatar = Avatars.categories.last!.avatars.randomElement()! + self.newCaregiver.avatar = Avatars.categories.first!.avatars.randomElement()! } // TODO: (@team) : add the caregiver profile to the account // TODO: (@team) : assign the caregiver profile as the current selected one diff --git a/Apps/LekaApp/Sources/_NEWCodeBase/Views/Profiles/CreateCarereceiverView.swift b/Apps/LekaApp/Sources/_NEWCodeBase/Views/Profiles/CreateCarereceiverView.swift index 9b6a6e8f69..d07013d3aa 100644 --- a/Apps/LekaApp/Sources/_NEWCodeBase/Views/Profiles/CreateCarereceiverView.swift +++ b/Apps/LekaApp/Sources/_NEWCodeBase/Views/Profiles/CreateCarereceiverView.swift @@ -38,7 +38,7 @@ struct CreateCarereceiverView: View { self.onDismissAction() } if self.newCarereceiver.avatar.isEmpty { - self.newCarereceiver.avatar = Avatars.categories.last!.avatars.randomElement()! + self.newCarereceiver.avatar = Avatars.categories.first!.avatars.randomElement()! } // TODO: (@team) : add the carereceiver profile to the account // TODO: (@team) : assign the carereceiver profile as the current selected one