Skip to content

Commit ec4a537

Browse files
committed
Removed unnecessary custom note alert. Customised custom sure alert
1 parent 9fb317c commit ec4a537

File tree

9 files changed

+17
-48
lines changed

9 files changed

+17
-48
lines changed

GoInfoGame/GoInfoGame.xcodeproj/project.pbxproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
971575192B5FFE910044797C /* LocationManagerCoordinator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971575182B5FFE910044797C /* LocationManagerCoordinator.swift */; };
3434
971F9FDF2B847349005397CC /* CrossingIslandForm.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971F9FDE2B847349005397CC /* CrossingIslandForm.swift */; };
3535
971F9FE12B847358005397CC /* CrossingIsland.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971F9FE02B847358005397CC /* CrossingIsland.swift */; };
36-
971F9FDC2B836DF3005397CC /* CustomNoteAlert.swift in Sources */ = {isa = PBXBuildFile; fileRef = 971F9FDB2B836DF3005397CC /* CustomNoteAlert.swift */; };
3736
972454152B14A49A0036B91A /* Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 972454142B14A49A0036B91A /* Extensions.swift */; };
3837
973FBFFE2B46BB3800878269 /* Utils.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973FBFFD2B46BB3800878269 /* Utils.swift */; };
3938
973FC0012B46CD5D00878269 /* QuestsListUIView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 973FC0002B46CD5D00878269 /* QuestsListUIView.swift */; };
@@ -286,7 +285,6 @@
286285
971575182B5FFE910044797C /* LocationManagerCoordinator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = LocationManagerCoordinator.swift; sourceTree = "<group>"; };
287286
971F9FDE2B847349005397CC /* CrossingIslandForm.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrossingIslandForm.swift; sourceTree = "<group>"; };
288287
971F9FE02B847358005397CC /* CrossingIsland.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CrossingIsland.swift; sourceTree = "<group>"; };
289-
971F9FDB2B836DF3005397CC /* CustomNoteAlert.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = CustomNoteAlert.swift; sourceTree = "<group>"; };
290288
972454142B14A49A0036B91A /* Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Extensions.swift; sourceTree = "<group>"; };
291289
973FBFFD2B46BB3800878269 /* Utils.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = Utils.swift; sourceTree = "<group>"; };
292290
973FC0002B46CD5D00878269 /* QuestsListUIView.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = QuestsListUIView.swift; sourceTree = "<group>"; };
@@ -683,7 +681,6 @@
683681
97AC1C092B6B7F10004F0BF4 /* CustomVerticalButtonsList.swift */,
684682
97AC1C0B2B6B843C004F0BF4 /* CustomAlert.swift */,
685683
FABF3CF72B822F120080EAC9 /* CustomSureAlert.swift */,
686-
971F9FDB2B836DF3005397CC /* CustomNoteAlert.swift */,
687684
);
688685
path = CustomComponents;
689686
sourceTree = "<group>";
@@ -1651,7 +1648,6 @@
16511648
973FC0032B47DE0700878269 /* QuestsVM.swift in Sources */,
16521649
A4E711AE2B59004700C9DE08 /* StepsIncline.swift in Sources */,
16531650
973FC0142B4D353800878269 /* SideWalkWidthForm.swift in Sources */,
1654-
971F9FDC2B836DF3005397CC /* CustomNoteAlert.swift in Sources */,
16551651
971575172B5FFD6F0044797C /* MapView.swift in Sources */,
16561652
973FC04A2B5A478C00878269 /* CrossMarkingForm.swift in Sources */,
16571653
973FC03F2B59418B00878269 /* WayLit.swift in Sources */,

GoInfoGame/GoInfoGame/UI/CustomComponents/CustomNoteAlert.swift

Lines changed: 0 additions & 29 deletions
This file was deleted.

GoInfoGame/GoInfoGame/UI/CustomComponents/CustomSureAlert.swift

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,11 +8,13 @@
88
import SwiftUI
99

1010
struct CustomSureAlert: View {
11-
let alertTitle: String
12-
let content: String
13-
let isDontShowCheckVisible: Bool
14-
let onCancel: () -> Void
15-
let onConfirm: () -> Void
11+
let alertTitle: String /// Title of the alert
12+
let content: String /// Main content of the alert
13+
let leftBtnLabel: String /// Label for the left button (usually cancel)
14+
let rightBtnLabel: String /// Label for the right button (usually confirm)
15+
let isDontShowCheckVisible: Bool /// Flag indicating if the "Don't show again" checkbox should be visible
16+
let onCancel: () -> Void /// Closure to handle cancel action
17+
let onConfirm: () -> Void /// Closure to handle confirm action
1618

1719
var body: some View {
1820
CustomAlert(title: alertTitle, content: {
@@ -27,10 +29,10 @@ struct CustomSureAlert: View {
2729
}
2830
}
2931
}
30-
}, leftActionText: LocalizedStrings.undoConfirmNegative.localized, rightActionText: LocalizedStrings.questGenericConfirmationYes.localized, leftButtonAction: onCancel, rightButtonAction: onConfirm, height: 200, width: 270)
32+
}, leftActionText: leftBtnLabel, rightActionText: rightBtnLabel, leftButtonAction: onCancel, rightButtonAction: onConfirm, height: 200, width: 270)
3133
}
3234
}
3335

3436
#Preview {
35-
CustomSureAlert(alertTitle: "", content: LocalizedStrings.questSourceDialogNote.localized,isDontShowCheckVisible: true, onCancel: {}, onConfirm: {})
37+
CustomSureAlert(alertTitle: "", content: LocalizedStrings.questSourceDialogNote.localized,leftBtnLabel: "", rightBtnLabel: "", isDontShowCheckVisible: true, onCancel: {}, onConfirm: {})
3638
}

GoInfoGame/GoInfoGame/quests/BusStopLit/BusStopLitForm.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ struct BusStopLitForm: View, QuestForm {
3333
.shadow(color: .gray, radius: 2, x: 0, y: 2))
3434
}.padding()
3535
if isShowingAreYouSure {
36-
CustomSureAlert(alertTitle: LocalizedStrings.questSourceDialogTitle.localized, content: LocalizedStrings.questSourceDialogNote.localized, isDontShowCheckVisible: true,onCancel: {
36+
CustomSureAlert(alertTitle: LocalizedStrings.questSourceDialogTitle.localized, content: LocalizedStrings.questSourceDialogNote.localized,leftBtnLabel: LocalizedStrings.undoConfirmNegative.localized, rightBtnLabel:LocalizedStrings.questGenericConfirmationYes.localized, isDontShowCheckVisible: true,onCancel: {
3737
self.isShowingAreYouSure = false
3838
}, onConfirm: {
3939
self.isShowingAreYouSure = false

GoInfoGame/GoInfoGame/quests/CrossingIsland/CrossingIslandForm.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ struct CrossingIslandForm: View, QuestForm {
3737
.shadow(color: .gray, radius: 2, x: 0, y: 2))
3838
}.padding()
3939
if isShowingAreYouSure {
40-
CustomSureAlert(alertTitle: LocalizedStrings.questSourceDialogTitle.localized, content: LocalizedStrings.questSourceDialogNote.localized, isDontShowCheckVisible: true,onCancel: {
40+
CustomSureAlert(alertTitle: LocalizedStrings.questSourceDialogTitle.localized, content: LocalizedStrings.questSourceDialogNote.localized,leftBtnLabel: LocalizedStrings.undoConfirmNegative.localized, rightBtnLabel:LocalizedStrings.questGenericConfirmationYes.localized, isDontShowCheckVisible: true,onCancel: {
4141
self.isShowingAreYouSure = false
4242
}, onConfirm: {
4343
self.isShowingAreYouSure = false
@@ -48,7 +48,7 @@ struct CrossingIslandForm: View, QuestForm {
4848
/// if user selects other answers option
4949
if showOtherAlert {
5050
/// display leave a note instead alert
51-
CustomSureAlert(alertTitle: LocalizedStrings.questLeaveNewNoteTitle.localized, content: LocalizedStrings.questLeaveNewNoteDescription.localized, isDontShowCheckVisible: false, onCancel: {
51+
CustomSureAlert(alertTitle: LocalizedStrings.questLeaveNewNoteTitle.localized, content: LocalizedStrings.questLeaveNewNoteDescription.localized,leftBtnLabel: LocalizedStrings.questLeaveNewNoteNo.localized, rightBtnLabel:LocalizedStrings.questLeaveNewNoteYes.localized, isDontShowCheckVisible: false, onCancel: {
5252
self.showOtherAlert = false
5353
}, onConfirm: {
5454
self.showOtherAlert = false

GoInfoGame/GoInfoGame/quests/Handrail/HandRailForm.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ struct HandRailForm: View, QuestForm {
3030
.shadow(color: .gray, radius: 2, x: 0, y: 2))
3131
}.padding()
3232
if isShowingAreYouSure {
33-
CustomSureAlert(alertTitle: LocalizedStrings.questSourceDialogTitle.localized, content: LocalizedStrings.questSourceDialogNote.localized, isDontShowCheckVisible: true,onCancel: {
33+
CustomSureAlert(alertTitle: LocalizedStrings.questSourceDialogTitle.localized, content: LocalizedStrings.questSourceDialogNote.localized,leftBtnLabel: LocalizedStrings.undoConfirmNegative.localized, rightBtnLabel:LocalizedStrings.questGenericConfirmationYes.localized, isDontShowCheckVisible: true,onCancel: {
3434
self.isShowingAreYouSure = false
3535
}, onConfirm: {
3636
self.isShowingAreYouSure = false

GoInfoGame/GoInfoGame/quests/TactilePavingKerb/TactilePavingKerbForm.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ struct TactilePavingKerbForm: View, QuestForm {
4242
/// if user selects yes/no option
4343
if showAlert {
4444
/// display are you sure alert
45-
CustomSureAlert(alertTitle: LocalizedStrings.questSourceDialogTitle.localized, content: LocalizedStrings.questSourceDialogNote.localized, isDontShowCheckVisible: true, onCancel: {
45+
CustomSureAlert(alertTitle: LocalizedStrings.questSourceDialogTitle.localized, content: LocalizedStrings.questSourceDialogNote.localized,leftBtnLabel: LocalizedStrings.undoConfirmNegative.localized, rightBtnLabel:LocalizedStrings.questGenericConfirmationYes.localized, isDontShowCheckVisible: true, onCancel: {
4646
self.showAlert = false
4747
}, onConfirm: {
4848
self.showAlert = false
@@ -53,7 +53,7 @@ struct TactilePavingKerbForm: View, QuestForm {
5353
/// if user selects other answers option
5454
if showOtherAlert {
5555
/// display leave a note instead alert
56-
CustomSureAlert(alertTitle: LocalizedStrings.questLeaveNewNoteTitle.localized, content: LocalizedStrings.questLeaveNewNoteDescription.localized, isDontShowCheckVisible: false, onCancel: {
56+
CustomSureAlert(alertTitle: LocalizedStrings.questLeaveNewNoteTitle.localized, content: LocalizedStrings.questLeaveNewNoteDescription.localized,leftBtnLabel: LocalizedStrings.questLeaveNewNoteNo.localized, rightBtnLabel:LocalizedStrings.questLeaveNewNoteYes.localized, isDontShowCheckVisible: false, onCancel: {
5757
self.showOtherAlert = false
5858
}, onConfirm: {
5959
self.showOtherAlert = false

GoInfoGame/GoInfoGame/quests/TactilePavingSteps/TactilePavingStepsForm.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ struct TactilePavingStepsForm: View, QuestForm {
4141
.shadow(color: .gray, radius: 2, x: 0, y: 2))
4242
}.padding()
4343
if isShowingAreYouSure {
44-
CustomSureAlert(alertTitle: LocalizedStrings.questSourceDialogTitle.localized, content: LocalizedStrings.questSourceDialogNote.localized, isDontShowCheckVisible: true,onCancel: {
44+
CustomSureAlert(alertTitle: LocalizedStrings.questSourceDialogTitle.localized, content: LocalizedStrings.questSourceDialogNote.localized,leftBtnLabel: LocalizedStrings.undoConfirmNegative.localized, rightBtnLabel:LocalizedStrings.questGenericConfirmationYes.localized, isDontShowCheckVisible: true,onCancel: {
4545
self.isShowingAreYouSure = false
4646
}, onConfirm: {
4747
self.isShowingAreYouSure = false

GoInfoGame/GoInfoGame/quests/WayLit/WayLitForm.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ struct WayLitForm: View, QuestForm {
3232
.shadow(color: .gray, radius: 2, x: 0, y: 2))
3333
}.padding()
3434
if isShowingAreYouSure {
35-
CustomSureAlert(alertTitle: LocalizedStrings.questSourceDialogTitle.localized, content: LocalizedStrings.questSourceDialogNote.localized, isDontShowCheckVisible: true,onCancel: {
35+
CustomSureAlert(alertTitle: LocalizedStrings.questSourceDialogTitle.localized, content: LocalizedStrings.questSourceDialogNote.localized,leftBtnLabel: LocalizedStrings.undoConfirmNegative.localized, rightBtnLabel:LocalizedStrings.questGenericConfirmationYes.localized, isDontShowCheckVisible: true,onCancel: {
3636
self.isShowingAreYouSure = false
3737
}, onConfirm: {
3838
self.isShowingAreYouSure = false

0 commit comments

Comments
 (0)