Skip to content

Commit

Permalink
Merge pull request #392 from School-of-Company/391-modify-input-schoo…
Browse files Browse the repository at this point in the history
…l-design

🔀 :: [#391] 학교 정보 입력 페이지 퍼블리싱
  • Loading branch information
uuuunseo authored Aug 8, 2024
2 parents db0d95a + 4f34bbd commit da814a7
Show file tree
Hide file tree
Showing 37 changed files with 615 additions and 43 deletions.
4 changes: 4 additions & 0 deletions App/Sources/Application/DI/AppComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -194,4 +194,8 @@ public extension AppComponent {
var inputUniversityFactory: any InputUniversityFactory {
InputUniversityComponent(parent: self)
}

var inputSchoolFactory: any InputSchoolFactory {
InputSchoolComponent(parent: self)
}
}
22 changes: 22 additions & 0 deletions App/Sources/Application/NeedleGenerated.swift
Original file line number Diff line number Diff line change
Expand Up @@ -535,6 +535,17 @@ private class WithdrawUserListDependencyc576fefb2eff9e703c66Provider: WithdrawUs
private func factory4d07a7e30330c03d5d63f47b58f8f304c97af4d5(_ component: NeedleFoundation.Scope) -> AnyObject {
return WithdrawUserListDependencyc576fefb2eff9e703c66Provider(appComponent: parent1(component) as! AppComponent)
}
private class InputSchoolDependencye8d4bffe76e2533005e2Provider: InputSchoolDependency {


init() {

}
}
/// ^->AppComponent->InputSchoolComponent
private func factorya02470c933733e398aeee3b0c44298fc1c149afb(_ component: NeedleFoundation.Scope) -> AnyObject {
return InputSchoolDependencye8d4bffe76e2533005e2Provider()
}
private class FindPasswordDependency542eacce769b9dc25904Provider: FindPasswordDependency {
var sendEmailCertificationLinkUseCase: any SendEmailCertificationLinkUseCase {
return appComponent.sendEmailCertificationLinkUseCase
Expand Down Expand Up @@ -723,6 +734,9 @@ private class SchoolListDependency96b276c3342c1aca3550Provider: SchoolListDepend
var fetchSchoolListUseCase: any FetchSchoolListUseCase {
return appComponent.fetchSchoolListUseCase
}
var inputSchoolFactory: any InputSchoolFactory {
return appComponent.inputSchoolFactory
}
private let appComponent: AppComponent
init(appComponent: AppComponent) {
self.appComponent = appComponent
Expand Down Expand Up @@ -1149,6 +1163,11 @@ extension WithdrawUserListComponent: Registration {
keyPathToName[\WithdrawUserListDependency.withdrawUserUseCase] = "withdrawUserUseCase-any WithdrawUserUseCase"
}
}
extension InputSchoolComponent: Registration {
public func registerItems() {

}
}
extension FindPasswordComponent: Registration {
public func registerItems() {
keyPathToName[\FindPasswordDependency.sendEmailCertificationLinkUseCase] = "sendEmailCertificationLinkUseCase-any SendEmailCertificationLinkUseCase"
Expand Down Expand Up @@ -1220,6 +1239,7 @@ extension InquiryListComponent: Registration {
extension SchoolListComponent: Registration {
public func registerItems() {
keyPathToName[\SchoolListDependency.fetchSchoolListUseCase] = "fetchSchoolListUseCase-any FetchSchoolListUseCase"
keyPathToName[\SchoolListDependency.inputSchoolFactory] = "inputSchoolFactory-any InputSchoolFactory"
}
}
extension ActivityListComponent: Registration {
Expand Down Expand Up @@ -1444,6 +1464,7 @@ extension AppComponent: Registration {
localTable["universityListFactory-any UniversityListFactory"] = { [unowned self] in self.universityListFactory as Any }
localTable["inputOrganizationFactory-any InputOrganizationFactory"] = { [unowned self] in self.inputOrganizationFactory as Any }
localTable["inputUniversityFactory-any InputUniversityFactory"] = { [unowned self] in self.inputUniversityFactory as Any }
localTable["inputSchoolFactory-any InputSchoolFactory"] = { [unowned self] in self.inputSchoolFactory as Any }
localTable["remoteWithdrawDataSource-any RemoteWithdrawDataSource"] = { [unowned self] in self.remoteWithdrawDataSource as Any }
localTable["withdrawRepository-any WithdrawRepository"] = { [unowned self] in self.withdrawRepository as Any }
localTable["fetchWithdrawUserListUseCase-any FetchWithdrawUserListUseCase"] = { [unowned self] in self.fetchWithdrawUserListUseCase as Any }
Expand Down Expand Up @@ -1510,6 +1531,7 @@ private func registerProviderFactory(_ componentPath: String, _ factory: @escapi
registerProviderFactory("^->AppComponent->ClubDetailComponent", factory1559652f8e80cfa88d06f47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->SuccessSignUpComponent", factorybf219b153b668170161de3b0c44298fc1c149afb)
registerProviderFactory("^->AppComponent->WithdrawUserListComponent", factory4d07a7e30330c03d5d63f47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->InputSchoolComponent", factorya02470c933733e398aeee3b0c44298fc1c149afb)
registerProviderFactory("^->AppComponent->FindPasswordComponent", factory15775d8436b06b9741d1f47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->LectureApplicantListComponent", factory78a87c10d14f7bbaaa9df47b58f8f304c97af4d5)
registerProviderFactory("^->AppComponent->UserListComponent", factorycf08383b935d2e18f4c7f47b58f8f304c97af4d5)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import SwiftUI

public protocol InputSchoolFactory {
associatedtype SomeView: View
func makeView(
state: String,
schoolInfo: SchoolDetailInfoModel
) -> SomeView
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
import SwiftUI

struct ClubFormView: View {
let clubList: [ClubDetailModel]
let editAction: (Int) -> Void
let addClubAction: () -> Void

var body: some View {
VStack(alignment: .leading, spacing: 16) {
BitgouelText(
text: "동아리 목록",
font: .title3
)

ScrollView {
LazyVStack(alignment: .leading, spacing: 16) {
ForEach(clubList, id: \.clubID) { club in
clubListRow(
clubID: club.clubID,
club: club.name
)
}

Button {
addClubAction()
} label: {
HStack {
Text("동아리 추가")

Spacer()

BitgouelAsset.Icons.add.swiftUIImage
.renderingMode(.template)
}
.padding(.horizontal, 20)
.padding(.vertical, 16)
.foregroundColor(.bitgouel(.greyscale(.g10)))
.background(Color.bitgouel(.primary(.p5)))
.cornerRadius(8, corners: .allCorners)
}
}
}
}
}

@ViewBuilder
func clubListRow(
clubID: Int,
club: String
) -> some View {
HStack {
HStack {
BitgouelText(
text: club,
font: .text3
)
.padding(.horizontal, 20)
.padding(.vertical, 16)

Spacer()
}
.overlay {
RoundedRectangle(cornerRadius: 8)
.stroke(Color.bitgouel(.greyscale(.g7)))
}

Spacer()

Button {
editAction(clubID)
} label: {
BitgouelAsset.Icons.penFill.swiftUIImage
.resizable()
.renderingMode(.template)
.foregroundColor(Color.bitgouel(.primary(.p5)))
.frame(width: 24, height: 24)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import SwiftUI

struct InputDepartmentRow: View {
@Binding var text: String
let deleteAction: () -> Void

var body: some View {
HStack(alignment: .center) {
BitgouelTextField(
"학과명 입력",
text: $text
)

Button {
deleteAction()
} label: {
BitgouelAsset.Icons.minusFill.swiftUIImage
.resizable()
.renderingMode(.template)
.foregroundColor(Color.bitgouel(.error(.e5)))
.frame(width: 24, height: 24)
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
import SwiftUI
import Service

public struct SchoolLineBottomSheet: View {
let selectedLine: LineType?
let lineList: [LineType] = LineType.allCases
let cancel: (Bool) -> Void
let selectLine: (LineType) -> Void

public var body: some View {
VStack(alignment: .leading, spacing: 16) {
HStack {
BitgouelText(
text: "계열",
font: .title3
)

Spacer()

Button {
cancel(false)
} label: {
BitgouelAsset.Icons.cancel.swiftUIImage
.resizable()
.renderingMode(.template)
.foregroundColor(Color.bitgouel(.greyscale(.g4)))
.frame(width: 24, height: 24)
}
}

ScrollView {
LazyVStack(alignment: .leading, spacing: 0) {
ForEach(lineList, id: \.self) { line in
HStack {
BitgouelText(
text: line.display(),
font: .text2
)

Spacer()

BitgouelRadioButton(
isSelected: Binding(
get: { line == selectedLine },
set: { _ in selectLine(line) }
)
)
}
.padding(.vertical, 24)
}
}
}
}
.padding(.horizontal, 28)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import NeedleFoundation
import SwiftUI

public protocol InputSchoolDependency: Dependency {}

public final class InputSchoolComponent: Component<InputSchoolDependency>, InputSchoolFactory {
public func makeView(state: String, schoolInfo: SchoolDetailInfoModel) -> some View {
InputSchoolView(
viewModel: .init(
state: state,
schoolInfo: schoolInfo
)
)
}
}
Loading

0 comments on commit da814a7

Please sign in to comment.