generated from GSM-MSG/MSG-Repository-Generator
-
Notifications
You must be signed in to change notification settings - Fork 0
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
๐ :: [#315] ์ ์๋ ์ ๋ณด์ ๋ ฅ ํ์ด์ง UI #316
Merged
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
9d86f0b
:sparkles: :: [#315] addInputTeacherInfoFeature
uuuunseo 3e275b6
:sparkles: :: [#315] InputTeacherInfoFeature / DI, Intent, Model, Intโฆ
uuuunseo b293b03
:sparkles: :: [#315] InputTeacherInfoFeature / ๊ธฐ๋ณธ ์ธํ
uuuunseo f747357
:sparkles: :: [#315] InputTeacherInfoFeature / InputTeacherInfoComponent
uuuunseo 51c0e57
:sparkles: :: [#315] InputTeacherInfoFeature / Demo ์ถ๊ฐ
uuuunseo 215d84c
:sparkles: :: [#315] InputTeacherInfoFeature / AppDelegate ์์
uuuunseo aa12bad
:lipstick: :: [#315] InputTeacherInfoView / ์ ์๋ ์ ๋ณด์
๋ ฅ ํ์ด์ง UI
uuuunseo cc99328
:sparkles: :: [#315] InputTeacherInfoFeature / InputTeacherDelegate ์ถ๊ฐ
uuuunseo 0c5def1
:sparkles: :: [#315] InputTeacherInfoFeature / ์ ์๋ ์งํจ ์ ํ BottomSheet
uuuunseo 5f57ea1
:sparkles: :: [#315] InputTeacherInfoFeature / ํ๋
์ ํ BottomSheet
uuuunseo 0fc2951
:sparkles: :: [#315] InputTeacherInfoFeature / ๋ฐ ์ ํ BottomSheet
uuuunseo 7719efd
:recycle: :: [#315] InputTeacherInfoView / ํ๋
, ๋ฐ ์ ํ placeholder ๋ด๋น ํ๋
โฆ
uuuunseo 9ffb688
:green_heart: :: BaseFeature dependency ์ถ๊ฐ
uuuunseo cf890d8
:green_heart: :: [#315] InputInformaionBaseFeature dependency ์ถ๊ฐ
uuuunseo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
25 changes: 25 additions & 0 deletions
25
Projects/Feature/InputTeacherInfoFeature/Demo/Resources/LaunchScreen.storyboard
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 @@ | ||
<?xml version="1.0" encoding="UTF-8" standalone="no"?> | ||
<document type="com.apple.InterfaceBuilder3.CocoaTouch.Storyboard.XIB" version="3.0" toolsVersion="13122.16" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" launchScreen="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES" initialViewController="01J-lp-oVM"> | ||
<dependencies> | ||
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="13104.12"/> | ||
<capability name="Safe area layout guides" minToolsVersion="9.0"/> | ||
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/> | ||
</dependencies> | ||
<scenes> | ||
<!--View Controller--> | ||
<scene sceneID="EHf-IW-A2E"> | ||
<objects> | ||
<viewController id="01J-lp-oVM" sceneMemberID="viewController"> | ||
<view key="view" contentMode="scaleToFill" id="Ze5-6b-2t3"> | ||
<rect key="frame" x="0.0" y="0.0" width="375" height="667"/> | ||
<autoresizingMask key="autoresizingMask" widthSizable="YES" heightSizable="YES"/> | ||
<color key="backgroundColor" xcode11CocoaTouchSystemColor="systemBackgroundColor" cocoaTouchSystemColor="whiteColor"/> | ||
<viewLayoutGuide key="safeArea" id="6Tk-OE-BBY"/> | ||
</view> | ||
</viewController> | ||
<placeholder placeholderIdentifier="IBFirstResponder" id="iYj-Kq-Ea1" userLabel="First Responder" sceneMemberID="firstResponder"/> | ||
</objects> | ||
<point key="canvasLocation" x="53" y="375"/> | ||
</scene> | ||
</scenes> | ||
</document> |
27 changes: 27 additions & 0 deletions
27
Projects/Feature/InputTeacherInfoFeature/Demo/Sources/AppDelegate.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,27 @@ | ||
import BaseFeature | ||
import SwiftUI | ||
import InputTeacherInfoFeatureInterface | ||
@testable import InputTeacherInfoFeature | ||
|
||
final class DummyInputTeacherInfoDelegate: InputTeacherDelegate { | ||
func completeToInputTeacherInformation() {} | ||
} | ||
|
||
@main | ||
struct InputTeacherInfoApp: App { | ||
var body: some Scene { | ||
WindowGroup { | ||
let model = InputTeacherInfoModel() | ||
let intent = InputTeacherInfoIntent( | ||
model: model, | ||
teacherDelegate: DummyInputTeacherInfoDelegate() | ||
) | ||
let container = MVIContainer( | ||
intent: intent as InputTeacherInfoIntentProtocol, | ||
model: model as InputTeacherInfoStateProtocol, | ||
modelChangePublisher: model.objectWillChange | ||
) | ||
InputTeacherInfoView(container: container) | ||
} | ||
} | ||
} |
3 changes: 3 additions & 0 deletions
3
Projects/Feature/InputTeacherInfoFeature/Interface/InputTeacherDelegate.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,3 @@ | ||
public protocol InputTeacherDelegate: AnyObject { | ||
func completeToInputTeacherInformation() | ||
} |
6 changes: 6 additions & 0 deletions
6
Projects/Feature/InputTeacherInfoFeature/Interface/InputTeacherInfoBuildable.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,6 @@ | ||
import SwiftUI | ||
|
||
public protocol InputTeacherInfoBuildable { | ||
associatedtype ViewType: View | ||
func makeView(delegate: InputTeacherDelegate) -> ViewType | ||
} |
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,13 @@ | ||
import ProjectDescription | ||
import ProjectDescriptionHelpers | ||
import DependencyPlugin | ||
|
||
let project = Project.makeModule( | ||
name: ModulePaths.Feature.InputTeacherInfoFeature.rawValue, | ||
product: .staticLibrary, | ||
targets: [.interface, .unitTest, .demo], | ||
internalDependencies: [ | ||
.Feature.BaseFeature, | ||
.Feature.InputInformationBaseFeature | ||
] | ||
) |
20 changes: 20 additions & 0 deletions
20
Projects/Feature/InputTeacherInfoFeature/Sources/DI/InputTeacherInfoComponent.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,20 @@ | ||
import BaseFeature | ||
import InputTeacherInfoFeatureInterface | ||
import NeedleFoundation | ||
import SwiftUI | ||
|
||
public protocol InputTeacherInfoDependency: Dependency {} | ||
|
||
public final class InputTeacherInfoComponent: Component<InputTeacherInfoDependency>, InputTeacherInfoBuildable { | ||
|
||
public func makeView(delegate: InputTeacherDelegate) -> some View { | ||
let model = InputTeacherInfoModel() | ||
let intent = InputTeacherInfoIntent(model: model, teacherDelegate: delegate) | ||
let container = MVIContainer( | ||
intent: intent as InputTeacherInfoIntentProtocol, | ||
model: model as InputTeacherInfoStateProtocol, | ||
modelChangePublisher: model.objectWillChange | ||
) | ||
return InputTeacherInfoView(container: container) | ||
} | ||
} |
43 changes: 43 additions & 0 deletions
43
Projects/Feature/InputTeacherInfoFeature/Sources/Intent/InputTeacherInfoIntent.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,43 @@ | ||
import Foundation | ||
import InputTeacherInfoFeatureInterface | ||
|
||
final class InputTeacherInfoIntent: InputTeacherInfoIntentProtocol { | ||
private weak var model: (any InputTeacherInfoActionProtocol)? | ||
private weak var teacherDelegate: (any InputTeacherDelegate)? | ||
|
||
init( | ||
model: any InputTeacherInfoActionProtocol, | ||
teacherDelegate: any InputTeacherDelegate | ||
) { | ||
self.model = model | ||
self.teacherDelegate = teacherDelegate | ||
} | ||
|
||
func completeButtonDidTap() { | ||
teacherDelegate?.completeToInputTeacherInformation() | ||
} | ||
|
||
func jobTitleSheetIsRequired() { | ||
model?.updateIsPresentedJobTitleSheet(isPresented: true) | ||
} | ||
|
||
func jobTitleSheetDismissed() { | ||
model?.updateIsPresentedJobTitleSheet(isPresented: false) | ||
} | ||
|
||
func gradeSheetIsRequired() { | ||
model?.updateIsPresentedGradeSheet(isPresented: true) | ||
} | ||
|
||
func gradeSheetDismissed() { | ||
model?.updateIsPresentedGradeSheet(isPresented: false) | ||
} | ||
|
||
func classSheetIsRequired() { | ||
model?.updateIsPresentedClassSheet(isPresented: true) | ||
} | ||
|
||
func classSheetDismissed() { | ||
model?.updateIsPresentedClassSheet(isPresented: false) | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
Projects/Feature/InputTeacherInfoFeature/Sources/Intent/InputTeacherInfoIntentProtocol.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,11 @@ | ||
import Foundation | ||
|
||
protocol InputTeacherInfoIntentProtocol { | ||
func completeButtonDidTap() | ||
func jobTitleSheetIsRequired() | ||
func jobTitleSheetDismissed() | ||
func gradeSheetIsRequired() | ||
func gradeSheetDismissed() | ||
func classSheetIsRequired() | ||
func classSheetDismissed() | ||
} |
21 changes: 21 additions & 0 deletions
21
Projects/Feature/InputTeacherInfoFeature/Sources/Model/InputTeacherInfoModel.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,21 @@ | ||
import Foundation | ||
|
||
final class InputTeacherInfoModel: ObservableObject, InputTeacherInfoStateProtocol { | ||
@Published var isPresentedJobTitleSheet: Bool = false | ||
@Published var isPresentedGradeSheet: Bool = false | ||
@Published var isPresentedClassSheet: Bool = false | ||
} | ||
|
||
extension InputTeacherInfoModel: InputTeacherInfoActionProtocol { | ||
func updateIsPresentedJobTitleSheet(isPresented: Bool) { | ||
self.isPresentedJobTitleSheet = isPresented | ||
} | ||
|
||
func updateIsPresentedGradeSheet(isPresented: Bool) { | ||
self.isPresentedGradeSheet = isPresented | ||
} | ||
|
||
func updateIsPresentedClassSheet(isPresented: Bool) { | ||
self.isPresentedClassSheet = isPresented | ||
} | ||
} |
13 changes: 13 additions & 0 deletions
13
Projects/Feature/InputTeacherInfoFeature/Sources/Model/InputTeacherInfoModelProtocol.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,13 @@ | ||
import Foundation | ||
|
||
protocol InputTeacherInfoStateProtocol { | ||
var isPresentedJobTitleSheet: Bool { get } | ||
var isPresentedGradeSheet: Bool { get } | ||
var isPresentedClassSheet: Bool { get } | ||
} | ||
|
||
protocol InputTeacherInfoActionProtocol: AnyObject { | ||
func updateIsPresentedJobTitleSheet(isPresented: Bool) | ||
func updateIsPresentedGradeSheet(isPresented: Bool) | ||
func updateIsPresentedClassSheet(isPresented: Bool) | ||
} |
163 changes: 163 additions & 0 deletions
163
Projects/Feature/InputTeacherInfoFeature/Sources/Scene/InputTeacherInfoView.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,163 @@ | ||
import BaseFeature | ||
import DesignSystem | ||
import InputInformationBaseFeature | ||
import SwiftUI | ||
|
||
struct InputTeacherInfoView: View { | ||
@StateObject var container: MVIContainer<InputTeacherInfoIntentProtocol, InputTeacherInfoStateProtocol> | ||
var intent: any InputTeacherInfoIntentProtocol { container.intent } | ||
var state: any InputTeacherInfoStateProtocol { container.model } | ||
|
||
var body: some View { | ||
SMSNavigationTitleView(title: "์ ๋ณด์ ๋ ฅ") { | ||
VStack(spacing: 0) { | ||
HStack(spacing: 4) { | ||
Text("ํ๋กํ") | ||
.foregroundColor(.sms(.system(.black))) | ||
|
||
Text("*") | ||
.foregroundColor(.sms(.sub(.s2))) | ||
|
||
Spacer() | ||
} | ||
.smsFont(.title1) | ||
.padding(.top, 36) | ||
|
||
VStack(spacing: 24) { | ||
inputTeacherInfoTextField( | ||
title: "์งํจ", | ||
placeholder: "์งํจ ์ ํ", | ||
text: .constant("") | ||
) | ||
.onTapGesture { | ||
intent.jobTitleSheetIsRequired() | ||
} | ||
|
||
inputTeacherInfoTextField( | ||
title: "ํ๋ ", | ||
placeholder: "๋ด๋น ํ๋ ์ ํ", | ||
text: .constant("") | ||
) | ||
.onTapGesture { | ||
intent.gradeSheetIsRequired() | ||
} | ||
|
||
inputTeacherInfoTextField( | ||
title: "๋ฐ", | ||
placeholder: "๋ด๋น ๋ฐ ์ ํ", | ||
text: .constant("") | ||
) | ||
.onTapGesture { | ||
intent.classSheetIsRequired() | ||
} | ||
} | ||
.padding(.top, 32) | ||
|
||
CTAButton(text: "์๋ฃ") | ||
.padding(.top, 32) | ||
|
||
Spacer() | ||
} | ||
.padding(.horizontal, 20) | ||
} | ||
.smsBottomSheet( | ||
isShowing: Binding( | ||
get: { state.isPresentedJobTitleSheet }, | ||
set: { _ in intent.jobTitleSheetDismissed() } | ||
) | ||
) { | ||
jobTitleListView() | ||
} | ||
.smsBottomSheet( | ||
isShowing: Binding( | ||
get: { state.isPresentedGradeSheet }, | ||
set: { _ in intent.gradeSheetDismissed() } | ||
) | ||
) { | ||
gradeListView() | ||
} | ||
.smsBottomSheet( | ||
isShowing: Binding( | ||
get: { state.isPresentedClassSheet}, | ||
set: { _ in intent.classSheetDismissed() } | ||
) | ||
) { | ||
classListView() | ||
} | ||
} | ||
|
||
@ViewBuilder | ||
func inputTeacherInfoTextField( | ||
title: String, | ||
placeholder: String, | ||
text: Binding<String> | ||
) -> some View { | ||
SMSTextField( | ||
placeholder, | ||
text: text | ||
) | ||
.disabled(true) | ||
.overlay(alignment: .trailing) { | ||
SMSIcon(.downChevron) | ||
.padding(.trailing, 12) | ||
} | ||
.titleWrapper(title) | ||
} | ||
|
||
@ViewBuilder | ||
func jobTitleListView() -> some View { | ||
VStack(spacing: 16) { | ||
ForEach(0..<5, id: \.self) { index in | ||
HStack { | ||
Text("\(index)") | ||
.smsFont(.body1, color: .neutral(.n50)) | ||
|
||
Spacer() | ||
|
||
Circle() | ||
.fill(Color.sms(.primary(.p2))) | ||
.frame(width: 24, height: 24) | ||
} | ||
.padding(.horizontal, 20) | ||
} | ||
} | ||
} | ||
|
||
@ViewBuilder | ||
func gradeListView() -> some View { | ||
VStack(spacing: 16) { | ||
ForEach(1..<4, id: \.self) { index in | ||
HStack { | ||
Text("\(index)ํ๋ ") | ||
.smsFont(.body1, color: .neutral(.n50)) | ||
|
||
Spacer() | ||
|
||
Circle() | ||
.fill(Color.sms(.primary(.p2))) | ||
.frame(width: 24, height: 24) | ||
} | ||
.padding(.horizontal, 20) | ||
} | ||
} | ||
} | ||
|
||
@ViewBuilder | ||
func classListView() -> some View { | ||
VStack(spacing: 16) { | ||
ForEach(1..<5, id: \.self) { index in | ||
HStack { | ||
Text("\(index)๋ฐ") | ||
.smsFont(.body1, color: .neutral(.n50)) | ||
|
||
Spacer() | ||
|
||
Circle() | ||
.fill(Color.sms(.primary(.p2))) | ||
.frame(width: 24, height: 24) | ||
} | ||
.padding(.horizontal, 20) | ||
} | ||
} | ||
} | ||
} |
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 @@ | ||
// This is for Tuist |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
placeholder๊ฐ ๋์์ธ์ด๋ ๋ค๋ฅธ ๊ฒ ๊ฐ์์!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
placeholder ๋ถ๋ถ text ๋ง์ํ์๋๊ฑฐ๋ฉด ๋์์ธ์ด๋ ์ด์ผ๊ธฐ ํด์
์ผ๋ก ๋ณ๊ฒฝํ๊ฒ ๋์ด์!!