sodalive-ios/SodaLive/Sources/Live/Room/V2/Component/Button/LiveRoomOverlayStrokeTextBu...

46 lines
1.1 KiB
Swift

//
// LiveRoomOverlayStrokeTextButton.swift
// SodaLive
//
// Created by klaus on 2024/01/17.
//
import SwiftUI
struct LiveRoomOverlayStrokeTextButton: View {
let text: String
let textColor: Color
let strokeColor: Color
let strokeWidth: CGFloat
let strokeCornerRadius: CGFloat
let onClick: () -> Void
var body: some View {
Text(text)
.font(.custom(Font.medium.rawValue, size: 12))
.foregroundColor(textColor)
.padding(.horizontal, 8)
.padding(.vertical, 6)
.overlay(
RoundedRectangle(cornerRadius: strokeCornerRadius)
.stroke(strokeColor, lineWidth: strokeWidth)
)
.onTapGesture { onClick() }
}
}
struct LiveRoomOverlayStrokeTextButton_Previews: PreviewProvider {
static var previews: some View {
LiveRoomOverlayStrokeTextButton(
text: "라이브 종료",
textColor: Color.mainRed,
strokeColor: Color.mainRed,
strokeWidth: 1,
strokeCornerRadius: 5.3,
onClick: {}
)
}
}