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

잔류 신청 페이지 UI 퍼블리싱 #167

Merged
merged 42 commits into from
Feb 27, 2023
Merged
Show file tree
Hide file tree
Changes from 23 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
bd71dc9
feat :: 새로운 Feature 생성 및 graph 변경
DSMInhyeKang Feb 15, 2023
0b55638
feat :: ApplyFeature 파일 StudyRoomFeature로 이동
DSMInhyeKang Feb 16, 2023
8f1249c
feat :: 자습실 기능 StudyRoomFeature로 이전
DSMInhyeKang Feb 16, 2023
4591a63
feat :: 신청 메인 화면 UI 퍼블리싱
DSMInhyeKang Feb 16, 2023
827df2d
feat :: 신청 메인 화면 UI 퍼블리싱
DSMInhyeKang Feb 17, 2023
9a1ba79
feat :: 네비게이션 기능 구현
DSMInhyeKang Feb 17, 2023
98c67de
refactor :: NavigationView 중첩 코드 리팩토링
DSMInhyeKang Feb 17, 2023
2242a2d
fix :: 네비게이션 백버튼 중첩 버그 수정
DSMInhyeKang Feb 17, 2023
53a3d4c
fix :: 네비게이션 바 수정
DSMInhyeKang Feb 17, 2023
eca1558
refactor :: ApplyView 코드 리팩토링
DSMInhyeKang Feb 19, 2023
bbf797a
feat :: 잔류 신청 페이지 UI 퍼블리싱
DSMInhyeKang Feb 21, 2023
fa4e5b9
refactor :: UI 코드 리팩토링
DSMInhyeKang Feb 21, 2023
d64f5f1
feat :: 잔류 신청 페이지 UI 퍼블리싱
DSMInhyeKang Feb 23, 2023
7555e75
refactor :: swiftlint 수정
DSMInhyeKang Feb 23, 2023
343ba07
refactor :: UI 오류 수정
DSMInhyeKang Feb 23, 2023
1687669
feat :: 항목 디테일 화살표 버튼 수정
DSMInhyeKang Feb 23, 2023
aafbf8b
feat :: UI 코드 리팩토링
DSMInhyeKang Feb 23, 2023
d8a319d
refactor :: 옵셔널 삭제
DSMInhyeKang Feb 23, 2023
349d717
refactor :: UI 코드 리팩토링
DSMInhyeKang Feb 23, 2023
09f94c0
refactor :: 파일 이름 변경
DSMInhyeKang Feb 24, 2023
ee52890
feat :: update graph
DSMInhyeKang Feb 24, 2023
9ddea59
style :: 스타일 가이드에 맞게 수정
DSMInhyeKang Feb 24, 2023
028afe0
refactor :: comment 반영
DSMInhyeKang Feb 24, 2023
dfd60e9
fix :: conflicts 해결
DSMInhyeKang Feb 24, 2023
422d0c9
refactor :: comment 반영
DSMInhyeKang Feb 24, 2023
21bdab3
feat :: 스크롤뷰, 네비게이션 바 변경
DSMInhyeKang Feb 24, 2023
f7d557a
fix :: conflicts 해결
DSMInhyeKang Feb 25, 2023
8fa4795
fix :: conflicts 해결
DSMInhyeKang Feb 25, 2023
d9e320f
fix :: conflicts 해결
DSMInhyeKang Feb 25, 2023
105e79e
fix :: 네비게이션 바 수정
DSMInhyeKang Feb 26, 2023
0a85378
fix :: conflicts 해결
DSMInhyeKang Feb 26, 2023
4047541
refactor :: comment 반영
DSMInhyeKang Feb 26, 2023
f6e55d3
refactor :: comment 반영
DSMInhyeKang Feb 26, 2023
845484a
refactor :: @EnvironmentObject 해제 및 @AppStorage 처리
DSMInhyeKang Feb 26, 2023
3829592
fix :: conflicts 해결
DSMInhyeKang Feb 26, 2023
ba60cd7
feat :: @EnvironmentObject 삭제
DSMInhyeKang Feb 26, 2023
e57a2ea
feat :: 신청 상태 저장
DSMInhyeKang Feb 26, 2023
e873214
refactor :: 코드 리팩토링
DSMInhyeKang Feb 27, 2023
a7fbd3c
refactor :: 코멘트 반영
DSMInhyeKang Feb 27, 2023
39e3fca
refactor :: 코멘트 반영
DSMInhyeKang Feb 27, 2023
304de04
refactor :: comment 반영
DSMInhyeKang Feb 27, 2023
b97871b
feat :: 에러 발생 시 state nil 처리
DSMInhyeKang Feb 27, 2023
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
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@ public extension TargetDependency {
}

public extension TargetDependency.Project.Features {
static let RemainApplyFeature = TargetDependency.feature(name: "RemainApplyFeature")
static let StudyRoomFeature = TargetDependency.feature(name: "StudyRoomFeature")
static let SplashFeature = TargetDependency.feature(name: "SplashFeature")
static let MyPageFeature = TargetDependency.feature(name: "MyPageFeature")
static let NoticeFeature = TargetDependency.feature(name: "NoticeFeature")
Expand Down
10 changes: 8 additions & 2 deletions Projects/App/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,14 @@ let isCI = (ProcessInfo.processInfo.environment["TUIST_CI"] ?? "0") == "1" ? tru
let settinges: Settings =
.settings(base: Environment.baseSetting,
configurations: [
.debug(name: .dev, xcconfig: isCI ? nil : .relativeToXCConfig(type: .dev, name: Environment.targetName)),
.release(name: .prod, xcconfig: isCI ? nil : .relativeToXCConfig(type: .prod, name: Environment.targetName))
.debug(name: .dev, xcconfig: isCI ? nil : .relativeToXCConfig(
type: .dev,
name: Environment.targetName)
),
.release(name: .prod, xcconfig: isCI ? nil : .relativeToXCConfig(
type: .prod,
name: Environment.targetName)
)
],
defaultSettings: .recommended)

Expand Down
8 changes: 8 additions & 0 deletions Projects/App/Sources/Application/DI/AppComponent.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ import RenewalPasswordFeature
import MainTabFeature
import HomeFeature
import ApplyFeature
import StudyRoomFeature
import RemainApplyFeature
import MyPageFeature
import NoticeFeature
import SplashFeature
Expand Down Expand Up @@ -112,4 +114,10 @@ public extension AppComponent {
var studyRoomListComponent: StudyRoomListComponent {
StudyRoomListComponent(parent: self)
}
var applyPageComponent: ApplyPageComponent {
ApplyPageComponent(parent: self)
}
var remainApplyComponent: RemainApplyComponent {
RemainApplyComponent(parent: self)
}
}
4 changes: 4 additions & 0 deletions Projects/App/Sources/Application/DMSApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ import FindIDFeature
import SigninFeature
import SignupFeature
import ApplyFeature
import StudyRoomFeature
import RemainApplyFeature

@main
struct DMSApp: App {
Expand All @@ -17,6 +19,8 @@ struct DMSApp: App {
WindowGroup {
AppComponent().makeRootView()
.environmentObject(appState)
.environmentObject(StudyRoomStateModel())
.environmentObject(RemainStateModel())
}
}
}
308 changes: 176 additions & 132 deletions Projects/App/Sources/Application/NeedleGenerated.swift

Large diffs are not rendered by default.

4 changes: 3 additions & 1 deletion Projects/Features/ApplyFeature/Project.swift
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ let project = Project.makeModule(
name: "ApplyFeature",
product: .staticFramework,
dependencies: [
.Project.Features.BaseFeature
.Project.Features.BaseFeature,
.Project.Features.StudyRoomFeature,
.Project.Features.RemainApplyFeature
]
)
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
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
import StudyRoomFeature
import RemainApplyFeature
import SwiftUI

struct ApplyPageView: View {
@StateObject var viewModel: ApplyPageViewModel
@EnvironmentObject var studyState: StudyRoomStateModel
@EnvironmentObject var remainState: RemainStateModel
@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(
viewModel: viewModel,
name: "자습실",
content: """
자습실 사용이 필요한 경우, 자습실 신청을 통해서 원하는 자리를 신청해 보세요.
""",
buttonTitle: "자습실 신청하기",
state: "2층 자습실")

applyListCellView(
viewModel: viewModel,
name: "잔류",
content: """
주말 기숙사 잔류 여부를 확인하고, 잔류 신청을 통해서 잔류 또는 귀가를 신청해 보세요.
""",
buttonTitle: "잔류 신청하기",
state: "금요 귀가")
}
.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
)
}
}

@ViewBuilder
func applyListCellView(
viewModel: ApplyPageViewModel,
name: String,
content: String,
buttonTitle: String,
state: String?) -> some View {
ApplyListCellView(
viewModel: viewModel,
name: name,
content: content,
buttonTitle: buttonTitle,
state: state ?? ""
)
}
}
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
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
import SwiftUI
import StudyRoomFeature
import RemainApplyFeature
import DesignSystem

struct ApplyListCellView: View {
@StateObject var viewModel: ApplyPageViewModel
@EnvironmentObject var studyState: StudyRoomStateModel
@EnvironmentObject var remainState: RemainStateModel
var name: String
var content: String
var buttonTitle: String
var state: String

var body: some View {
VStack(alignment: .leading) {
HStack {
Text(name)
.dmsFont(.title(.title2), color: .GrayScale.gray7)
.frame(height: 32)
.padding(.vertical, 20)
.padding(.leading, 20)

Spacer()

Text(name == "자습실" ? studyState.appliedState : remainState.appliedState)
.dmsFont(.etc(.button), color: .PrimaryVariant.primary)
.frame(height: 22)
.padding(.vertical, 6)
.padding(.horizontal, 14)
.background((studyState.appliedState.isEmpty && remainState.appliedState.isEmpty)
? .clear : Color.PrimaryVariant.lighten2)
.cornerRadius(24)
.padding(.trailing, 16)
.padding(.top, -2)
}
DSMInhyeKang marked this conversation as resolved.
Show resolved Hide resolved

Text(content)
.dmsFont(.body(.body3), color: .GrayScale.gray9)
.multilineTextAlignment(.leading)
.padding(.leading, 20)
.padding(.trailing, 29)
DSMInhyeKang marked this conversation as resolved.
Show resolved Hide resolved

DMSWideButton(
text: buttonTitle,
color: .PrimaryVariant.primary) {
if name == "자습실" {
viewModel.isNavigateToStudy.toggle()
} else {
viewModel.isNavigateToRemain.toggle()
}
}
.padding(20)
}
.environmentObject(studyState)
.environmentObject(remainState)
.background(Color.System.surface)
.cornerRadius(10)
.dmsShadow(style: .surface)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import MyPageFeature

public protocol MainTabDependency: Dependency {
var homeComponent: HomeComponent { get }
var studyRoomListComponent: StudyRoomListComponent { get }
var applyPageComponent: ApplyPageComponent { get }
var noticeListComponent: NoticeListComponent { get }
var myPageComponent: MyPageComponent { get }
}
Expand All @@ -16,7 +16,7 @@ public final class MainTabComponent: Component<MainTabDependency> {
public func makeView() -> some View {
MainTabView(
homeComponent: dependency.homeComponent,
studyRoomListComponent: dependency.studyRoomListComponent,
applyPageComponent: dependency.applyPageComponent,
noticeComponent: dependency.noticeListComponent,
myPageComponent: dependency.myPageComponent
)
Expand Down
8 changes: 4 additions & 4 deletions Projects/Features/MainTabFeature/Sources/MainTabView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -26,18 +26,18 @@ struct MainTabView: View {
}

private let homeComponent: HomeComponent
private let studyRoomListComponent: StudyRoomListComponent
private let applyPageComponent: ApplyPageComponent
private let noticeComponent: NoticeListComponent
private let myPageComponent: MyPageComponent

init(
homeComponent: HomeComponent,
studyRoomListComponent: StudyRoomListComponent,
applyPageComponent: ApplyPageComponent,
noticeComponent: NoticeListComponent,
myPageComponent: MyPageComponent
) {
self.homeComponent = homeComponent
self.studyRoomListComponent = studyRoomListComponent
self.applyPageComponent = applyPageComponent
self.noticeComponent = noticeComponent
self.myPageComponent = myPageComponent
UITabBar.hideTabBar()
Expand All @@ -50,7 +50,7 @@ struct MainTabView: View {
.tag(TabFlow.home)

if appState.features.studyRoomService {
studyRoomListComponent.makeView()
applyPageComponent.makeView()
.tag(TabFlow.apply)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ struct NoticeDetailView: View {
@Environment(\.dismiss) var dismiss

var body: some View {
ScrollView {
ScrollView(showsIndicators: false) {
VStack {
VStack(alignment: .leading, spacing: 0) {
Text(viewModel.title)
Expand All @@ -29,7 +29,7 @@ struct NoticeDetailView: View {
.dmsFont(.body(.body2), color: .GrayScale.gray6)
.padding(.top, 24)

Spacer()
Spacer(minLength: 83)
}
}
.dmsToast(isShowing: $viewModel.isErrorOcuured, message: viewModel.errorMessage, style: .error)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>CFBundleDevelopmentRegion</key>
<string>$(DEVELOPMENT_LANGUAGE)</string>
<key>CFBundleExecutable</key>
<string>$(EXECUTABLE_NAME)</string>
<key>CFBundleIdentifier</key>
<string>$(PRODUCT_BUNDLE_IDENTIFIER)</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>$(PRODUCT_NAME)</string>
<key>CFBundlePackageType</key>
<string>BNDL</string>
<key>CFBundleShortVersionString</key>
<string>1.0</string>
<key>CFBundleVersion</key>
<string>1</string>
</dict>
</plist>
9 changes: 9 additions & 0 deletions Projects/Features/RemainApplyFeature/Project.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
import ProjectDescription
import ProjectDescriptionHelpers

let project = Project.makeModule(
name: "RemainApplyFeature",
product: .staticFramework,
dependencies: [
.Project.Features.BaseFeature
])
Loading