Skip to content

Commit

Permalink
[REFACTOR/#181] 캡슐화 및 리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
boiledEgg-s committed Aug 16, 2024
1 parent f8f1394 commit 5bc47b3
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ import androidx.hilt.navigation.compose.hiltViewModel
import androidx.lifecycle.compose.LocalLifecycleOwner
import androidx.lifecycle.compose.collectAsStateWithLifecycle
import com.terning.core.state.UiState
import com.terning.feature.calendar.calendar.model.CalendarUiState
import com.terning.feature.calendar.calendar.CalendarViewModel
import com.terning.feature.calendar.calendar.model.CalendarModel.Companion.getDateByPage
import com.terning.feature.calendar.calendar.model.CalendarUiState
import com.terning.feature.calendar.month.component.HorizontalCalendar
import kotlinx.coroutines.flow.distinctUntilChanged
import java.time.LocalDate

@Composable
fun CalendarMonthScreen(
internal fun CalendarMonthScreen(
pages: Int,
listState: LazyListState,
calendarUiState: CalendarUiState,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import java.time.LocalDate
import java.time.YearMonth

@Composable
fun CalendarMonth(
internal fun CalendarMonth(
isWeekEnabled: Boolean,
monthModel: MonthModel,
onDateSelected: (LocalDate) -> Unit,
Expand Down Expand Up @@ -82,7 +82,7 @@ fun CalendarMonth(

@Preview(showBackground = true)
@Composable
fun CalendarMonthPreview() {
private fun CalendarMonthPreview() {
TerningPointTheme {
CalendarMonth(
monthModel = MonthModel(YearMonth.now()),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,19 @@ import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.text.style.TextOverflow
import androidx.compose.ui.unit.dp
import com.terning.core.designsystem.theme.TerningTheme
import com.terning.core.designsystem.theme.White
import com.terning.domain.entity.CalendarScrap
import com.terning.feature.R

private const val MAX_SCRAP_COUNT = 3

@Composable
fun CalendarMonthScrap(
internal fun CalendarMonthScrap(
modifier: Modifier = Modifier,
scrapLists: List<CalendarScrap>
) {
Expand Down Expand Up @@ -47,7 +51,7 @@ fun CalendarMonthScrap(
item {
if (scrapLists.size > MAX_SCRAP_COUNT) {
Text(
text = "+${(scrapLists.size - MAX_SCRAP_COUNT)}",
text = stringResource(id = R.string.calendar_scrap_overflow, (scrapLists.size - MAX_SCRAP_COUNT)),
style = TerningTheme.typography.detail4,
textAlign = TextAlign.Center,
modifier = Modifier.fillMaxWidth()
Expand All @@ -57,5 +61,3 @@ fun CalendarMonthScrap(
}
}

private const val MAX_SCRAP_COUNT = 3

1 change: 1 addition & 0 deletions feature/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
<string name="calendar_button_description_list">list</string>
<string name="calendar_animation_label">Calendar Transition</string>
<string name="calendar_empty_scrap">선택하신 날짜에 지원 마감인 스크랩 공고가 없어요</string>
<string name="calendar_scrap_overflow">+%s</string>

<!--Home-->
<string name="home_today_title">오늘 마감되는 %s님의 관심 공고</string>
Expand Down

0 comments on commit 5bc47b3

Please sign in to comment.