Skip to content

Commit

Permalink
💄 [Design] Tabbar 디자인 1차 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
syss220211 committed Jun 17, 2024
1 parent c66a2f3 commit 16bc92d
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 61 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@ struct HomeView: View {

var body: some View {
ZStack {
// Color.red
// .ignoresSafeArea()
Text("GO TO ANOTHERVIEW")
// .foregroundStyle(.white)
.font(.largeTitle)
.onTapGesture {
router.navigateTo(.categoryFilter)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import SwiftUI

struct TabbarMainView: View {
@StateObject public var viewModel = TabbarViewModel()

var body: some View {
TabView(selection: $viewModel.selected) {
ForEach(Tabbar.allCases, id: \.self) { tab in
Expand All @@ -21,26 +21,7 @@ struct TabbarMainView: View {
.overlay {
VStack {
Spacer()
HStack {
ForEach(Tabbar.allCases, id: \.self) { item in
VStack(spacing: 5) {
Image(systemName: item.image)
.frame(width: 24, height: 24)
Text(item.title)
.applyFont(font: .label1)
.foregroundStyle(Color.neutral400)
}
.frame(maxWidth: .infinity, alignment: .center)
.contentShape(Rectangle())
.padding(.bottom, 10)
.onTapGesture {
viewModel.selected = item
print("item \(item)")
}
}
}
.padding(.top, 10)
.background(.white)
TabbarView(viewModel: viewModel)
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,28 +10,40 @@ import SwiftUI

struct TabbarView: View {
@ObservedObject var viewModel: TabbarViewModel
@EnvironmentObject var router: Router

var body: some View {
HStack {
ForEach(Tabbar.allCases, id: \.self) { item in
VStack(spacing: 5) {
Image(systemName: item.image)
.frame(width: 24, height: 24)
Text(item.title)
.applyFont(font: .label1)
.foregroundStyle(Color.neutral400)
}
.frame(maxWidth: .infinity, alignment: .center)
.contentShape(Rectangle())
.padding(.bottom, 10)
.onTapGesture {
viewModel.selected = item
print("item \(item)")
Rectangle()
.fill(Color.white)
.shadow(color: .black.opacity(0.01), radius: 1, y: -2.0)
.blur(radius: 8)
.shadow(radius: 10)
.frame(height: 66)
.overlay {
HStack {
ForEach(Tabbar.allCases, id: \.self) { item in
VStack(spacing: 5) {
Image(systemName: item.image)
.frame(width: 24, height: 24)
Text(item.title)
.applyFont(font: .label1)
.foregroundStyle(Color.neutral400)
}
.frame(maxWidth: .infinity, alignment: .center)
.contentShape(Rectangle())
.padding(.bottom, 10)
.onTapGesture {
viewModel.selected = item
}
// .simultaneousGesture(TapGesture(count: 2).onEnded {
// router.popToRoot()
// })
}
}
.padding(.top, 10)
.background(.white)
}
}
.padding(.top, 10)
.background(.white)

}
}

Expand Down

0 comments on commit 16bc92d

Please sign in to comment.