Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feat] #39 - BasicButton 활용 Bar 생성 완료. #41

Merged
merged 7 commits into from
Jan 16, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 11 additions & 18 deletions Gongbaek_iOS/Gongbaek_iOS/Global/Component/Bar/ApplyBar.swift
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

누가 엘렐레 하래

}
.padding(.vertical, 20)
.padding(.horizontal, 16)
Expand All @@ -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
)
)
}
Original file line number Diff line number Diff line change
@@ -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)
}
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down