Skip to content

Commit

Permalink
fix: unresponsive tab bar on iPad
Browse files Browse the repository at this point in the history
  • Loading branch information
ntnhon committed May 22, 2023
1 parent b3d24f6 commit 2ad6245
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 5 additions & 11 deletions SimpleLogin/SimpleLogin/Modules/Main/MainTabBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct MainTabBar: View {
let onSelectCreate: () -> Void

var body: some View {
HStack {
HStack(spacing: 0) {
if UIDevice.current.userInterfaceIdiom != .phone {
Spacer()
}
Expand All @@ -38,6 +38,8 @@ struct MainTabBar: View {
.lineLimit(1)
.minimumScaleFactor(0.8)
}
.padding(.horizontal)
.contentShape(Rectangle())
.frame(maxWidth: UIDevice.current.userInterfaceIdiom != .phone ? 130 : .infinity)
.foregroundColor(selectedItem == item ? .slPurple : (colorScheme == .dark ? .white : .gray))
.onTapGesture {
Expand Down Expand Up @@ -100,11 +102,7 @@ enum TabBarItem {
case .myAccount:
return "person"
case .settings:
if #available(iOS 15, *) {
return "gear.circle"
} else {
return "gearshape"
}
return "gear.circle"
}
}

Expand All @@ -117,11 +115,7 @@ enum TabBarItem {
case .myAccount:
return "person.fill"
case .settings:
if #available(iOS 15, *) {
return "gear.circle.fill"
} else {
return "gearshape.fill"
}
return "gear.circle.fill"
}
}
}
Expand Down
2 changes: 2 additions & 0 deletions SimpleLogin/SimpleLogin/Modules/Main/MainView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ struct MainView: View {
Vibration.light.vibrate()
selectedSheet = .createAlias
}
// Non-transparent but very pale color to prevent underlying tabs from being tapped
.background(Color.white.opacity(0.01))
}
.emptyPlaceholder(isEmpty: !viewModel.canShowDetails, useZStack: true) {
ZStack {
Expand Down

0 comments on commit 2ad6245

Please sign in to comment.