Skip to content

Commit

Permalink
[Feat/#29] TimeBox 컴포넌트 구현
Browse files Browse the repository at this point in the history
  • Loading branch information
kms0233 committed Jan 15, 2025
1 parent 9f08535 commit 3f1c289
Showing 1 changed file with 56 additions and 0 deletions.
56 changes: 56 additions & 0 deletions Gongbaek_iOS/Gongbaek_iOS/Global/Component/Box/TimeBox.swift
Original file line number Diff line number Diff line change
@@ -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))
}

0 comments on commit 3f1c289

Please sign in to comment.