File tree Expand file tree Collapse file tree 3 files changed +9
-13
lines changed
core/model/src/main/kotlin/com/ninecraft/booket/core/model
feature/search/src/main/kotlin/com/ninecraft/booket/feature/search/book Expand file tree Collapse file tree 3 files changed +9
-13
lines changed Original file line number Diff line number Diff line change @@ -27,4 +27,11 @@ data class BookSummaryModel(
2727 val link : String = " " ,
2828 val userBookStatus : String = " " ,
2929 val key : String = " " ,
30- )
30+ ) {
31+ val isRegistered: Boolean
32+ get() = userBookStatus != BEFORE_REGISTRATION
33+
34+ companion object {
35+ const val BEFORE_REGISTRATION = " BEFORE_REGISTRATION"
36+ }
37+ }
Original file line number Diff line number Diff line change @@ -222,7 +222,7 @@ internal fun BookSearchContent(
222222 onBookClick = { book ->
223223 state.eventSink(BookSearchUiEvent .OnBookClick (book.isbn13))
224224 },
225- enabled = BookRegisteredState .from( state.books[index].userBookStatus) == BookRegisteredState . BEFORE_REGISTRATION ,
225+ enabled = ! state.books[index].isRegistered ,
226226 )
227227 HorizontalDivider (
228228 modifier = Modifier .fillMaxWidth(),
Original file line number Diff line number Diff line change @@ -64,14 +64,3 @@ sealed interface BookSearchUiEvent : CircuitUiEvent {
6464 data object OnBookRegisterSuccessOkButtonClick : BookSearchUiEvent
6565 data object OnBookRegisterSuccessCancelButtonClick : BookSearchUiEvent
6666}
67-
68- enum class BookRegisteredState (val value : String ) {
69- BEFORE_REGISTRATION (" BEFORE_REGISTRATION" ),
70- ;
71-
72- companion object {
73- fun from (value : String? ): BookRegisteredState ? {
74- return entries.find { it.value == value }
75- }
76- }
77- }
You can’t perform that action at this time.
0 commit comments