Skip to content

Commit 64a5a93

Browse files
authored
Merge pull request #60 from YAPP-Github/TNT-214-trainerAddSessionSecond
[TNT-214] ํŠธ๋ ˆ์ด๋„ˆ PT ์ผ์ • ์ถ”๊ฐ€ ํ™”๋ฉด ์ž‘์„ฑ
2 parents c8a8668 + d8496e5 commit 64a5a93

File tree

10 files changed

+954
-19
lines changed

10 files changed

+954
-19
lines changed

โ€ŽTnT/Projects/DesignSystem/Sources/Components/TextField/TTextEditor.swiftโ€Ž

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,8 @@ public extension TTextEditor {
113113
private let textLimit: Int
114114
/// ์ž…๋ ฅ๋œ ํ…์ŠคํŠธ ์นด์šดํŠธ
115115
private var textCount: Int
116+
/// ๊ฒฝ๊ณ  ํ…์ŠคํŠธ
117+
private var warningText: String
116118
/// ํ…์ŠคํŠธ ํ•„๋“œ ์ƒํƒœ
117119
@Binding private var status: Status
118120

@@ -124,17 +126,19 @@ public extension TTextEditor {
124126
public init(
125127
textLimit: Int,
126128
status: Binding<Status>,
127-
textCount: Int
129+
textCount: Int,
130+
warningText: String = "๊ธ€์ž ์ˆ˜๋ฅผ ์ดˆ๊ณผํ–ˆ์–ด์š”"
128131
) {
129132
self.textLimit = textLimit
130133
self.textCount = textCount
131134
self._status = status
135+
self.warningText = warningText
132136
}
133137

134138
public var body: some View {
135139
HStack {
136140
if status == .invalid {
137-
Text("๊ธ€์ž ์ˆ˜๋ฅผ ์ดˆ๊ณผํ–ˆ์–ด์š”")
141+
Text(warningText)
138142
.typographyStyle(.label2Medium, with: status.footerColor)
139143
}
140144
Spacer()

โ€ŽTnT/Projects/DesignSystem/Sources/Components/TextField/TTextField.swiftโ€Ž

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ public extension TTextField.RightView {
7474
enum Style {
7575
case unit(text: String, status: TTextField.Status)
7676
case button(title: String, state: TButton.ButtonState, tapAction: () -> Void)
77+
case dropDown(tintColor: Color, tapAction: () -> Void)
7778
}
7879
}
7980

@@ -97,14 +98,22 @@ public extension TTextField {
9798
.padding(.vertical, 3)
9899

99100
case let .button(title, state, tapAction):
100-
// TODO: ์ถ”ํ›„ ๋ฒ„ํŠผ ์ปดํฌ๋„ŒํŠธ ๋‚˜์˜ค๋ฉด ๋Œ€์ฒด
101101
TButton(
102102
title: title,
103103
config: .small,
104104
state: state,
105105
action: tapAction
106106
)
107107
.frame(width: 66)
108+
109+
case let .dropDown(tintColor, tapAction):
110+
Button(action: tapAction) {
111+
Image(.icnArrowDown)
112+
.renderingMode(.template)
113+
.resizable()
114+
.tint(tintColor)
115+
.frame(width: 32, height: 32)
116+
}
108117
}
109118
}
110119
}

โ€ŽTnT/Projects/DesignSystem/Sources/Components/TimePicker/TTimePicker.swiftโ€Ž

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,6 @@ public struct TTimePicker: View {
127127

128128
private func updateDate() {
129129
var calendar: Calendar = Calendar.current
130-
calendar.timeZone = TimeZone(secondsFromGMT: 0) ?? .current // UTC๋กœ ์„ค์ •
131130
var components: DateComponents = calendar.dateComponents([.year, .month, .day, .hour, .minute], from: date)
132131

133132
// 24์‹œ๊ฐ„๋Œ€๋กœ ์‹œ๊ฐ„ ํฌ๋งท ์„ค์ •
Lines changed: 77 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,77 @@
1+
//
2+
// TTimePickerView.swift
3+
// DesignSystem
4+
//
5+
// Created by ๋ฐ•๋ฏผ์„œ on 2/7/25.
6+
// Copyright ยฉ 2025 yapp25thTeamTnT. All rights reserved.
7+
//
8+
9+
import SwiftUI
10+
11+
/// - ์‹œ๊ฐ„ ์„ ํƒํ•  ์ˆ˜ ์žˆ๋Š” TimePicker View
12+
public struct TTimePickerView: View {
13+
14+
/// picker ์ œ๋ชฉ
15+
private let title: String
16+
/// ๋ฒ„ํŠผ ์‹คํ–‰ action
17+
private let buttonAction: (Date) -> Void
18+
/// TimePicker ๋ถ„๋‹จ์œ„
19+
private let minuteStep: Int
20+
/// ์„ ํƒ ์‹œ๊ฐ„
21+
@State private var selectedTime: Date = .now
22+
23+
@Environment(\.dismiss) var dismiss
24+
25+
/// `TTimePickerView` ์ƒ์„ฑ์ž
26+
/// - Parameters:
27+
/// - selectedTime: ์ดˆ๊ธฐ ์„ ํƒ ์‹œ๊ฐ„ (๊ธฐ๋ณธ๊ฐ’: ํ˜„์žฌ ์‹œ๊ฐ„)
28+
/// - title: TimePicker์˜ ์ œ๋ชฉ
29+
/// - buttonAction: ์‹œ๊ฐ„ ์„ ํƒ ํ›„ ์‹คํ–‰ํ•  ์•ก์…˜
30+
public init(
31+
selectedTime: Date = .now,
32+
title: String,
33+
minuteStep: Int = 1,
34+
buttonAction: @escaping (Date) -> Void
35+
) {
36+
self.selectedTime = selectedTime
37+
self.title = title
38+
self.minuteStep = minuteStep
39+
self.buttonAction = buttonAction
40+
}
41+
42+
public var body: some View {
43+
VStack(spacing: 24) {
44+
HStack {
45+
Text(title)
46+
.typographyStyle(.heading3, with: .neutral900)
47+
Spacer()
48+
Button(action: {
49+
dismiss()
50+
}, label: {
51+
Image(.icnDelete)
52+
.renderingMode(.template)
53+
.resizable()
54+
.tint(.neutral400)
55+
.frame(width: 32, height: 32)
56+
})
57+
}
58+
.padding(20)
59+
60+
TTimePicker(
61+
selectedDate: $selectedTime,
62+
minuteStep: minuteStep
63+
)
64+
.padding(.horizontal, 20)
65+
66+
TButton(
67+
title: "ํ™•์ธ",
68+
config: .large,
69+
state: .default(.primary(isEnabled: true)),
70+
action: {
71+
buttonAction(selectedTime)
72+
}
73+
)
74+
.padding(20)
75+
}
76+
}
77+
}
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
//
2+
// TraineeListItemEntity.swift
3+
// Domain
4+
//
5+
// Created by ๋ฐ•๋ฏผ์„œ on 2/6/25.
6+
// Copyright ยฉ 2025 yapp25thTeamTnT. All rights reserved.
7+
//
8+
9+
import Foundation
10+
11+
/// ํšŒ์› ๋ชฉ๋ก ์•„์ดํ…œ ๋ชจ๋ธ
12+
public struct TraineeListItemEntity: Equatable, Sendable {
13+
/// ํšŒ์› Id
14+
public let id: Int
15+
/// ํšŒ์› ์ด๋ฆ„
16+
public let name: String
17+
18+
public init(
19+
id: Int,
20+
name: String
21+
) {
22+
self.id = id
23+
self.name = name
24+
}
25+
}

โ€ŽTnT/Projects/Domain/Sources/Policy/TDateFormat.swiftโ€Ž

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,6 @@ public enum TDateFormat: String {
3232
case EE = "EE"
3333
/// "์˜คํ›„ 17:00" (์‹œ๊ฐ„ ํฌ๋งท)
3434
case a_HHmm = "a HH:mm"
35+
/// "17:00"
36+
case HHmm = "HH:mm"
3537
}

0 commit comments

Comments
ย (0)