diff --git a/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Bar/ApplyBar.swift b/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Bar/ApplyBar.swift index 06027370..31edb97d 100644 --- a/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Bar/ApplyBar.swift +++ b/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Bar/ApplyBar.swift @@ -11,10 +11,10 @@ import SwiftUI struct Apply { var isActivated: Bool - var onTap: (() -> Void)? var currentPeopleCount: Int var maxPeopleCount: Int var buttonText: String + var onTap: (() -> Void)? } struct ApplyBar: View { @@ -31,22 +31,7 @@ struct ApplyBar: View { .fill(apply.isActivated ? .gray09 : .gray04) ) - Button(action: { - print("applyButtonIsTapped") - }) { - - // MARK: TODO - Component 대체 예정 - - Text(apply.buttonText) - .pretendardFont(.title2_sb_18) - .padding(.vertical, 16) - .frame(maxWidth: .infinity) - .foregroundStyle(.grayWhite) - .background( - RoundedRectangle(cornerRadius: 6) - .fill(apply.isActivated ? .mainOrange : .gray03) - ) - } + BasicButton(text: "엘렐레", isActivated: apply.isActivated, onTap: apply.onTap) } .padding(.vertical, 20) .padding(.horizontal, 16) @@ -55,5 +40,13 @@ struct ApplyBar: View { } #Preview { - ApplyBar(apply: Apply(isActivated: true, onTap: nil, currentPeopleCount: 3, maxPeopleCount: 4, buttonText: "엘렐레")) + ApplyBar( + apply: Apply( + isActivated: true, + currentPeopleCount: 3, + maxPeopleCount: 4, + buttonText: "엘렐레", + onTap: nil + ) + ) } diff --git a/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Bar/OnboardingConfirmBar.swift b/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Bar/OnboardingConfirmBar.swift new file mode 100644 index 00000000..c04c10a8 --- /dev/null +++ b/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Bar/OnboardingConfirmBar.swift @@ -0,0 +1,41 @@ +// +// OnboardingConfirmBar.swift +// Gongbaek_iOS +// +// Created by 김희은 on 1/16/25. +// + +import SwiftUI + +struct OnboardingConfirmBar: View { + let grayButtonText: String + let orangeButtonText: String + var onTap: (() -> Void)? + + var body: some View { + HStack(spacing: 16) { + Button(action: { + onTap?() + }) { + Text(grayButtonText) + .pretendardFont(.title2_sb_18) + .padding(.vertical, 16) + .padding(.horizontal, 17) + .foregroundStyle(.grayWhite) + .background( + RoundedRectangle(cornerRadius: 6) + .fill(.gray09) + ) + } + + BasicButton(text: orangeButtonText, onTap: onTap) + } + .padding(.vertical, 20) + .padding(.horizontal, 16) + .background(.grayWhite) + } +} + +#Preview { + OnboardingConfirmBar(grayButtonText: "시간표 변경", orangeButtonText: "가입 완료", onTap: nil) +} diff --git a/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Button/BasicButton.swift b/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Button/BasicButton.swift index a8b52462..725d4bd2 100644 --- a/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Button/BasicButton.swift +++ b/Gongbaek_iOS/Gongbaek_iOS/Global/Component/Button/BasicButton.swift @@ -9,7 +9,7 @@ import SwiftUI struct BasicButton: View { let text: String - var isActivated: Bool + var isActivated: Bool = true var onTap: (() -> Void)? var body: some View {