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
26 changes: 19 additions & 7 deletions Flipcash/Core/Screens/Main/Home/HomeTab.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,17 @@

import SwiftUI

/// The tabs of the v2 tab-bar UI, in display order (left → right). The app
/// launches on `.wallet` (wallet-first), mirroring the Android v2 UI.
/// The tabs of the v2 tab-bar UI, in display order (left → right). Chat sits
/// second, beside the scanner that feeds it, and the app still launches on
/// `.wallet` — declaration order is the bar's order, not the launch tab. Matches
/// Android's `NavBarButton.tabs`.
///
/// Icons are the Figma tab-bar glyphs (`Nav*` template imagesets, from the same
/// vectors as Android's `ic_nav_*`), tinted white at the call site.
enum HomeTab: Int, CaseIterable, Identifiable, Hashable {
case scan
case wallet
case chat
case wallet
case tipCard

var id: Int { rawValue }
Expand All @@ -23,21 +25,31 @@ enum HomeTab: Int, CaseIterable, Identifiable, Hashable {

/// The asset-catalog name of the tab's template glyph. Selected tabs use a
/// filled glyph and the rest an outline, per the tab bar spec.
///
/// The scanner reads tip cards, so it carries the tip card itself rather
/// than a viewfinder, and You takes the people-circle the scanner's slot
/// left free — the glyph it shows when there is no profile photo to draw in
/// its place (node 10000:111297).
///
/// That fallback's filled weight comes from Material Icons' `account_circle`
/// rather than from the design file, which draws the You tab only as an
/// outline. It is the same glyph solid, and Android's people circle takes its
/// selected weight from the same place, so the two bars fill alike.
func iconName(isSelected: Bool) -> String {
switch self {
case .scan: return isSelected ? "NavScanSelected" : "NavScan"
case .wallet: return isSelected ? "NavWalletSelected" : "NavWallet"
case .scan: return isSelected ? "NavTipCardSelected" : "NavTipCard"
case .chat: return isSelected ? "NavChatSelected" : "NavChat"
case .tipCard: return isSelected ? "NavTipCardSelected" : "NavTipCard"
case .wallet: return isSelected ? "NavWalletSelected" : "NavWallet"
case .tipCard: return isSelected ? "NavPeopleSelected" : "NavPeople"
}
}

/// VoiceOver label for the tab's button.
var accessibilityLabel: String {
switch self {
case .scan: return "Scan"
case .wallet: return "Wallet"
case .chat: return "Chat"
case .wallet: return "Wallet"
case .tipCard: return "You"
}
}
Expand Down
4 changes: 2 additions & 2 deletions Flipcash/Core/Screens/Main/Home/HomeTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -123,8 +123,8 @@ struct HomeTabView: View {
/// Derived in the body rather than waited on: the profile is hydrated from
/// the database before the first paint, so a cold launch knows a picture is
/// coming — and can decode its BlurHash — while the thumbnail is still being
/// read back. Keying only on the loaded photo would show the glyph until it
/// landed, which is the tip card's icon on somebody who has a picture.
/// read back. Keying only on the loaded photo would show the no-photo glyph
/// until it landed, on somebody who has a picture.
private var profileSlot: ProfileTabSlot? {
if let photo = profilePhoto.photo { return .photo(photo) }
guard let picture = profilePicture, picture.thumbnailBlobID != nil else { return nil }
Expand Down
2 changes: 1 addition & 1 deletion Flipcash/Core/Screens/Main/Home/NewUserTutorial.swift
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ nonisolated enum TutorialItem: TutorialItemPresentable {
var icon: Image {
switch self {
case .addMoney: return Image(systemName: "plus.circle")
case .scanTipCard: return Image("NavScan")
case .scanTipCard: return Image("NavTipCard")
}
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "nav_scan.svg",
"filename" : "nav_people.svg",
"idiom" : "universal"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"images" : [
{
"filename" : "nav_scan_selected.svg",
"filename" : "nav_people_selected.svg",
"idiom" : "universal"
}
],
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

This file was deleted.

This file was deleted.

Loading