Skip to content

Commit

Permalink
🔀 Merge branch 'hugo/refactor/Refactor-Profiles-creation-UI'
Browse files Browse the repository at this point in the history
  • Loading branch information
ladislas committed Feb 14, 2024
2 parents a8a010c + 54bc084 commit 601f268
Show file tree
Hide file tree
Showing 16 changed files with 168 additions and 146 deletions.
38 changes: 19 additions & 19 deletions Apps/LekaApp/Resources/Localizable.xcstrings
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"version": "1.0",
"sourceLanguage": "en",
"strings": {
"caregiver_settings_view.appearance_section.accent_color_row.title": {
"edit_caregiver_view.appearance_section.accent_color_row.title": {
"comment": "AccentColor Row title",
"extractionState": "extracted_with_value",
"localizations": {
Expand All @@ -20,7 +20,7 @@
}
}
},
"caregiver_settings_view.appearance_section.appearance_row.title": {
"edit_caregiver_view.appearance_section.appearance_row.title": {
"comment": "Appearance Row title",
"extractionState": "extracted_with_value",
"localizations": {
Expand All @@ -38,8 +38,8 @@
}
}
},
"caregiver_settings_view.close_button_label": {
"comment": "Close button label of Caregiver Settings View",
"edit_caregiver_view.close_button_label": {
"comment": "Close button label of Edit Caregiver View",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
Expand All @@ -56,8 +56,8 @@
}
}
},
"caregiver_settings_view.navigation_title": {
"comment": "The navigation title of Caregiver Settings View",
"edit_caregiver_view.navigation_title": {
"comment": "The navigation title of Edit Caregiver View",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
Expand All @@ -74,8 +74,8 @@
}
}
},
"caregiver_settings_view.save_button_label": {
"comment": "Save button label of Caregiver Settings View",
"edit_caregiver_view.save_button_label": {
"comment": "Save button label of Edit Caregiver View",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
Expand All @@ -92,8 +92,8 @@
}
}
},
"carereceiver_settings_view.close_button_label": {
"comment": "Close button label of Carereceiver Settings View",
"edit_carereceiver_view.close_button_label": {
"comment": "Close button label of Edit Carereceiver View",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
Expand All @@ -110,8 +110,8 @@
}
}
},
"carereceiver_settings_view.navigation_title": {
"comment": "The navigation title of Carereceiver Settings View",
"edit_carereceiver_view.navigation_title": {
"comment": "The navigation title of Edit Carereceiver View",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
Expand All @@ -128,8 +128,8 @@
}
}
},
"carereceiver_settings_view.save_button_label": {
"comment": "Save button label of Carereceiver Settings View",
"edit_carereceiver_view.save_button_label": {
"comment": "Save button label of Edit Carereceiver View",
"extractionState": "extracted_with_value",
"localizations": {
"en": {
Expand Down Expand Up @@ -549,13 +549,13 @@
"en": {
"stringUnit": {
"state": "new",
"value": "Caregiver name"
"value": "Name"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Nom d'accompagnant"
"value": "Nom"
}
}
}
Expand Down Expand Up @@ -627,7 +627,7 @@
"fr": {
"stringUnit": {
"state": "translated",
"value": "Cr\u00e9er un profil de personne accompagn\u00e9e"
"value": "Cr\u00e9er un profil d'accompagnant"
}
}
}
Expand Down Expand Up @@ -693,13 +693,13 @@
"en": {
"stringUnit": {
"state": "new",
"value": "Carereceiver name"
"value": "Name"
}
},
"fr": {
"stringUnit": {
"state": "translated",
"value": "Nom de la personne accompagn\u00e9e"
"value": "Nom"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,12 @@ extension AvatarPicker {
.animation(.easeIn, value: self.selected)
}
}
.padding(.horizontal, 10)
.padding()
}
.frame(height: 180)
}
.listRowBackground(Color.clear)
}
.listRowInsets(EdgeInsets())
}
}

Expand Down

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ import SwiftUI

// swiftlint:disable nesting

// MARK: - CaregiverSettingsView.AccentColorRow
// MARK: - EditCaregiverView.AccentColorRow

extension CaregiverSettingsView {
extension EditCaregiverView {
struct AccentColorRow: View {
// MARK: Internal

@Binding var caregiver: Caregiver

var body: some View {
HStack {
Text(l10n.CaregiverSettingsView.AccentColorRow.title)
Text(l10n.EditCaregiverView.AccentColorRow.title)

Spacer()

Expand Down Expand Up @@ -66,6 +66,6 @@ extension CaregiverSettingsView {

#Preview {
Form {
CaregiverSettingsView.AccentColorRow(caregiver: .constant(Caregiver()))
EditCaregiverView.AccentColorRow(caregiver: .constant(Caregiver()))
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@ import DesignKit
import LocalizationKit
import SwiftUI

// MARK: - CaregiverSettingsView.AppearanceRow
// MARK: - EditCaregiverView.AppearanceRow

extension CaregiverSettingsView {
extension EditCaregiverView {
struct AppearanceRow: View {
// MARK: Internal

@Binding var caregiver: Caregiver

var body: some View {
HStack(spacing: 10) {
Text(l10n.CaregiverSettingsView.AppearanceRow.title)
Text(l10n.EditCaregiverView.AppearanceRow.title)

Spacer()

Expand All @@ -38,6 +38,6 @@ extension CaregiverSettingsView {

#Preview {
Form {
CaregiverSettingsView.AppearanceRow(caregiver: .constant(Caregiver()))
EditCaregiverView.AppearanceRow(caregiver: .constant(Caregiver()))
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
// Leka - iOS Monorepo
// Copyright APF France handicap
// SPDX-License-Identifier: Apache-2.0

import LocalizationKit

// swiftlint:disable line_length nesting

extension l10n {
enum EditCaregiverView {
enum AppearanceRow {
static let title = LocalizedString("edit_caregiver_view.appearance_section.appearance_row.title", value: "Dark Mode", comment: "Appearance Row title")
}

enum AccentColorRow {
static let title = LocalizedString("edit_caregiver_view.appearance_section.accent_color_row.title", value: "Color Theme", comment: "AccentColor Row title")
}

static let navigationTitle = LocalizedString("edit_caregiver_view.navigation_title", value: "Profil of ", comment: "The navigation title of Edit Caregiver View")

static let saveButtonLabel = LocalizedString("edit_caregiver_view.save_button_label", value: "Save", comment: "Save button label of Edit Caregiver View")

static let closeButtonLabel = LocalizedString("edit_caregiver_view.close_button_label", value: "Close", comment: "Close button label of Edit Caregiver View")
}
}

// swiftlint:enable line_length nesting
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import DesignKit
import LocalizationKit
import SwiftUI

// MARK: - CaregiverSettingsView
// MARK: - EditCaregiverView

struct CaregiverSettingsView: View {
struct EditCaregiverView: View {
// MARK: Internal

@State var modifiedCaregiver: Caregiver
Expand All @@ -24,7 +24,7 @@ struct CaregiverSettingsView: View {

Section {
LabeledContent(String(l10n.CaregiverCreation.caregiverNameLabel.characters)) {
TextField("Nom", text: self.$modifiedCaregiver.name)
TextField("", text: self.$modifiedCaregiver.name)
.multilineTextAlignment(.trailing)
}
}
Expand All @@ -39,19 +39,19 @@ struct CaregiverSettingsView: View {
}
}
}
.navigationTitle(String(l10n.CaregiverSettingsView.navigationTitle.characters) + self.modifiedCaregiver.name)
.navigationTitle(String(l10n.EditCaregiverView.navigationTitle.characters) + self.modifiedCaregiver.name)
.navigationBarTitleDisplayMode(.inline)
.interactiveDismissDisabled()
.toolbar {
ToolbarItem(placement: .topBarLeading) {
Button(String(l10n.CaregiverSettingsView.closeButtonLabel.characters)) {
self.rootOwnerViewModel.isCaregiverSettingsViewPresented = false
Button(String(l10n.EditCaregiverView.closeButtonLabel.characters)) {
self.rootOwnerViewModel.isEditCaregiverViewPresented = false
}
}
ToolbarItem(placement: .topBarTrailing) {
Button(String(l10n.CaregiverSettingsView.saveButtonLabel.characters)) {
Button(String(l10n.EditCaregiverView.saveButtonLabel.characters)) {
// TODO: (@mathieu) - Add Firestore logic
self.rootOwnerViewModel.isCaregiverSettingsViewPresented = false
self.rootOwnerViewModel.isEditCaregiverViewPresented = false
self.rootOwnerViewModel.currentCaregiver = self.modifiedCaregiver
}
}
Expand Down Expand Up @@ -101,5 +101,5 @@ struct CaregiverSettingsView: View {
}

#Preview {
CaregiverSettingsView(modifiedCaregiver: Caregiver())
EditCaregiverView(modifiedCaregiver: Caregiver())
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// Leka - iOS Monorepo
// Copyright APF France handicap
// SPDX-License-Identifier: Apache-2.0

import LocalizationKit

// swiftlint:disable line_length

extension l10n {
enum EditCarereceiverView {
static let navigationTitle = LocalizedString("edit_carereceiver_view.navigation_title", value: "Profil of ", comment: "The navigation title of Edit Carereceiver View")

static let saveButtonLabel = LocalizedString("edit_carereceiver_view.save_button_label", value: "Save", comment: "Save button label of Edit Carereceiver View")

static let closeButtonLabel = LocalizedString("edit_carereceiver_view.close_button_label", value: "Close", comment: "Close button label of Edit Carereceiver View")
}
}

// swiftlint:enable line_length
Loading

0 comments on commit 601f268

Please sign in to comment.