From 3f1c2891b5b71551dcb400063ea6d0e304649d91 Mon Sep 17 00:00:00 2001 From: kms0233 Date: Thu, 16 Jan 2025 03:53:05 +0900 Subject: [PATCH] =?UTF-8?q?[Feat/#29]=20TimeBox=20=EC=BB=B4=ED=8F=AC?= =?UTF-8?q?=EB=84=8C=ED=8A=B8=20=EA=B5=AC=ED=98=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Global/Component/Box/TimeBox.swift | 56 +++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 Gongbaek_iOS/Gongbaek_iOS/Global/Component/Box/TimeBox.swift diff --git a/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Box/TimeBox.swift b/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Box/TimeBox.swift new file mode 100644 index 00000000..f75ec8ff --- /dev/null +++ b/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Box/TimeBox.swift @@ -0,0 +1,56 @@ +// +// TimeBox.swift +// Gongbaek_iOS +// +// Created by 김민서 on 1/16/25. +// + +import SwiftUI + +enum InfoColorState { + case gray + case white +} + +struct TimeBox: View { + let state: InfoColorState + let text: String + let font: Font + + var body: some View { + HStack(alignment: .center, spacing: 4) { + Image(.icTime16) + .resizable() + .frame(width: 16, height: 16) + .foregroundColor(iconColor) + + Text(text) + .font(font) + .foregroundColor(textColor) + } + } + + private var iconColor: Color { + switch state { + case .gray: + return .gray05 + case .white: + return .grayWhite + } + } + + private var textColor: Color { + switch state { + case .gray: + return .gray06 + case .white: + return .grayWhite + } + } + +} + + +#Preview { + TimeBox(state: .gray, text: "몇시일까용?", font: .pretendard(.caption2_r_12)) +}