Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
637f5d6
[ui]: 기존 컴포넌트를 재활용 가능하게 수정 (#47)
rbqks529 Jul 17, 2025
6032cbe
[ui]: 기존 컴포넌트를 재활용 가능하게 수정 (#47)
rbqks529 Jul 17, 2025
73d60bb
[refactor]: 기존 Group 검색 컴포넌트 이름 및 divider 수정 (#47)
rbqks529 Jul 17, 2025
51e971e
[refactor]: 기존 Group 검색 컴포넌트 이름 및 divider 수정 (#47)
rbqks529 Jul 17, 2025
49f63ad
[refactor]: 기존 Group 검색 컴포넌트 패딩 및 파라미터 수정 (#47)
rbqks529 Jul 17, 2025
cc0f376
[refactor]: 책 데이터 Mock 추가 및 검색 초기 컴포넌트 구현 (#47)
rbqks529 Jul 17, 2025
87ad17a
[refactor]: 책 검색 중, 검색 완료 화면 구현 (#47)
rbqks529 Jul 17, 2025
237e036
[refactor]: String 추가 및 책 검색 화면 구현 완료 (#47)
rbqks529 Jul 17, 2025
45e9898
[chore]: 주석 수정 (#47)
rbqks529 Jul 17, 2025
4c414ae
[chore]: GroupSearchScreen 주석 및 필터 수정 (#47)
rbqks529 Jul 17, 2025
8d24e65
[chore]: 기존 컴포넌트를 재활용 가능하게 수정 (#47)
rbqks529 Jul 17, 2025
22f1997
[ui]: BookSearchScreen 탑앱바 수정 (#47)
rbqks529 Jul 17, 2025
0f16607
[ui]: 책 상세 페이지(피드 없음) 구현 완료 (#47)
rbqks529 Jul 17, 2025
a8af0d4
[ui]: 책 상세페이지 모집중인 모임방 구현 완료 (#47)
rbqks529 Jul 17, 2025
d150312
[refactor]: 기타 수정 (#47)
rbqks529 Jul 17, 2025
e516df0
[refactor]: 책 상세 페이지 필터 버튼 로직 수정 (#47)
rbqks529 Jul 18, 2025
fa8cfbb
[refactor]: 기존 코드 수정 (#47)
rbqks529 Jul 18, 2025
52e2a9b
[refactor]: 리스트 명 수정 (#47)
rbqks529 Jul 18, 2025
63fccf3
[refactor]: 기타 수정 (#47)
rbqks529 Jul 18, 2025
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
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
package com.texthip.thip.ui.booksearch.component

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.width
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.unit.dp
import com.texthip.thip.R
import com.texthip.thip.ui.common.buttons.ActionMediumButton
import com.texthip.thip.ui.theme.ThipTheme.colors
import com.texthip.thip.ui.theme.ThipTheme.typography

@Composable
fun BookEmptyResult(
mainText: String,
subText: String,
onRequestBook: () -> Unit
) {
Column(
modifier = Modifier.fillMaxSize(),
verticalArrangement = Arrangement.Center,
horizontalAlignment = Alignment.CenterHorizontally
) {
Text(
text = mainText,
color = colors.White,
style = typography.smalltitle_sb600_s18_h24
)
Text(
text = subText,
modifier = Modifier.padding(top = 8.dp),
color = colors.Grey,
style = typography.copy_r400_s14
)
Spacer(Modifier.height(20.dp))

ActionMediumButton(
text = stringResource(R.string.group_register_book),
contentColor = colors.White,
backgroundColor = colors.Purple,
modifier = Modifier
.width(97.dp)
.height(44.dp),
onClick = { onRequestBook() },
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package com.texthip.thip.ui.booksearch.component

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.texthip.thip.R
import com.texthip.thip.ui.booksearch.mock.BookData
import com.texthip.thip.ui.common.cards.CardBookList
import com.texthip.thip.ui.theme.ThipTheme
import com.texthip.thip.ui.theme.ThipTheme.colors
import com.texthip.thip.ui.theme.ThipTheme.typography

@Composable
fun BookFilteredSearchResult(
resultCount: Int,
bookList: List<BookData>
) {
Column {
Row(
modifier = Modifier.fillMaxWidth(),
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = stringResource(R.string.group_searched_room_size, resultCount),
color = colors.Grey,
style = typography.menu_m500_s14_h24
)
}
Spacer(
modifier = Modifier
.padding(top = 4.dp, bottom = 20.dp)
.fillMaxWidth()
.height(1.dp)
.background(colors.DarkGrey02)
)

if (bookList.isEmpty()) {
BookEmptyResult(
mainText = stringResource(R.string.book_no_search_result1),
subText = stringResource(R.string.book_no_search_result2),
onRequestBook = { /*책 요청 처리*/ }
)
} else {
LazyColumn(
verticalArrangement = Arrangement.Center
) {
itemsIndexed(bookList) { index, book ->
CardBookList(
title = book.title,
author = book.author,
publisher = book.publisher,
imageRes = book.imageRes
)
if (index < bookList.size - 1) {
Spacer(
modifier = Modifier
.padding(top = 12.dp, bottom = 12.dp)
.fillMaxWidth()
.height(1.dp)
.background(colors.DarkGrey02)
)
}
}
}
}
}
}

Comment on lines +56 to +76

Copilot AI Jul 20, 2025

Copy link

Choose a reason for hiding this comment

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

The spacer logic should be moved outside the itemsIndexed block to avoid conditional rendering inside compose items, which can cause performance issues.

Suggested change
CardBookList(
title = book.title,
author = book.author,
publisher = book.publisher,
imageRes = book.imageRes
)
if (index < bookList.size - 1) {
Spacer(
modifier = Modifier
.padding(top = 12.dp, bottom = 12.dp)
.fillMaxWidth()
.height(1.dp)
.background(colors.DarkGrey02)
)
}
}
}
}
}
}
BookListItem(
book = book,
showSpacer = index < bookList.size - 1
)
}
}
}
}
}
@Composable
fun BookListItem(
book: BookData,
showSpacer: Boolean
) {
Column {
CardBookList(
title = book.title,
author = book.author,
publisher = book.publisher,
imageRes = book.imageRes
)
if (showSpacer) {
Spacer(
modifier = Modifier
.padding(top = 12.dp, bottom = 12.dp)
.fillMaxWidth()
.height(1.dp)
.background(colors.DarkGrey02)
)
}
}
}

Copilot uses AI. Check for mistakes.
@Preview
@Composable
fun PreviewBookFilteredSearchResult() {
ThipTheme {
BookFilteredSearchResult(
resultCount = 3,
bookList = listOf(
BookData(
title = "이기적 유전자",
author = "리처드 도킨스",
publisher = "을유문화사"
),
BookData(
title = "총, 균, 쇠",
author = "재레드 다이아몬드",
publisher = "문학사상사"
),
BookData(
title = "코스모스",
author = "칼 세이건",
publisher = "사이언스북스"
)
)
)
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package com.texthip.thip.ui.booksearch.component

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.lazy.LazyColumn
import androidx.compose.foundation.lazy.itemsIndexed
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import com.texthip.thip.ui.booksearch.mock.BookData
import com.texthip.thip.ui.common.cards.CardBookList
import com.texthip.thip.ui.theme.ThipTheme.colors

@Composable
fun BookLiveSearchResult(
bookList: List<BookData>
) {
LazyColumn(
verticalArrangement = Arrangement.Center
) {
itemsIndexed(bookList) { index, book ->
CardBookList(
title = book.title,
author = book.author,
publisher = book.publisher,
imageRes = book.imageRes
)
if (index < bookList.size - 1) {
Comment on lines +25 to +32

Copilot AI Jul 20, 2025

Copy link

Choose a reason for hiding this comment

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

The spacer logic should be moved outside the itemsIndexed block to avoid conditional rendering inside compose items, which can cause performance issues.

Suggested change
itemsIndexed(bookList) { index, book ->
CardBookList(
title = book.title,
author = book.author,
publisher = book.publisher,
imageRes = book.imageRes
)
if (index < bookList.size - 1) {
items(bookList.flatMapIndexed { index, book ->
if (index < bookList.size - 1) {
listOf(book, null) // Add a null to represent a spacer
} else {
listOf(book) // No spacer after the last item
}
}) { item ->
if (item != null) {
CardBookList(
title = item.title,
author = item.author,
publisher = item.publisher,
imageRes = item.imageRes
)
} else {

Copilot uses AI. Check for mistakes.
Spacer(
modifier = Modifier
.padding(top = 12.dp, bottom = 12.dp)
.fillMaxWidth()
.height(1.dp)
.background(colors.DarkGrey02)
)
}
}
}
}
Loading