시리즈 상세 추가
This commit is contained in:
42
SodaLive/Sources/UI/Component/SeriesDetailTabView.swift
Normal file
42
SodaLive/Sources/UI/Component/SeriesDetailTabView.swift
Normal file
@@ -0,0 +1,42 @@
|
||||
//
|
||||
// SeriesDetailTabView.swift
|
||||
// SodaLive
|
||||
//
|
||||
// Created by klaus on 4/30/24.
|
||||
//
|
||||
|
||||
import SwiftUI
|
||||
|
||||
struct SeriesDetailTabView: View {
|
||||
|
||||
let title: String
|
||||
let width: CGFloat
|
||||
let isSelected: Bool
|
||||
let onClick: () -> Void
|
||||
|
||||
var body: some View {
|
||||
VStack(spacing: 0) {
|
||||
Text(title)
|
||||
.font(.custom(isSelected ? Font.bold.rawValue : Font.medium.rawValue, size: 16.7))
|
||||
.foregroundColor(isSelected ? Color.button : Color.gray77)
|
||||
.frame(width: width, height: 50)
|
||||
|
||||
if isSelected {
|
||||
Rectangle()
|
||||
.foregroundColor(Color.button)
|
||||
.frame(width: width, height: 3)
|
||||
}
|
||||
}
|
||||
.contentShape(Rectangle())
|
||||
.onTapGesture { onClick() }
|
||||
}
|
||||
}
|
||||
|
||||
#Preview {
|
||||
SeriesDetailTabView(
|
||||
title: "홈",
|
||||
width: 180,
|
||||
isSelected: true,
|
||||
onClick: {}
|
||||
)
|
||||
}
|
Reference in New Issue
Block a user