Fix bottom sheets

This commit is contained in:
Benoit Martins 2025-07-28 21:54:39 +02:00
parent 43ebb20646
commit 1ab630c0f5
5 changed files with 4 additions and 70 deletions

View file

@ -41,7 +41,7 @@ struct ContactFragment: View {
contactInnerContent(contactsListViewModel: contactsListViewModel)
.sheet(isPresented: $showingSheet) {
ContactListBottomSheet(contactsListViewModel: contactsListViewModel, showingSheet: $showingSheet)
.presentationDetents([.fraction(0.2)])
.presentationDetents([.fraction(0.1)])
}
.sheet(isPresented: $showShareSheet) {
ShareSheet(friendToShare: contactAvatarModel)

View file

@ -87,73 +87,6 @@ struct ContactListBottomSheet: View {
}
.padding(.horizontal, 30)
.background(Color.gray100)
VStack {
Divider()
}
.frame(maxWidth: .infinity)
if contactsListViewModel.stringToCopy.prefix(4) != "sip:" {
Button {
if #available(iOS 16.0, *) {
if idiom != .pad {
showingSheet.toggle()
} else {
showingSheet.toggle()
dismiss()
}
} else {
showingSheet.toggle()
dismiss()
}
} label: {
HStack {
Image("envelope-simple-open")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.grayMain2c500)
.frame(width: 25, height: 25, alignment: .leading)
.padding(.all, 10)
Text("menu_invite")
.default_text_style(styleSize: 16)
Spacer()
}
.frame(maxHeight: .infinity)
}
.padding(.horizontal, 30)
.background(Color.gray100)
VStack {
Divider()
}
.frame(maxWidth: .infinity)
}
Button {
if #available(iOS 16.0, *) {
showingSheet.toggle()
} else {
showingSheet.toggle()
dismiss()
}
} label: {
HStack {
Image("x-circle")
.renderingMode(.template)
.resizable()
.foregroundStyle(Color.grayMain2c500)
.frame(width: 25, height: 25, alignment: .leading)
.padding(.all, 10)
Text(contactsListViewModel.stringToCopy.prefix(4) == "sip:"
? "menu_block_address" : "menu_block_number")
.default_text_style(styleSize: 16)
Spacer()
}
.frame(maxHeight: .infinity)
}
.padding(.horizontal, 30)
.background(Color.gray100)
}
.onRotate { newOrientation in
orientation = newOrientation

View file

@ -41,7 +41,7 @@ struct ContactsFragment: View {
showingSheet: $showingSheet,
showShareSheet: $showShareSheet
)
.presentationDetents([.fraction(0.2)])
.presentationDetents([.fraction(0.3)])
}
.sheet(isPresented: $showShareSheet) {
ShareSheet(friendToShare: contactsListViewModel.selectedFriendToShare!)

View file

@ -56,6 +56,7 @@ struct ContactsListBottomSheet: View {
}
Spacer()
Button {
self.contactsListViewModel.toggleStarredSelectedFriend()

View file

@ -39,7 +39,7 @@ struct HistoryFragment: View {
isShowEditContactFragment: $isShowEditContactFragment,
isShowEditContactFragmentAddress: $isShowEditContactFragmentAddress
)
.presentationDetents([.fraction(0.2)])
.presentationDetents([.fraction(0.3)])
}
} else {
HistoryListFragment(showingSheet: $showingSheet, text: $text)