generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #392 from School-of-Company/391-modify-input-schoo…
…l-design 🔀 :: [#391] 학교 정보 입력 페이지 퍼블리싱
- Loading branch information
Showing
37 changed files
with
615 additions
and
43 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
9 changes: 9 additions & 0 deletions
9
App/Sources/Feature/InputSchoolFeature/Interface/InputSchoolFactory.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
} |
80 changes: 80 additions & 0 deletions
80
App/Sources/Feature/InputSchoolFeature/Source/Component/ClubFormView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} | ||
} |
25 changes: 25 additions & 0 deletions
25
App/Sources/Feature/InputSchoolFeature/Source/Component/InputDepartmentRow.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} | ||
} | ||
} |
56 changes: 56 additions & 0 deletions
56
App/Sources/Feature/InputSchoolFeature/Source/Component/SchoolLineBottomSheet.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) | ||
} | ||
} |
15 changes: 15 additions & 0 deletions
15
App/Sources/Feature/InputSchoolFeature/Source/InputSchoolComponent.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
) | ||
) | ||
} | ||
} |
Oops, something went wrong.