Skip to content

Commit 3096fd8

Browse files
author
Neo
committed
Revert "chore: remove MTRX iOS folder from 0pnMatrx repo"
This reverts commit e5306b8.
1 parent e5306b8 commit 3096fd8

13 files changed

Lines changed: 2694 additions & 0 deletions

MTRX/Account/AccountView.swift

Lines changed: 457 additions & 0 deletions
Large diffs are not rendered by default.

MTRX/App/MTRXTabView.swift

Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
import SwiftUI
2+
3+
/// Root tab navigation for the MTRX iOS app.
4+
///
5+
/// Five tabs in locked order:
6+
/// 1. Discover — browse platform capabilities
7+
/// 2. Build — developer tools, marketplace, SDK
8+
/// 3. Home — Trinity chat (default on launch)
9+
/// 4. Social — live activity feed
10+
/// 5. Account — wallet, subscription, settings
11+
///
12+
/// Home is always the default selected tab.
13+
struct MTRXTabView: View {
14+
15+
enum Tab: Int, CaseIterable {
16+
case discover = 0
17+
case build = 1
18+
case home = 2
19+
case social = 3
20+
case account = 4
21+
}
22+
23+
@State private var selectedTab: Tab = .home
24+
25+
/// Pre-filled message to send to Trinity when deep-linking from Discover.
26+
/// Set this before switching to .home and HomeView will pick it up.
27+
@State private var pendingTrinityMessage: String = ""
28+
29+
/// Gateway base URL — shared across tabs that need it.
30+
private let baseURL: URL
31+
32+
init(baseURL: URL = URL(string: "http://localhost:18790")!) {
33+
self.baseURL = baseURL
34+
35+
// Tab bar appearance: pure black background, green/grey tint
36+
let appearance = UITabBarAppearance()
37+
appearance.configureWithOpaqueBackground()
38+
appearance.backgroundColor = UIColor.black
39+
appearance.stackedLayoutAppearance.normal.iconColor = UIColor(
40+
red: 0x66 / 255.0,
41+
green: 0x66 / 255.0,
42+
blue: 0x66 / 255.0,
43+
alpha: 1.0
44+
)
45+
appearance.stackedLayoutAppearance.normal.titleTextAttributes = [
46+
.foregroundColor: UIColor(
47+
red: 0x66 / 255.0,
48+
green: 0x66 / 255.0,
49+
blue: 0x66 / 255.0,
50+
alpha: 1.0
51+
)
52+
]
53+
appearance.stackedLayoutAppearance.selected.iconColor = UIColor(
54+
red: 0x00 / 255.0,
55+
green: 0xFF / 255.0,
56+
blue: 0x41 / 255.0,
57+
alpha: 1.0
58+
)
59+
appearance.stackedLayoutAppearance.selected.titleTextAttributes = [
60+
.foregroundColor: UIColor(
61+
red: 0x00 / 255.0,
62+
green: 0xFF / 255.0,
63+
blue: 0x41 / 255.0,
64+
alpha: 1.0
65+
)
66+
]
67+
UITabBar.appearance().standardAppearance = appearance
68+
UITabBar.appearance().scrollEdgeAppearance = appearance
69+
}
70+
71+
var body: some View {
72+
TabView(selection: $selectedTab) {
73+
74+
// ── Tab 1: Discover ──────────────────────────────────
75+
DiscoverView(
76+
baseURL: baseURL,
77+
onTryWithTrinity: { message in
78+
pendingTrinityMessage = message
79+
selectedTab = .home
80+
}
81+
)
82+
.tabItem {
83+
Label("Discover", systemImage: "safari")
84+
}
85+
.tag(Tab.discover)
86+
87+
// ── Tab 2: Build ─────────────────────────────────────
88+
BuildView(baseURL: baseURL)
89+
.tabItem {
90+
Label("Build", systemImage: "hammer")
91+
}
92+
.tag(Tab.build)
93+
94+
// ── Tab 3: Home (Trinity) ────────────────────────────
95+
HomeView(
96+
baseURL: baseURL,
97+
pendingMessage: $pendingTrinityMessage
98+
)
99+
.tabItem {
100+
Label("Home", systemImage: "message.fill")
101+
}
102+
.tag(Tab.home)
103+
104+
// ── Tab 4: Social ────────────────────────────────────
105+
SocialFeedView(baseURL: baseURL)
106+
.tabItem {
107+
Label("Social", systemImage: "globe")
108+
}
109+
.tag(Tab.social)
110+
111+
// ── Tab 5: Account ───────────────────────────────────
112+
AccountView(baseURL: baseURL)
113+
.tabItem {
114+
Label("Account", systemImage: "person.crop.circle")
115+
}
116+
.tag(Tab.account)
117+
}
118+
.preferredColorScheme(.dark)
119+
}
120+
}
121+
122+
#if DEBUG
123+
struct MTRXTabView_Previews: PreviewProvider {
124+
static var previews: some View {
125+
MTRXTabView()
126+
}
127+
}
128+
#endif

0 commit comments

Comments
 (0)