Skip to content

Commit

Permalink
🚚 (LekaApp): Rename ProfileSettings in EditProfiles
Browse files Browse the repository at this point in the history
  • Loading branch information
HPezz committed Feb 14, 2024
1 parent 547fc15 commit 54bc084
Show file tree
Hide file tree
Showing 13 changed files with 102 additions and 100 deletions.
28 changes: 14 additions & 14 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

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

Check warning on line 53 in Apps/LekaApp/Sources/_NEWCodeBase/Views/EditCaregiverView/EditCaregiverView.swift

View workflow job for this annotation

GitHub Actions / swiftlint

TODOs should be resolved ((@mathieu) - Add Firestore log...) (todo)
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
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ import DesignKit
import LocalizationKit
import SwiftUI

// MARK: - CarereceiverSettingsView
// MARK: - EditCarereceiverView

struct CarereceiverSettingsView: View {
struct EditCarereceiverView: View {
// MARK: Internal

@Binding var modifiedCarereceiver: Carereceiver
Expand All @@ -17,12 +17,14 @@ struct CarereceiverSettingsView: View {
NavigationStack {
VStack(spacing: 40) {
Form {
self.avatarPickerButton
.listRowBackground(Color.clear)
Section {
self.avatarPickerButton
.listRowBackground(Color.clear)
}

Section {
LabeledContent(String(l10n.CarereceiverCreation.carereceiverNameLabel.characters)) {
TextField("Nom", text: self.$modifiedCarereceiver.name)
TextField("", text: self.$modifiedCarereceiver.name)
.multilineTextAlignment(.trailing)
}
}
Expand All @@ -36,19 +38,19 @@ struct CarereceiverSettingsView: View {
}
}
}
.navigationTitle(String(l10n.CarereceiverSettingsView.navigationTitle.characters) + self.modifiedCarereceiver.name)
.navigationTitle(String(l10n.EditCarereceiverView.navigationTitle.characters) + self.modifiedCarereceiver.name)
.navigationBarTitleDisplayMode(.inline)
.interactiveDismissDisabled()
.toolbar {
ToolbarItem(placement: .topBarLeading) {
Button(String(l10n.CarereceiverSettingsView.closeButtonLabel.characters)) {
self.rootOwnerViewModel.isCarereceiverSettingsViewPresented = false
Button(String(l10n.EditCarereceiverView.closeButtonLabel.characters)) {
self.rootOwnerViewModel.isEditCarereceiverViewPresented = false
}
}
ToolbarItem(placement: .topBarTrailing) {
Button(String(l10n.CarereceiverSettingsView.saveButtonLabel.characters)) {
Button(String(l10n.EditCarereceiverView.saveButtonLabel.characters)) {
// TODO: (@mathieu) - Add Firestore logic

Check warning on line 52 in Apps/LekaApp/Sources/_NEWCodeBase/Views/EditCarereceiverView/EditCarereceiverView.swift

View workflow job for this annotation

GitHub Actions / swiftlint

TODOs should be resolved ((@mathieu) - Add Firestore log...) (todo)
self.rootOwnerViewModel.isCarereceiverSettingsViewPresented = false
self.rootOwnerViewModel.isEditCarereceiverViewPresented = false
self.rootOwnerViewModel.currentCarereceiver = self.modifiedCarereceiver
}
}
Expand Down Expand Up @@ -79,5 +81,5 @@ struct CarereceiverSettingsView: View {
}

#Preview {
CarereceiverSettingsView(modifiedCarereceiver: .constant(Carereceiver()))
EditCarereceiverView(modifiedCarereceiver: .constant(Carereceiver()))
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,12 @@ struct CarereceiverView: View {

var body: some View {
Button {
self.rootOwnerViewModel.isCarereceiverSettingsViewPresented = true
self.rootOwnerViewModel.isEditCarereceiverViewPresented = true
} label: {
CarereceiverAvatarCell(carereceiver: self.carereceiver)
}
.sheet(isPresented: self.$rootOwnerViewModel.isCarereceiverSettingsViewPresented) {
CarereceiverSettingsView(modifiedCarereceiver: self.$carereceiver)
.sheet(isPresented: self.$rootOwnerViewModel.isEditCarereceiverViewPresented) {
EditCarereceiverView(modifiedCarereceiver: self.$carereceiver)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import LocalizationKit
import RobotKit
import SwiftUI

// MARK: - CaregiverSettingsLabel
// MARK: - EditCaregiverLabel

struct CaregiverSettingsLabel: View {
struct EditCaregiverLabel: View {
// MARK: Internal

var body: some View {
VStack(alignment: .center, spacing: 10) {
if let caregiver = self.rootOwnerViewModel.currentCaregiver {
Button {
self.rootOwnerViewModel.isCaregiverSettingsViewPresented = true
self.rootOwnerViewModel.isEditCaregiverViewPresented = true
} label: {
CaregiverAvatarCell(caregiver: caregiver)
.frame(maxWidth: 80)
Expand Down Expand Up @@ -89,7 +89,7 @@ extension l10n {
#Preview {
NavigationSplitView(sidebar: {
List {
CaregiverSettingsLabel()
EditCaregiverLabel()

Button {} label: {
RobotConnectionLabel()
Expand Down
Loading

0 comments on commit 54bc084

Please sign in to comment.