Skip to content

Commit 7fed656

Browse files
committed
Updated Main View
1 parent 76cb728 commit 7fed656

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

Diff for: Uplift/Views/MainView.swift

+17-17
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,15 @@ import SwiftUI
1010

1111
/// The app's entry point view.
1212
struct MainView: View {
13-
13+
1414
// MARK: - Properties
15-
15+
1616
@State private var selectedTab: Screen = .home
1717
@StateObject var tabBarProp = TabBarProperty()
1818
@StateObject private var viewModel = ViewModel()
1919

2020
// MARK: - UI
21-
21+
2222
var body: some View {
2323
ZStack {
2424
VStack(spacing: 0) {
@@ -36,12 +36,12 @@ struct MainView: View {
3636
.overlay(alignment: .bottom) {
3737
!tabBarProp.hidden ? tabBar.transition(.move(edge: .bottom)) : nil
3838
}
39-
39+
4040
if viewModel.popUpGiveaway {
4141
Constants.Colors.gray04
4242
.opacity(0.4)
4343
.ignoresSafeArea(.all)
44-
44+
4545
GiveawayPopup(
4646
didClickSubmit: $viewModel.didClickSubmit,
4747
instagram: $viewModel.instagram,
@@ -67,19 +67,19 @@ struct MainView: View {
6767
}
6868
}
6969
}
70-
70+
7171
private var tabBar: some View {
7272
HStack {
7373
Spacer()
74-
74+
7575
tabItem(for: .home)
76-
76+
7777
Spacer()
78-
78+
7979
tabItem(for: .classes)
80-
80+
8181
Spacer()
82-
82+
8383
tabItem(for: .profile)
8484

8585
Spacer()
@@ -88,7 +88,7 @@ struct MainView: View {
8888
.background(Constants.Colors.yellow)
8989
.ignoresSafeArea(.all)
9090
}
91-
91+
9292
@ViewBuilder
9393
private func tabItem(for screen: Screen) -> some View {
9494
switch screen {
@@ -122,31 +122,31 @@ struct MainView: View {
122122
}
123123
}
124124
}
125-
125+
126126
private func tabItemView(icon: Image, name: String) -> some View {
127127
VStack {
128128
icon
129129
.resizable()
130130
.scaledToFit()
131131
.frame(width: 24, height: 24)
132-
132+
133133
Text(name)
134134
.font(Constants.Fonts.h3)
135135
}
136136
.foregroundStyle(Constants.Colors.black)
137137
}
138-
138+
139139
}
140140

141141
extension MainView {
142-
142+
143143
/// An enumeration to keep track of which tab the user is currently on.
144144
private enum Screen {
145145
case home
146146
case classes
147147
case profile
148148
}
149-
149+
150150
}
151151

152152
final class TabBarProperty: ObservableObject {

0 commit comments

Comments
 (0)