Skip to content

Commit f55a8a2

Browse files
committed
update top tab style
1 parent 059f754 commit f55a8a2

File tree

1 file changed

+17
-18
lines changed

1 file changed

+17
-18
lines changed

iosApp/flare/UI/Screen/HomeTimelineScreen.swift

Lines changed: 17 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -65,33 +65,31 @@ struct HomeTimelineScreen: View {
6565
) {
6666
ForEach(0..<tabs.count, id: \.self) { index in
6767
let tab = tabs[index]
68-
69-
Label {
70-
TabTitle(title: tab.metaData.title)
71-
.font(.subheadline)
72-
} icon: {
73-
TabIcon(icon: tab.metaData.icon, accountType: tab.account, size: 24)
74-
.font(.title)
75-
}
76-
.padding(.horizontal)
77-
.padding(.vertical, 8)
78-
.foregroundStyle(selectedTabIndex == index ? Color.white : .primary)
79-
.background(
80-
Capsule()
81-
.foregroundColor(selectedTabIndex == index ? .accentColor : Color(.systemBackground))
82-
)
83-
.onTapGesture {
68+
Button {
8469
withAnimation(.spring) {
8570
selectedTabIndex = index
8671
}
72+
} label: {
73+
Label {
74+
TabTitle(title: tab.metaData.title)
75+
.font(.subheadline)
76+
} icon: {
77+
TabIcon(icon: tab.metaData.icon, accountType: tab.account, size: 24)
78+
.font(.title)
79+
}
80+
}
81+
.if(selectedTabIndex == index) { button in
82+
button.buttonStyle(.glassProminent)
83+
} else: { button in
84+
button.buttonStyle(.glass)
8785
}
8886
}
8987
if case .success = onEnum(of: presenter.state.user) {
9088
Button {
9189
} label: {
9290
Image("fa-plus")
9391
}
94-
.buttonStyle(.bordered)
92+
.buttonStyle(.glass)
9593
}
9694
}
9795
}
@@ -117,7 +115,8 @@ struct HomeTimelineScreen: View {
117115
}
118116
.padding(.horizontal)
119117
.padding(.vertical, 8)
120-
.background(.regularMaterial)
118+
.glassEffect()
119+
.padding(.horizontal)
121120
.offset(y: -headerOffset)
122121
}
123122
.toolbarVisibility(.hidden, for: .navigationBar)

0 commit comments

Comments
 (0)