Skip to content
Merged
2 changes: 0 additions & 2 deletions Projects/Feature/Home/Sources/Goal/AddGoalListView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ struct AddGoalListView: View {
.padding(.horizontal, 20)
categoryListView
}
.padding(.top, 28)
}
}

Expand Down Expand Up @@ -71,6 +70,5 @@ private extension AddGoalListView {
action: { action(item) }
)
)
.onTapGesture { action(item) }
}
}
4 changes: 4 additions & 0 deletions Projects/Feature/MakeGoal/Sources/MakeGoalReducer+Impl.swift
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,10 @@ extension MakeGoalReducer {

case .completeButtonTapped:
guard !state.isLoading else { return .none }
guard !state.completeButtonDisabled else {
return .send(.showToast(.warning(message: "목표 이름은 14글자 이내로 입력해 주세요!")))
}

state.isLoading = true
let endDateString: String? = state.isEndDateOn
? TXCalendarUtil.apiDateString(for: state.endDate)
Expand Down
36 changes: 20 additions & 16 deletions Projects/Feature/MakeGoal/Sources/MakeGoalView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public struct MakeGoalView: View {
}
}
)
.txToast(item: $store.toast)
.txToast(item: $store.toast, customPadding: 70)
}
}

Expand All @@ -100,25 +100,23 @@ private extension MakeGoalView {
var emojiCircle: some View {
store.selectedEmoji.image
.resizable()
.frame(width: 56, height: 56)
.padding(26)
.frame(width: 64, height: 64)
.padding(22)
.background(Color.Gray.gray50, in: .circle)
.insideBorder(
Color.Gray.gray500,
shape: .circle,
lineWidth: LineWidth.m
)
.onTapGesture { store.send(.emojiButtonTapped) }
.overlay(alignment: .bottomTrailing) {
TXCircleButton(
config: .init(
image: Image.Icon.Symbol.turn,
frameSize: .init(width: 28, height: 28),
imageSize: .init(width: 16, height: 16),
colorStyle: .white
),
action: {
store.send(.emojiButtonTapped)
}
), action: { }
)
.insideBorder(
Color.Gray.gray500,
Expand Down Expand Up @@ -195,7 +193,8 @@ private extension MakeGoalView {
valueText(store.startDateText)
dropDownButton { store.send(.startDateTapped) }
}
.padding(.vertical, 21.5)
.frame(height: 32)
.padding(.vertical, 16)
}

var endDateToggleRow: some View {
Expand All @@ -206,7 +205,8 @@ private extension MakeGoalView {

TXToggleSwitch(isOn: $store.isEndDateOn)
}
.padding(.vertical, 17)
.frame(height: 32)
.padding(.vertical, 16)
}

var endDateRow: some View {
Expand All @@ -230,13 +230,13 @@ private extension MakeGoalView {
) {
store.send(.completeButtonTapped)
}
.disabled(store.completeButtonDisabled)
}

var divider: some View {
Color.Gray.gray500
.frame(height: 1)
.padding(.horizontal, -16)
.padding(.vertical, -1)
}

func dropDownButton(_ action: @escaping () -> Void) -> some View {
Expand Down Expand Up @@ -268,20 +268,20 @@ private extension MakeGoalView {
TXRoundedRectangleButton(config: .long(text: "완료", colorStyle: .black)) {
store.send(.periodSheetCompleteTapped)
}
.padding(.top, 40)
.padding(.horizontal, 20)
.padding(.vertical, 8)
.padding(.top, 32)
.padding(.horizontal, 20)
}
.padding(.top, 36)
.padding(.bottom, 16)
.padding(.top, 8)
}

var periodTabButtons: some View {
HStack(spacing: 8) {
TXRoundedRectangleButton(
config: .small(
text: store.weeklyPeriodText,
colorStyle: store.selectedPeriod == .weekly ? .black : .white
colorStyle: store.selectedPeriod == .weekly ? .black : .white,
font: .b2_14r
)
) {
store.send(.periodSheetWeeklyTapped)
Expand Down Expand Up @@ -333,12 +333,16 @@ private extension MakeGoalView {
Text("\(store.periodCount)")
.typography(.h2_24r)
.foregroundStyle(Color.Gray.gray500)
.frame(width: 33)
.padding(.leading, 22)

Text("번")
.typography(.t2_16b)
.foregroundStyle(Color.Gray.gray300)
.padding(.trailing, 17)
}
.frame(width: 96, height: 58)
.padding(.vertical, 12)
.frame(width: 96)
.insideBorder(
Color.Gray.gray300,
shape: RoundedRectangle(cornerRadius: 12),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ private extension OnboardingConnectView {
.clipShape(RoundedRectangle(cornerRadius: Radius.s))
.padding(.horizontal, 30)
}
.padding(.top, 28)
.padding(.bottom, Spacing.spacing7)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,12 @@ import SwiftUI
public extension TXRoundedRectangleButton.Configuration {
static func small(
text: String,
colorStyle: ColorStyle
colorStyle: ColorStyle,
font: TypographyToken = .b1_14b
) -> Self {
.init(
text: text,
font: .b1_14b,
font: font,
colorStyle: colorStyle,
fixedFrame: false,
radius: Radius.xs,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,6 @@ public struct TXCalendarBottomSheet<ButtonContent: View>: View {
}
}
}
.padding(.top, Spacing.spacing10)
.padding(.bottom, 40)

// 버튼 영역
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ extension GoalEditCardView.Configuration {
rowContentSpacing: 28,
titleWidth: 48,
contentPadding: 16,
cardCornerRadius: 16,
cardCornerRadius: 12,
contentBackgroundColor: Color.Gray.gray50,
borderColor: Color.Gray.gray500,
borderWidth: LineWidth.m,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,11 @@ public struct GoalEditCardView: View {
CardHeaderView(
config: config.headerConfig
)

Color.Gray.gray500
.frame(height: 1)
.frame(maxWidth: .infinity)
.insideRectEdgeBorder(
width: LineWidth.m,
edges: [.bottom],
color: Color.Gray.gray500
)

VStack(alignment: .leading, spacing: config.rowSpacing) {
rowView(title: "반복 주기", value: config.item.repeatCycle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,8 @@ extension CardHeaderView.Configuration {
radius: Radius.s,
borderColor: Color.Gray.gray500,
borderWidth: LineWidth.m,
titleTypography: .t2_16b
titleTypography: .t2_16b,
onHeaderTapped: action
)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -78,14 +78,14 @@ private extension CardHeaderView {
.typography(config.titleTypography)
}
.frame(maxWidth: .infinity, alignment: .leading)
.onTapGesture {
config.onHeaderTapped?()
}


rightContent
}
.padding(config.padding)
.background(Color.Common.white)
.onTapGesture {
config.onHeaderTapped?()
}
.insideRectEdgeBorder(
width: config.borderWidth,
edges: config.insideBorderEdges,
Expand All @@ -103,11 +103,12 @@ private extension CardHeaderView {
action: action
)

case let .goalAdd(action):
TXCircleButton(config: .rightArrow()) {
action()
}

case .goalAdd:
TXCircleButton(
config: .rightArrow(),
action: { config.onHeaderTapped?() }
)

case let .goalEdit(action):
Button(action: action) {
Image.Icon.Symbol.meatball
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,10 @@ public struct TXDropdown: View {
Button {
onSelect(item)
} label: {
dropdownItem(item)
}

if index != config.items.indices.last {
Rectangle()
.frame(height: config.borderWidth)
.foregroundStyle(config.dividerColor)
dropdownItem(
item,
showsBottomDivider: index != config.items.indices.last
)
}
}
}
Expand All @@ -101,12 +98,20 @@ public struct TXDropdown: View {

// MARK: - SubViews
private extension TXDropdown {
func dropdownItem(_ item: TXDropdownItem) -> some View {
func dropdownItem(
_ item: TXDropdownItem,
showsBottomDivider: Bool
) -> some View {
Text(item.title)
.typography(config.textTypography)
.foregroundStyle(config.textColor)
.frame(maxWidth: .infinity, maxHeight: config.itemHeight, alignment: .leading)
.padding(.leading, config.leadingPadding)
.insideRectEdgeBorder(
width: config.borderWidth,
edges: showsBottomDivider ? [.bottom] : [],
color: config.dividerColor
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ public struct TXGridButtonModalContent: View {
VStack(spacing: 0) {
Text(config.title)
.typography(.t1_18eb)
.padding(.top, Spacing.spacing9)
.padding(.top, Spacing.spacing10)

LazyVGrid(
columns: Array(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ private extension TXModalView {
onAction(.confirm)
}
)
.padding(.vertical, Spacing.spacing5)
.padding(.top, Spacing.spacing6)

case let .gridButton(config):
TXRoundedRectangleButton(
Expand All @@ -92,11 +92,10 @@ private extension TXModalView {
) {
onAction(.confirm)
}
.padding(.horizontal, Spacing.spacing8)
.padding([.horizontal, .top], Spacing.spacing8)
.padding(.vertical, Spacing.spacing5)
}
}
.padding(.top, Spacing.spacing9)
.padding(.bottom, Spacing.spacing6)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,8 @@ private extension TXTabGroup {
text: item,
colorStyle: selectedItem == item
? config.selectedColorStyle
: config.unselectedColorStyle
: config.unselectedColorStyle,
font: .b2_14r
)
) {
selectedItem = item
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,14 @@ public struct TXTextField: View {
}

public var body: some View {
VStack(alignment: .leading, spacing: subText != nil ? Spacing.spacing5 : 0) {
container

if let subText {
subTextView(config: subText)
container
.overlay(alignment: .topLeading) {
if let subText, isFocused?.wrappedValue == true {
subTextView(config: subText)
.padding(.top, 52 + Spacing.spacing5)
.allowsHitTesting(false)
}
}
}
}
}

Expand All @@ -87,7 +88,7 @@ private extension TXTextField {

Spacer()

if !text.isEmpty {
if !text.isEmpty && isFocused?.wrappedValue == true {
clearButton
}
}
Expand All @@ -108,11 +109,13 @@ private extension TXTextField {

if let isFocused {
TextField("", text: $text)
.typography(.t2_16b)
.focused(isFocused)
.submitLabel(submitLabel)
.tint(tintColor)
} else {
TextField("", text: $text)
.typography(.t2_16b)
.submitLabel(submitLabel)
.tint(tintColor)
}
Expand Down
Loading
Loading