-
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
merge :: MyPage - RewardPointDetail UI #137
Merged
Merged
Changes from 24 commits
Commits
Show all changes
25 commits
Select commit
Hold shift + click to select a range
468c66f
feat :: RewardPointDetailView
sian7563 ff32ff9
feat :: RewardPointDetailComponent
sian7563 a61de8f
feat :: RewardPointDetailViewModel
sian7563 b278395
feat :: AppComponent
sian7563 9d64591
feat :: AppComponent 추가
sian7563 8a222bd
feat :: RewardPointDetailComponent
sian7563 7507bcb
feat :: RewardPointDetailView Component 추가
sian7563 e7f24ba
feat :: RewardPointDetailViewModel
sian7563 2308c16
feat :: RewardPointDetailComponent 구현
sian7563 6dba4c9
feat :: RewardPointDetailView 구현
sian7563 b1d1641
feat :: RewardPointDetailViewModel 구현
sian7563 3f6bac8
feat :; NeedleGenerated
sian7563 d324aff
feat :: PointEntity 구현
sian7563 9a86b47
feat :: WholeButton 파일 생성
sian7563 febaad1
feat :: PointEntity 삭제
sian7563 8a3eadc
feat :: PointScreen UI
sian7563 7e7a919
Merge branch 'develop' of https://github.com/DSM-FLOW/DMS-iOS into fe…
baekteun c009173
refactor :: 기존Points 리리리팩토링
baekteun d1a4711
feat :: RewardPointDetailUI 구현
sian7563 d7a4bb2
feat :: RewardPointDetailUI 구현
sian7563 f462960
Merge branch 'develop' into feat/119_MyPage-RewardPointDetail-UI
sian7563 f0ba6fe
feat :: 피드백 수정
sian7563 c6f8b4a
Merge branch 'feat/119_MyPage-RewardPointDetail-UI' of https://github…
sian7563 a093746
feat :: NeedleGenerated
sian7563 f3a2ce9
feat :: 피드백 수정
sian7563 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
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/App/Sources/Application/DI/Points/AppComponent+Points.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 NeedleFoundation | ||
import NetworkModule | ||
import DomainModule | ||
import DataModule | ||
|
||
public extension AppComponent { | ||
var remotePointsDataSource: any RemotePointsDataSource { | ||
shared { | ||
RemotePointsDataSourceStub() | ||
} | ||
// RemotePointsDataSourceImpl(keychain: keychain) | ||
} | ||
|
||
var pointsRepository: any PointsRepository { | ||
shared { | ||
PointsRepositoryImpl(remotePointsDataSource: remotePointsDataSource) | ||
} | ||
} | ||
|
||
var fetchPointListUseCase: any FetchPointListUseCase { | ||
shared { | ||
FetchPointListUseCaseImpl(pointsRepository: pointsRepository) | ||
} | ||
} | ||
} |
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
19 changes: 19 additions & 0 deletions
19
Projects/Features/MyPageFeature/Sources/RewardPointDetail/RewardPointDetailComponent.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 DomainModule | ||
import NeedleFoundation | ||
import SwiftUI | ||
|
||
public protocol RewardPointDetailDependency: Dependency { | ||
var fetchPointListUseCase: any FetchPointListUseCase { get } | ||
var rewardPointDetailComponent: RewardPointDetailComponent { get } | ||
} | ||
|
||
public final class RewardPointDetailComponent: Component<RewardPointDetailDependency> { | ||
public func makeView() -> some View { | ||
RewardPointDetailView( | ||
viewModel: .init( | ||
fetchPointListUseCase: self.dependency.fetchPointListUseCase | ||
), | ||
rewardPointDetailComponent: dependency.rewardPointDetailComponent | ||
) | ||
} | ||
} |
88 changes: 88 additions & 0 deletions
88
Projects/Features/MyPageFeature/Sources/RewardPointDetail/RewardPointDetailView.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,88 @@ | ||
import DesignSystem | ||
import DataMappingModule | ||
import SwiftUI | ||
|
||
struct RewardPointDetailView: View { | ||
@StateObject var viewModel: RewardPointDetailViewModel | ||
private let rewardPointDetailComponent: RewardPointDetailComponent | ||
|
||
init( | ||
viewModel: RewardPointDetailViewModel, | ||
rewardPointDetailComponent: RewardPointDetailComponent | ||
) { | ||
_viewModel = StateObject(wrappedValue: viewModel) | ||
self.rewardPointDetailComponent = rewardPointDetailComponent | ||
} | ||
|
||
var body: some View { | ||
NavigationView { | ||
VStack(alignment: .leading) { | ||
HStack { | ||
ForEach(PointsType.allCases, id: \.self) { point in | ||
DMSButton(text: point.display, | ||
style: viewModel.pointsType == point ? .contained : .outlined, | ||
color: viewModel.pointsType == point ? .PrimaryVariant.primary : .GrayScale.gray6) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 스타일 가이드 맞춰주세요 🎲 |
||
viewModel.pointsType = point | ||
viewModel.fetchPointList() | ||
} | ||
.padding(.trailing, 12) | ||
} | ||
} | ||
.padding(.leading, 24) | ||
.padding(.top, 16) | ||
|
||
Text("\(viewModel.point?.totalPoint ?? 0)" + " 점") | ||
.dmsFont(.title(.large), color: .GrayScale.gray6) | ||
.padding(.top, 44) | ||
.padding(.horizontal, 24) | ||
.padding(.bottom, 44) | ||
ScrollView { | ||
VStack { | ||
ForEach(viewModel.point?.poinsts ?? [], id: \.self) { pointList in | ||
pointsListCellView( | ||
date: pointList.date.toSmallDMSDateString(), | ||
name: pointList.name, | ||
score: "\(pointList.score)" | ||
) | ||
.padding(.top, 5) | ||
.listRowInsets(EdgeInsets()) | ||
} | ||
} | ||
.padding(.horizontal, 24) | ||
} | ||
.navigationTitle("상벌점 현황") | ||
.navigationBarTitleDisplayMode(.inline) | ||
.dmsBackground() | ||
} | ||
} | ||
} | ||
|
||
@ViewBuilder | ||
func pointsListCellView(date: String, name: String, score: String) -> some View { | ||
ZStack { | ||
Color.System.surface | ||
.cornerRadius(6) | ||
|
||
HStack { | ||
VStack(alignment: .leading, spacing: 8) { | ||
Text(date) | ||
.dmsFont(.text(.extraSmall), color: .System.title) | ||
|
||
Text(name) | ||
.dmsFont(.text(.medium), color: .System.text) | ||
} | ||
HStack { | ||
Spacer() | ||
|
||
Text(score) | ||
.dmsFont(.text(.medium), color: score.contains("-") ? .System.error : .PrimaryVariant.darken2) | ||
} | ||
|
||
Spacer() | ||
} | ||
.padding(.horizontal, 16) | ||
} | ||
.frame(height: 68) | ||
.shadow(color: .GrayScale.gray5.opacity(0.15), blur: 20) | ||
} | ||
} |
31 changes: 31 additions & 0 deletions
31
Projects/Features/MyPageFeature/Sources/RewardPointDetail/RewardPointDetailViewModel.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,31 @@ | ||
import BaseFeature | ||
import Foundation | ||
import DomainModule | ||
import ErrorModule | ||
import Combine | ||
import DataMappingModule | ||
import DesignSystem | ||
|
||
final class RewardPointDetailViewModel: BaseViewModel { | ||
@Published var point: PointEntity? | ||
@Published var pointsType: PointsType = .all | ||
|
||
private let fetchPointListUseCase: any FetchPointListUseCase | ||
|
||
init( | ||
fetchPointListUseCase: any FetchPointListUseCase | ||
) { | ||
self.fetchPointListUseCase = fetchPointListUseCase | ||
super.init() | ||
fetchPointList() | ||
} | ||
|
||
func fetchPointList() { | ||
addCancellable( | ||
self.fetchPointListUseCase.execute( | ||
type: pointsType | ||
)) { [weak self] point in | ||
self?.point = point | ||
} | ||
} | ||
} |
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
13 changes: 12 additions & 1 deletion
13
Projects/Services/DataMappingModule/Sources/Enum/PointsType.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 |
---|---|---|
@@ -1,7 +1,18 @@ | ||
import Foundation | ||
|
||
public enum PointsType: String { | ||
public enum PointsType: String, CaseIterable { | ||
case all = "ALL" | ||
case bonus = "BONUS" | ||
case minus = "MINUS" | ||
|
||
public var display: String { | ||
switch self { | ||
case .all: | ||
return "전체" | ||
case .bonus: | ||
return "상점" | ||
case .minus: | ||
return "벌점" | ||
} | ||
} | ||
} |
9 changes: 0 additions & 9 deletions
9
Projects/Services/DataMappingModule/Sources/Point/FetchPointListResponseDTO.swift
This file was deleted.
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.
rewardPointDetailComponent가 rewardPointDetailComponent를 주입받네요..?