메시지 - 리스트, 쓰기, 상세 페이지 추가
This commit is contained in:
@@ -8,8 +8,81 @@
|
||||
import SwiftUI
|
||||
|
||||
struct MessageView: View {
|
||||
|
||||
@StateObject var viewModel = MessageViewModel()
|
||||
|
||||
var body: some View {
|
||||
Text("Message")
|
||||
GeometryReader { geo in
|
||||
VStack {
|
||||
HomeNavigationBar(title: "메시지") {}
|
||||
|
||||
Tab()
|
||||
|
||||
Text("※ 보관하지 않은 받은 메시지는 3일 후, 자동 삭제됩니다.")
|
||||
.font(.custom(Font.medium.rawValue, size: 13.3))
|
||||
.padding(.top, 20)
|
||||
|
||||
switch viewModel.currentTab {
|
||||
case .text:
|
||||
TextMessageView()
|
||||
|
||||
case .voice:
|
||||
VoiceMessageView()
|
||||
}
|
||||
}
|
||||
.frame(width: geo.size.width, height: geo.size.height)
|
||||
}
|
||||
}
|
||||
|
||||
@ViewBuilder
|
||||
func Tab() -> some View {
|
||||
let tabWidth = screenSize().width / 2
|
||||
|
||||
VStack(spacing:0) {
|
||||
HStack(spacing: 0) {
|
||||
Button(action: {
|
||||
if viewModel.currentTab != .text {
|
||||
viewModel.currentTab = .text
|
||||
}
|
||||
}) {
|
||||
VStack(spacing: 0) {
|
||||
Text("문자")
|
||||
.font(.custom(Font.medium.rawValue, size: 16.7))
|
||||
.foregroundColor(Color(hex: viewModel.currentTab == .text ? "eeeeee" : "777777"))
|
||||
.frame(width: tabWidth, height: 50)
|
||||
|
||||
if viewModel.currentTab == .text {
|
||||
Rectangle()
|
||||
.foregroundColor(Color(hex: "9970ff"))
|
||||
.frame(width: tabWidth, height: 3)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Button(action: {
|
||||
if viewModel.currentTab != .voice {
|
||||
viewModel.currentTab = .voice
|
||||
}
|
||||
}) {
|
||||
VStack(spacing: 0) {
|
||||
Text("음성")
|
||||
.font(.custom(Font.medium.rawValue, size: 16.7))
|
||||
.foregroundColor(Color(hex: viewModel.currentTab == .voice ? "eeeeee" : "777777"))
|
||||
.frame(width: tabWidth, height: 50)
|
||||
|
||||
if viewModel.currentTab == .voice {
|
||||
Rectangle()
|
||||
.foregroundColor(Color(hex: "9970ff"))
|
||||
.frame(width: tabWidth, height: 3)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle()
|
||||
.frame(width: screenSize().width, height: 1)
|
||||
.foregroundColor(Color(hex: "909090"))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user