Skip to content

Commit

Permalink
Increased tappable area of chat nav title profile selector (#394)
Browse files Browse the repository at this point in the history
  • Loading branch information
Oleg-Pecheneg authored Feb 26, 2024
1 parent 2d770b4 commit df5031e
Showing 1 changed file with 19 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,20 @@ struct ChatListNavTitleView: View {
UDVibration.buttonTap.vibrate()
tabRouter.isSelectProfilePresented = true
} label: {
HStack {
content()
if selectable {
Image.chevronDown
.resizable()
.squareFrame(20)
.foregroundStyle(Color.foregroundDefault)
ZStack {
Rectangle()
.frame(width: 200,
height: 30)
.opacity(0.001)
.layoutPriority(-1)
HStack {
content()
if selectable {
Image.chevronDown
.resizable()
.squareFrame(20)
.foregroundStyle(Color.foregroundDefault)
}
}
}
}
Expand All @@ -49,6 +56,7 @@ private extension ChatListNavTitleView {
var selectable: Bool {
appContext.userProfileService.profiles.count > 1
}

@ViewBuilder
func content() -> some View {
switch profile {
Expand Down Expand Up @@ -122,3 +130,7 @@ private extension ChatListNavTitleView {
extension ChatListNavTitleView {

}

#Preview {
ChatListNavTitleView(profile: appContext.userProfileService.selectedProfile!)
}

0 comments on commit df5031e

Please sign in to comment.