-
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.
- Loading branch information
Showing
42 changed files
with
842 additions
and
134 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
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
166 changes: 112 additions & 54 deletions
166
Projects/App/Sources/Application/NeedleGenerated.swift
Large diffs are not rendered by default.
Oops, something went wrong.
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
19 changes: 19 additions & 0 deletions
19
Projects/Features/ApplyFeature/Sources/ApplyPage/ApplyPageComponent.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,19 @@ | ||
import SwiftUI | ||
import StudyRoomFeature | ||
import RemainApplyFeature | ||
import NeedleFoundation | ||
|
||
public protocol ApplyPageDependency: Dependency { | ||
var studyRoomListComponent: StudyRoomListComponent { get } | ||
var remainApplyComponent: RemainApplyComponent { get } | ||
} | ||
|
||
public final class ApplyPageComponent: Component<ApplyPageDependency> { | ||
public func makeView() -> some View { | ||
ApplyPageView( | ||
viewModel: ApplyPageViewModel(), | ||
studyRoomListComponent: dependency.studyRoomListComponent, | ||
remainApplyComponent: dependency.remainApplyComponent | ||
) | ||
} | ||
} |
103 changes: 103 additions & 0 deletions
103
Projects/Features/ApplyFeature/Sources/ApplyPage/ApplyPageView.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,103 @@ | ||
import StudyRoomFeature | ||
import RemainApplyFeature | ||
import SwiftUI | ||
|
||
struct ApplyPageView: View { | ||
@AppStorage("StudyRoomState") var studyRoomState: String? | ||
@AppStorage("RemainState") var remainState: String? | ||
@StateObject var viewModel: ApplyPageViewModel | ||
@Environment(\.tabbarHidden) var tabbarHidden | ||
|
||
private let studyRoomListComponent: StudyRoomListComponent | ||
private let remainApplyComponent: RemainApplyComponent | ||
|
||
init( | ||
viewModel: ApplyPageViewModel, | ||
studyRoomListComponent: StudyRoomListComponent, | ||
remainApplyComponent: RemainApplyComponent | ||
) { | ||
_viewModel = StateObject(wrappedValue: viewModel) | ||
self.studyRoomListComponent = studyRoomListComponent | ||
self.remainApplyComponent = remainApplyComponent | ||
} | ||
|
||
var body: some View { | ||
NavigationView { | ||
VStack { | ||
Spacer() | ||
.frame(height: 1) | ||
|
||
ScrollView(showsIndicators: false) { | ||
VStack(spacing: 30) { | ||
Spacer() | ||
.frame(height: 5) | ||
|
||
applyListCellView( | ||
name: "자습실", | ||
content: """ | ||
자습실 사용이 필요한 경우, 자습실 신청을 통해서 원하는 자리를 신청해 보세요. | ||
""", | ||
buttonTitle: "자습실 신청하기", | ||
applyState: studyRoomState, | ||
onTapped: { | ||
viewModel.isNavigateToStudy.toggle() | ||
} | ||
) | ||
|
||
applyListCellView( | ||
name: "잔류", | ||
content: """ | ||
주말 기숙사 잔류 여부를 확인하고, 잔류 신청을 통해서 잔류 또는 귀가를 신청해 보세요. | ||
""", | ||
buttonTitle: "잔류 신청하기", | ||
applyState: remainState, | ||
onTapped: { | ||
viewModel.isNavigateToRemain.toggle() | ||
} | ||
) | ||
} | ||
.padding(.horizontal, 24) | ||
} | ||
} | ||
.navigationTitle("신청") | ||
.navigationBarTitleDisplayMode(.inline) | ||
.dmsBackground() | ||
.onChange(of: viewModel.isNavigateToStudy) { newValue in | ||
withAnimation { | ||
tabbarHidden.wrappedValue = newValue | ||
} | ||
} | ||
.onChange(of: viewModel.isNavigateToRemain) { newValue in | ||
withAnimation { | ||
tabbarHidden.wrappedValue = newValue | ||
} | ||
} | ||
.navigate( | ||
to: studyRoomListComponent.makeView(), | ||
when: $viewModel.isNavigateToStudy | ||
) | ||
.navigate( | ||
to: remainApplyComponent.makeView(), | ||
when: $viewModel.isNavigateToRemain | ||
) | ||
.navigationViewStyle(.stack) | ||
} | ||
} | ||
|
||
@ViewBuilder | ||
func applyListCellView( | ||
name: String, | ||
content: String, | ||
buttonTitle: String, | ||
applyState: String?, | ||
onTapped: @escaping () -> Void | ||
) -> some View { | ||
ApplyListCellView( | ||
name: name, | ||
content: content, | ||
buttonTitle: buttonTitle, | ||
applyState: applyState, | ||
onTapped: onTapped | ||
) | ||
} | ||
} |
7 changes: 7 additions & 0 deletions
7
Projects/Features/ApplyFeature/Sources/ApplyPage/ApplyPageViewModel.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,7 @@ | ||
import BaseFeature | ||
import Combine | ||
|
||
final class ApplyPageViewModel: BaseViewModel { | ||
@Published var isNavigateToStudy: Bool = false | ||
@Published var isNavigateToRemain: Bool = false | ||
} |
67 changes: 67 additions & 0 deletions
67
Projects/Features/ApplyFeature/Sources/ApplyPage/Component/ApplyListCellView.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,67 @@ | ||
import SwiftUI | ||
import StudyRoomFeature | ||
import RemainApplyFeature | ||
import DesignSystem | ||
|
||
struct ApplyListCellView: View { | ||
@AppStorage("StudyRoomState") var studyRoomState: String? | ||
@AppStorage("RemainState") var remainState: String? | ||
var name: String | ||
var content: String | ||
var buttonTitle: String | ||
var applyState: String? | ||
var onTapped: () -> Void | ||
|
||
init( | ||
name: String, | ||
content: String, | ||
buttonTitle: String, | ||
applyState: String?, | ||
onTapped: @escaping () -> Void | ||
) { | ||
self.name = name | ||
self.content = content | ||
self.buttonTitle = buttonTitle | ||
self.applyState = applyState | ||
self.onTapped = onTapped | ||
} | ||
|
||
var body: some View { | ||
VStack(alignment: .leading) { | ||
HStack(alignment: .center) { | ||
Text(name) | ||
.dmsFont(.title(.title2), color: .GrayScale.gray7) | ||
.frame(height: 32) | ||
.padding(.vertical, 20) | ||
.padding(.leading, 20) | ||
|
||
Spacer() | ||
|
||
Text(applyState ?? "") | ||
.dmsFont(.etc(.button), color: .PrimaryVariant.primary) | ||
.frame(height: 22) | ||
.padding(.vertical, 6) | ||
.padding(.horizontal, 14) | ||
.background(Color.PrimaryVariant.lighten2) | ||
.cornerRadius(24) | ||
.padding(.trailing, 16) | ||
.padding(.top, -2) | ||
} | ||
|
||
Text(content) | ||
.dmsFont(.body(.body3), color: .GrayScale.gray9) | ||
.multilineTextAlignment(.leading) | ||
.padding(.horizontal, 20) | ||
|
||
DMSWideButton( | ||
text: buttonTitle, | ||
color: .PrimaryVariant.primary, | ||
action: onTapped | ||
) | ||
.padding(20) | ||
} | ||
.background(Color.System.surface) | ||
.cornerRadius(10) | ||
.dmsShadow(style: .surface) | ||
} | ||
} |
66 changes: 0 additions & 66 deletions
66
Projects/Features/ApplyFeature/Sources/StudyroomApplication/StudyRoomListView.swift
This file was deleted.
Oops, something went wrong.
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
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
Oops, something went wrong.