Skip to content

Commit

Permalink
♻️ (LekaApp): Update LekaApp with old avatars and visible property
Browse files Browse the repository at this point in the history
  • Loading branch information
HPezz authored and ladislas committed Feb 28, 2024
1 parent f5f1c01 commit 045e844
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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())
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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]),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 045e844

Please sign in to comment.