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

feat: 검색 화면 정리 및 검색 상세 화면 구현 #46

Merged
merged 5 commits into from
Jul 27, 2024

Conversation

lina0322
Copy link
Member

@lina0322 lina0322 commented Jul 17, 2024

What is this PR? 🔍

이슈

설명

  • 검색 화면 API 연결 및 정리
  • 검색 결과 화면 구현
  • 기타 등등

Screenshot 📸

Simulator.Screen.Recording.-.iPhone.15.Pro.Max.-.2024-07-18.at.03.31.00.mp4

To Reviewers 🙏

파일 많아서 죄송합니다🥹

@lina0322 lina0322 self-assigned this Jul 17, 2024
@auto-assign auto-assign bot requested review from chansooo, hryeong66 and jongnan July 17, 2024 18:31
Copy link
Member

@chansooo chansooo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

수고 많으셨습니다~
코멘트 참고해주시고, router에서 사라진 view의 router가 childRouters에 잡혀있는지 확인해주시면 감사하겠습니다

@@ -75,11 +78,11 @@ public struct MemeListView: View {

"https://images.unsplash.com/photo-1507146426996-ef05306b995a?q=80&w=3540&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" ]

let memeDetailList = (0..<20)
@State var memeDetailList = (0..<20)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

20개로 한정된 이유가 있나요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hryeong66 요거 그냥 테스트용으로 두신거죠?_?
크게 이유 없어보입니당~

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 요거는 테스트로 추가한거라 개수는 임의로 넣었습니답!

Comment on lines +12 to +19
@Binding var memeDetailList: [MemeDetail]
private let columns = Array(
repeating: GridItem(
.flexible(),
spacing: 12,
alignment: .center
), count: 2
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거 gridItem으로 하고 grid 사용하면 두 column 사이에 공백이 생길텐데 그 부분은 추후에 처리하실 예정이실까요?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hryeong66 확인 부탁드려횹🙏

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@hryeong66 확인 부탁드려횹🙏

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앟 요거 grid로 하면 한 row 의 높이가 높은 쪽에 맞춰져서 디자인 요구사항을 맞출 수 없어
LazyVStack 두개를 HStack으로 넣는걸로 수정했습니다!
그래서 요 column 안쓰는데 삭제가 안되었네여.. 다음 PR 때 같이 삭제해서 올릴게요~!
image

Comment on lines 45 to 51
public var headers: [String : String]? {
return nil
switch self {
case .getSearchKeywordMemeList:
return ["x-device-id": UserInfo.shared.deviceId]
default:
return nil
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거 아마 networkmanager에서 직접 넣어주고 있을거에요

Comment on lines 54 to 73
// func getMemeDetailView() -> some View {
// return MemeDetailView(
// viewModel: MemeDetailViewModel(
// meme: .mock,
// router: nil,
// copyImageUseCase: CopyImageUseCaseImpl(),
// postLikeUseCase: PostLikeUseCaseImpl()
// )
// )
// }

func getSearchResultView() -> some View {
return SearchResultView(
viewModel: SearchResultViewModel(
keyword: "긁",
router: nil,
copyImageUseCase: CopyImageUseCaseImpl(),
postLikeUseCase: PostLikeUseCaseImpl()
searchKeywordUseCase: SearchKeywordUseCaseImpl(
repository: MemeRepositoryImpl(networkservice: NetworkService())
), copyImageUseCase: CopyImageUseCaseImpl()
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

주석 지워주세요~

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

요거 밈 디테일 뷰 관련해서 찬수님이 만들어두신건데, PostLikeUseCaseImpl? 인가 없어서 빌드가 안돼서 주석해놨서욤
디테일 뷰 날려도 되나요?_? 아, 디펜던시 이슈인가?
이따 확인해보고 디펜던시 이슈면 원복하고 아니면 삭제해버릴게요??

Comment on lines +19 to +56
public final class SearchResultRouter: Router, SearchResultRouting {

// MARK: - Properties
public var delegate: (any RouterDelegate)?
public var navigationController: UINavigationController
public var childRouters: [any Router] = []

let keyword: String

// MARK: - Initializers

public init(_ navigationController: UINavigationController, keyword: String) {
navigationController.isNavigationBarHidden = true
self.navigationController = navigationController
self.keyword = keyword
}

// MARK: - Methods

public func start() {
let repository = MemeRepositoryImpl(networkservice: NetworkService())

self.pushView(
SearchResultView(viewModel: SearchResultViewModel(
keyword: keyword,
router: self,
searchKeywordUseCase: SearchKeywordUseCaseImpl(repository: repository),
copyImageUseCase: CopyImageUseCaseImpl()
))
)
}

public func showMemeDetail(memeDetail: MemeDetail) {
let router = MemeDetailRouter(self.navigationController, meme: memeDetail)
self.childRouters.append(router)
router.start()
}
}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

search -> searchResult 이후 pop해줬을 떄의 delegate 처리가 필요해보입니다.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

이고 뭐 말하는곤지 모르게쏘여..🥲 혹시 자세히 말해줄 수 있나영?

Copy link
Collaborator

@hryeong66 hryeong66 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

고생하셨습니다~!

@@ -75,11 +78,11 @@ public struct MemeListView: View {

"https://images.unsplash.com/photo-1507146426996-ef05306b995a?q=80&w=3540&auto=format&fit=crop&ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D" ]

let memeDetailList = (0..<20)
@State var memeDetailList = (0..<20)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

넵 요거는 테스트로 추가한거라 개수는 임의로 넣었습니답!

Comment on lines +12 to +19
@Binding var memeDetailList: [MemeDetail]
private let columns = Array(
repeating: GridItem(
.flexible(),
spacing: 12,
alignment: .center
), count: 2
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

앟 요거 grid로 하면 한 row 의 높이가 높은 쪽에 맞춰져서 디자인 요구사항을 맞출 수 없어
LazyVStack 두개를 HStack으로 넣는걸로 수정했습니다!
그래서 요 column 안쓰는데 삭제가 안되었네여.. 다음 PR 때 같이 삭제해서 올릴게요~!
image

Comment on lines +31 to +37
memeClickHandler: { meme in
viewModel.dispatch(type: .memeDetailTapped(meme: meme))
},
memeCopyHandler: { meme in
viewModel.dispatch(type: .memeCopyTapped(meme: meme))
}
)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

오오 이렇게 쓰는게 더 좋네여 저도 이렇게 바꿔야겠어요👍👍

lina0322 and others added 2 commits July 24, 2024 20:55
# Conflicts:
#	Projects/Core/PPACData/Sources/Endpoint/MemeEndpoint.swift
@chansooo chansooo merged commit 841bd77 into develop Jul 27, 2024
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants