diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+Target.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+Target.swift index d9bfcab1..89325365 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+Target.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/Dependency+Target.swift @@ -9,6 +9,10 @@ public extension TargetDependency { } public extension TargetDependency.Feature { + static let InputInformationBaseFeature = TargetDependency.project( + target: ModulePaths.Feature.InputInformationBaseFeature.targetName(type: .sources), + path: .relativeToFeature(ModulePaths.Feature.InputInformationBaseFeature.rawValue) + ) static let RootFeature = TargetDependency.project( target: ModulePaths.Feature.RootFeature.targetName(type: .sources), path: .relativeToFeature(ModulePaths.Feature.RootFeature.rawValue) diff --git a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift index c3a4dbea..c5f215cf 100644 --- a/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift +++ b/Plugin/DependencyPlugin/ProjectDescriptionHelpers/ModulePaths.swift @@ -10,6 +10,7 @@ public enum ModulePaths { public extension ModulePaths { enum Feature: String { + case InputInformationBaseFeature case RootFeature case InputLanguageInfoFeature case InputCertificateInfoFeature diff --git a/Projects/Core/DesignSystem/Sources/Separator/SMSSeparator.swift b/Projects/Core/DesignSystem/Sources/Separator/SMSSeparator.swift new file mode 100644 index 00000000..c669e3d9 --- /dev/null +++ b/Projects/Core/DesignSystem/Sources/Separator/SMSSeparator.swift @@ -0,0 +1,16 @@ +import SwiftUI + +public struct SMSSeparator: View { + let height: CGFloat + + public init(height: CGFloat = 16) { + self.height = height + } + + public var body: some View { + Rectangle() + .fill(Color.sms(.neutral(.n10))) + .frame(maxWidth: .infinity) + .frame(height: height) + } +} diff --git a/Projects/Feature/InputCertificateInfoFeature/Project.swift b/Projects/Feature/InputCertificateInfoFeature/Project.swift index 50306a56..51d9fa68 100644 --- a/Projects/Feature/InputCertificateInfoFeature/Project.swift +++ b/Projects/Feature/InputCertificateInfoFeature/Project.swift @@ -7,6 +7,6 @@ let project = Project.makeModule( product: .staticLibrary, targets: [.interface, .unitTest], internalDependencies: [ - .Feature.BaseFeature + .Feature.InputInformationBaseFeature ] ) diff --git a/Projects/Feature/InputCertificateInfoFeature/Sources/Scene/InputCertificateInfoView.swift b/Projects/Feature/InputCertificateInfoFeature/Sources/Scene/InputCertificateInfoView.swift index e73dd1ce..cacb4a7e 100644 --- a/Projects/Feature/InputCertificateInfoFeature/Sources/Scene/InputCertificateInfoView.swift +++ b/Projects/Feature/InputCertificateInfoFeature/Sources/Scene/InputCertificateInfoView.swift @@ -1,6 +1,7 @@ import BaseFeature import DesignSystem import FoundationUtil +import InputInformationBaseFeature import SwiftUI import ViewUtil @@ -13,13 +14,15 @@ struct InputCertificateInfoView: View { GeometryReader { proxy in SMSNavigationTitleView(title: "정보입력") { ScrollView(showsIndicators: false) { - Rectangle() - .fill(Color.sms(.neutral(.n10))) - .frame(maxWidth: .infinity) - .frame(height: 16) + SMSSeparator() VStack(spacing: 32) { - pageTitleView() + InputInformationPageTitleView( + title: "자격증", + isRequired: false, + pageCount: 6, + selectedPage: 4 + ) VStack(spacing: 8) { certificateListView() @@ -54,22 +57,6 @@ struct InputCertificateInfoView: View { .hideKeyboardWhenTap() } - @ViewBuilder - func pageTitleView() -> some View { - HStack(spacing: 4) { - Text("자격증") - .foregroundColor(.sms(.system(.black))) - - Text("*") - .foregroundColor(.sms(.sub(.s2))) - - Spacer() - - SMSPageControl(pageCount: 6, selectedPage: 4) - } - .smsFont(.title1) - } - @ViewBuilder func certificateListView() -> some View { VStack(spacing: 12) { diff --git a/Projects/Feature/InputInformationBaseFeature/Project.swift b/Projects/Feature/InputInformationBaseFeature/Project.swift new file mode 100644 index 00000000..d74dd0bd --- /dev/null +++ b/Projects/Feature/InputInformationBaseFeature/Project.swift @@ -0,0 +1,12 @@ +import ProjectDescription +import ProjectDescriptionHelpers +import DependencyPlugin + +let project = Project.makeModule( + name: ModulePaths.Feature.InputInformationBaseFeature.rawValue, + product: .framework, + targets: [], + internalDependencies: [ + .Feature.BaseFeature + ] +) diff --git a/Projects/Feature/InputInformationBaseFeature/Sources/InputInformationPageTitleView.swift b/Projects/Feature/InputInformationBaseFeature/Sources/InputInformationPageTitleView.swift new file mode 100644 index 00000000..897b8020 --- /dev/null +++ b/Projects/Feature/InputInformationBaseFeature/Sources/InputInformationPageTitleView.swift @@ -0,0 +1,37 @@ +import DesignSystem +import SwiftUI + +public struct InputInformationPageTitleView: View { + let title: String + let isRequired: Bool + let pageCount: Int + let selectedPage: Int + + public init( + title: String, + isRequired: Bool = true, + pageCount: Int, + selectedPage: Int + ) { + self.title = title + self.isRequired = isRequired + self.pageCount = pageCount + self.selectedPage = selectedPage + } + + public var body: some View { + HStack(spacing: 4) { + Text(title) + .foregroundColor(.sms(.system(.black))) + + Text("*") + .foregroundColor(.sms(.sub(.s2))) + .conditional(isRequired) + + Spacer() + + SMSPageControl(pageCount: pageCount, selectedPage: selectedPage) + } + .smsFont(.title1) + } +} diff --git a/Projects/Feature/InputLanguageInfoFeature/Project.swift b/Projects/Feature/InputLanguageInfoFeature/Project.swift index 7f1f977f..047ef36b 100644 --- a/Projects/Feature/InputLanguageInfoFeature/Project.swift +++ b/Projects/Feature/InputLanguageInfoFeature/Project.swift @@ -7,6 +7,6 @@ let project = Project.makeModule( product: .staticLibrary, targets: [.interface, .unitTest], internalDependencies: [ - .Feature.BaseFeature + .Feature.InputInformationBaseFeature ] ) diff --git a/Projects/Feature/InputLanguageInfoFeature/Sources/Scene/InputLanguageInfoView.swift b/Projects/Feature/InputLanguageInfoFeature/Sources/Scene/InputLanguageInfoView.swift index ec706b2e..9ce55c99 100644 --- a/Projects/Feature/InputLanguageInfoFeature/Sources/Scene/InputLanguageInfoView.swift +++ b/Projects/Feature/InputLanguageInfoFeature/Sources/Scene/InputLanguageInfoView.swift @@ -1,6 +1,7 @@ import BaseFeature import DesignSystem import FoundationUtil +import InputInformationBaseFeature import SwiftUI import ViewUtil @@ -13,13 +14,15 @@ struct InputLanguageInfoView: View { GeometryReader { proxy in SMSNavigationTitleView(title: "정보입력") { ScrollView(showsIndicators: false) { - Rectangle() - .fill(Color.sms(.neutral(.n10))) - .frame(maxWidth: .infinity) - .frame(height: 16) + SMSSeparator() VStack(spacing: 32) { - pageTitleView() + InputInformationPageTitleView( + title: "외국어", + isRequired: false, + pageCount: 6, + selectedPage: 5 + ) languageListView(proxy: proxy) } @@ -45,22 +48,6 @@ struct InputLanguageInfoView: View { .hideKeyboardWhenTap() } - @ViewBuilder - func pageTitleView() -> some View { - HStack(spacing: 4) { - Text("외국어") - .foregroundColor(.sms(.system(.black))) - - Text("*") - .foregroundColor(.sms(.sub(.s2))) - - Spacer() - - SMSPageControl(pageCount: 6, selectedPage: 5) - } - .smsFont(.title1) - } - @ViewBuilder func languageListView(proxy: GeometryProxy) -> some View { VStack(spacing: 8) { diff --git a/Projects/Feature/InputMilitaryInfoFeature/Project.swift b/Projects/Feature/InputMilitaryInfoFeature/Project.swift index a14bd8a6..85143b47 100644 --- a/Projects/Feature/InputMilitaryInfoFeature/Project.swift +++ b/Projects/Feature/InputMilitaryInfoFeature/Project.swift @@ -7,7 +7,7 @@ let project = Project.makeModule( product: .staticLibrary, targets: [.interface, .unitTest], internalDependencies: [ - .Feature.BaseFeature, + .Feature.InputInformationBaseFeature, .Domain.StudentDomainInterface ] ) diff --git a/Projects/Feature/InputMilitaryInfoFeature/Sources/Scene/InputMilitaryInfoView.swift b/Projects/Feature/InputMilitaryInfoFeature/Sources/Scene/InputMilitaryInfoView.swift index 5a256493..177bc8fa 100644 --- a/Projects/Feature/InputMilitaryInfoFeature/Sources/Scene/InputMilitaryInfoView.swift +++ b/Projects/Feature/InputMilitaryInfoFeature/Sources/Scene/InputMilitaryInfoView.swift @@ -1,7 +1,8 @@ import BaseFeature import DesignSystem -import SwiftUI +import InputInformationBaseFeature import StudentDomainInterface +import SwiftUI struct InputMilitaryInfoView: View { @StateObject var container: MVIContainer @@ -11,13 +12,10 @@ struct InputMilitaryInfoView: View { var body: some View { GeometryReader { proxy in SMSNavigationTitleView(title: "정보입력") { - Rectangle() - .fill(Color.sms(.neutral(.n10))) - .frame(maxWidth: .infinity) - .frame(height: 16) + SMSSeparator() VStack(spacing: 32) { - pageTitleView() + InputInformationPageTitleView(title: "병역", pageCount: 6, selectedPage: 3) VStack(spacing: 24) { SMSTextField( @@ -69,22 +67,6 @@ struct InputMilitaryInfoView: View { .animation(.default, value: state.isPresentedMilitarySheet) } - @ViewBuilder - func pageTitleView() -> some View { - HStack(spacing: 4) { - Text("병역") - .foregroundColor(.sms(.system(.black))) - - Text("*") - .foregroundColor(.sms(.sub(.s2))) - - Spacer() - - SMSPageControl(pageCount: 6, selectedPage: 3) - } - .smsFont(.title1) - } - @ViewBuilder func militaryListView() -> some View { VStack(spacing: 16) { diff --git a/Projects/Feature/InputProfileInfoFeature/Project.swift b/Projects/Feature/InputProfileInfoFeature/Project.swift index 6441e4d3..3fd5cd8a 100644 --- a/Projects/Feature/InputProfileInfoFeature/Project.swift +++ b/Projects/Feature/InputProfileInfoFeature/Project.swift @@ -7,7 +7,7 @@ let project = Project.makeModule( product: .staticLibrary, targets: [.interface, .unitTest], internalDependencies: [ - .Feature.BaseFeature, + .Feature.InputInformationBaseFeature, .Domain.MajorDomainInterface ], unitTestDependencies: [ diff --git a/Projects/Feature/InputProfileInfoFeature/Sources/Scene/InputProfileInfoView.swift b/Projects/Feature/InputProfileInfoFeature/Sources/Scene/InputProfileInfoView.swift index cd00e330..da1efc8e 100644 --- a/Projects/Feature/InputProfileInfoFeature/Sources/Scene/InputProfileInfoView.swift +++ b/Projects/Feature/InputProfileInfoFeature/Sources/Scene/InputProfileInfoView.swift @@ -1,6 +1,7 @@ import BaseFeature import DesignSystem import SwiftUI +import InputInformationBaseFeature struct InputProfileInfoView: View { enum FocusField: Hashable { @@ -18,13 +19,10 @@ struct InputProfileInfoView: View { var body: some View { SMSNavigationTitleView(title: "정보입력") { ScrollView(showsIndicators: false) { - Rectangle() - .fill(Color.sms(.neutral(.n10))) - .frame(maxWidth: .infinity) - .frame(height: 16) + SMSSeparator() VStack(spacing: 32) { - pageTitleView() + InputInformationPageTitleView(title: "프로필", pageCount: 6, selectedPage: 0) VStack(alignment: .leading, spacing: 24) { VStack(alignment: .leading, spacing: 8) { @@ -186,22 +184,6 @@ struct InputProfileInfoView: View { .animation(.default, value: state.inputProfileErrorFieldSet) } - @ViewBuilder - func pageTitleView() -> some View { - HStack(spacing: 4) { - Text("프로필") - .foregroundColor(.sms(.system(.black))) - - Text("*") - .foregroundColor(.sms(.sub(.s2))) - - Spacer() - - SMSPageControl(pageCount: 6, selectedPage: 0) - } - .smsFont(.title1) - } - @ViewBuilder func majorListView() -> some View { ScrollView { diff --git a/Projects/Feature/InputSchoolLifeInfoFeature/Project.swift b/Projects/Feature/InputSchoolLifeInfoFeature/Project.swift index 5519b3f8..842eb5e6 100644 --- a/Projects/Feature/InputSchoolLifeInfoFeature/Project.swift +++ b/Projects/Feature/InputSchoolLifeInfoFeature/Project.swift @@ -7,6 +7,6 @@ let project = Project.makeModule( product: .staticLibrary, targets: [.interface, .unitTest], internalDependencies: [ - .Feature.BaseFeature + .Feature.InputInformationBaseFeature ] ) diff --git a/Projects/Feature/InputSchoolLifeInfoFeature/Sources/Scene/InputSchoolLifeInfoView.swift b/Projects/Feature/InputSchoolLifeInfoFeature/Sources/Scene/InputSchoolLifeInfoView.swift index 4b925526..5f963864 100644 --- a/Projects/Feature/InputSchoolLifeInfoFeature/Sources/Scene/InputSchoolLifeInfoView.swift +++ b/Projects/Feature/InputSchoolLifeInfoFeature/Sources/Scene/InputSchoolLifeInfoView.swift @@ -1,5 +1,6 @@ import BaseFeature import DesignSystem +import InputInformationBaseFeature import SwiftUI import UniformTypeIdentifiers @@ -11,13 +12,10 @@ struct InputSchoolLifeInfoView: View { var body: some View { GeometryReader { proxy in SMSNavigationTitleView(title: "정보입력") { - Rectangle() - .fill(Color.sms(.neutral(.n10))) - .frame(maxWidth: .infinity) - .frame(height: 16) + SMSSeparator() VStack(spacing: 32) { - pageTitleView() + InputInformationPageTitleView(title: "학교 생활", pageCount: 6, selectedPage: 1) VStack(spacing: 24) { SMSTextField( @@ -87,20 +85,4 @@ struct InputSchoolLifeInfoView: View { } } } - - @ViewBuilder - func pageTitleView() -> some View { - HStack(spacing: 4) { - Text("학교 생활") - .foregroundColor(.sms(.system(.black))) - - Text("*") - .foregroundColor(.sms(.sub(.s2))) - - Spacer() - - SMSPageControl(pageCount: 6, selectedPage: 1) - } - .smsFont(.title1) - } } diff --git a/Projects/Feature/InputWorkInfoFeature/Project.swift b/Projects/Feature/InputWorkInfoFeature/Project.swift index 0521e2c9..b3269ad5 100644 --- a/Projects/Feature/InputWorkInfoFeature/Project.swift +++ b/Projects/Feature/InputWorkInfoFeature/Project.swift @@ -7,7 +7,7 @@ let project = Project.makeModule( product: .staticLibrary, targets: [.interface, .unitTest], internalDependencies: [ - .Feature.BaseFeature, + .Feature.InputInformationBaseFeature, .Domain.StudentDomainInterface ] ) diff --git a/Projects/Feature/InputWorkInfoFeature/Sources/Scene/InputWorkInfoView.swift b/Projects/Feature/InputWorkInfoFeature/Sources/Scene/InputWorkInfoView.swift index e4549caa..f092661a 100644 --- a/Projects/Feature/InputWorkInfoFeature/Sources/Scene/InputWorkInfoView.swift +++ b/Projects/Feature/InputWorkInfoFeature/Sources/Scene/InputWorkInfoView.swift @@ -1,8 +1,9 @@ import BaseFeature import DesignSystem import FoundationUtil -import SwiftUI +import InputInformationBaseFeature import StudentDomainInterface +import SwiftUI import ViewUtil struct InputWorkInfoView: View { @@ -14,13 +15,10 @@ struct InputWorkInfoView: View { GeometryReader { proxy in SMSNavigationTitleView(title: "정보입력") { ScrollView(showsIndicators: false) { - Rectangle() - .fill(Color.sms(.neutral(.n10))) - .frame(maxWidth: .infinity) - .frame(height: 16) + SMSSeparator() VStack(spacing: 32) { - pageTitleView() + InputInformationPageTitleView(title: "근무 조건", pageCount: 6, selectedPage: 2) VStack(spacing: 24) { SMSTextField( @@ -92,22 +90,6 @@ struct InputWorkInfoView: View { .animation(.default, value: state.isPresentedFormOfEmployeementSheet) } - @ViewBuilder - func pageTitleView() -> some View { - HStack(spacing: 4) { - Text("근무 조건") - .foregroundColor(.sms(.system(.black))) - - Text("*") - .foregroundColor(.sms(.sub(.s2))) - - Spacer() - - SMSPageControl(pageCount: 6, selectedPage: 2) - } - .smsFont(.title1) - } - @ViewBuilder func workRegionList() -> some View { VStack(spacing: 8) {