Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions ios/escape/escape/Views/Components/Badge/BadgeComponents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ struct BadgeItemView: View {
.simultaneousGesture(
TapGesture()
.onEnded { _ in
HapticFeedback.shared.lightImpact()
showingDetail = true
}
)
Expand All @@ -322,6 +323,12 @@ struct BadgeItemView: View {
.sheet(isPresented: $showingDetail) {
BadgeDetailView(badge: badge)
}
.onChange(of: showingDetail) { oldValue, newValue in
// Haptic feedback when sheet is dismissed
if oldValue && !newValue {
HapticFeedback.shared.lightImpact()
}
}
}

// Fallback view when no image is available
Expand Down Expand Up @@ -396,6 +403,7 @@ struct BadgeCardButton: View {

var body: some View {
Button(action: {
HapticFeedback.shared.lightImpact()
showingDetail = true
}) {
VStack(spacing: 8) {
Expand Down Expand Up @@ -475,6 +483,12 @@ struct BadgeCardButton: View {
.sheet(isPresented: $showingDetail) {
BadgeDetailView(badge: badge)
}
.onChange(of: showingDetail) { oldValue, newValue in
// Haptic feedback when sheet is dismissed
if oldValue && !newValue {
HapticFeedback.shared.lightImpact()
}
}
}
}

Expand All @@ -486,6 +500,7 @@ struct Simple3DBadgeView: View {

var body: some View {
Button(action: {
HapticFeedback.shared.lightImpact()
showingDetail = true
}) {
VStack(spacing: 4) {
Expand Down Expand Up @@ -570,6 +585,12 @@ struct Simple3DBadgeView: View {
.sheet(isPresented: $showingDetail) {
BadgeDetailView(badge: badge)
}
.onChange(of: showingDetail) { oldValue, newValue in
// Haptic feedback when sheet is dismissed
if oldValue && !newValue {
HapticFeedback.shared.lightImpact()
}
}
}

// Fallback view when no image is available
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ struct RotatableBadgeView: View {
}
.rotation3DEffect(.degrees(rotationAngle), axis: (x: 0, y: 1, z: 0))
.onTapGesture {
HapticFeedback.shared.mediumImpact()
withAnimation(.easeInOut(duration: 0.8)) {
rotationAngle += 180
isFlipped.toggle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,7 @@ struct GroupCardView: View {
Button(action: {
Task {
await groupViewModel.selectGroup(group)
HapticFeedback.shared.lightImpact()
showingGroupDetail = true
}
}) {
Expand Down Expand Up @@ -324,6 +325,12 @@ struct GroupCardView: View {
.sheet(isPresented: $showingGroupDetail) {
GroupDetailView(groupViewModel: groupViewModel)
}
.onChange(of: showingGroupDetail) { oldValue, newValue in
// Haptic feedback when sheet is dismissed
if oldValue && !newValue {
HapticFeedback.shared.lightImpact()
}
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -358,6 +358,12 @@ struct MemberRowView: View {
UserProfileBottomSheetView(userId: member.user.id)
.presentationDetents([.medium, .large])
}
.onChange(of: showUserProfile) { oldValue, newValue in
// Haptic feedback when sheet is dismissed
if oldValue && !newValue {
HapticFeedback.shared.lightImpact()
}
}
}
}

Expand Down
7 changes: 7 additions & 0 deletions ios/escape/escape/Views/Components/Home/MissionSection.swift
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct MissionSection: View {
.padding(.horizontal)
} else {
MissionCardView(mission: missionViewModel.todaysMission) {
HapticFeedback.shared.lightImpact()
showingMissionDetail = true
}
.padding(.horizontal)
Expand All @@ -60,6 +61,12 @@ struct MissionSection: View {
isPresented: $showingMissionDetail
)
}
.onChange(of: showingMissionDetail) { oldValue, newValue in
// Haptic feedback when sheet is dismissed
if oldValue && !newValue {
HapticFeedback.shared.lightImpact()
}
}
}

private func loadCurrentMission() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import SwiftUI

// Wrapper to make UUID work with .sheet(item:)
private struct IdentifiableUUID: Identifiable {
private struct IdentifiableUUID: Identifiable, Equatable {
let id: UUID
}

Expand Down Expand Up @@ -89,13 +89,20 @@ struct NationalRankingView: View {
UserProfileBottomSheetView(userId: identifiableUserId.id)
.presentationDetents([.medium, .large])
}
.onChange(of: selectedUserId) { oldValue, newValue in
// Haptic feedback when sheet is dismissed
if oldValue != nil && newValue == nil {
HapticFeedback.shared.lightImpact()
}
}
.task {
await loadRankings()
startAnimations()
}
}

private func handleUserTap(userId: UUID) {
HapticFeedback.shared.lightImpact()
selectedUserId = IdentifiableUUID(id: userId)
}

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

// Wrapper to make UUID work with .sheet(item:)
private struct IdentifiableUUID: Identifiable {
private struct IdentifiableUUID: Identifiable, Equatable {
let id: UUID
}

Expand Down Expand Up @@ -90,13 +90,20 @@ struct TeamRankingView: View {
UserProfileBottomSheetView(userId: identifiableUserId.id)
.presentationDetents([.medium, .large])
}
.onChange(of: selectedUserId) { oldValue, newValue in
// Haptic feedback when sheet is dismissed
if oldValue != nil && newValue == nil {
HapticFeedback.shared.lightImpact()
}
}
.task {
await loadTeamRankings()
startAnimations()
}
}

private func handleUserTap(userId: UUID) {
HapticFeedback.shared.lightImpact()
selectedUserId = IdentifiableUUID(id: userId)
}

Expand Down