Skip to content

Commit

Permalink
[REFACTOR/#9] 리뷰 기반 리팩토링
Browse files Browse the repository at this point in the history
  • Loading branch information
boiledEgg-s committed Jul 7, 2024
1 parent 110230c commit c9680c0
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.unit.dp
import androidx.hilt.navigation.compose.hiltViewModel
import com.terning.core.designsystem.theme.Grey200
import com.terning.feature.calendar.component.CalendarTopBar
import com.terning.feature.calendar.component.WeekDaysHeader
import com.terning.feature.calendar.models.CalendarState
import kotlinx.coroutines.flow.distinctUntilChanged
import kotlinx.coroutines.launch
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.terning.feature.calendar
package com.terning.feature.calendar.component

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.terning.feature.calendar
package com.terning.feature.calendar.component

import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Row
Expand All @@ -12,7 +12,6 @@ import androidx.compose.ui.res.stringResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import com.terning.core.designsystem.theme.Black
import com.terning.core.designsystem.theme.SundayRed
import com.terning.core.designsystem.theme.TerningTheme
Expand Down Expand Up @@ -44,7 +43,6 @@ fun WeekDaysHeader(
text = stringResource(id = day),
style = TerningTheme.typography.body7,
color = if(day == R.string.calendar_text_sunday) SundayRed else Black,
fontSize = 13.sp,
textAlign = TextAlign.Center
)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,13 +40,10 @@ class CalendarState internal constructor(
}
}

fun getPageCount(): Int {
return (END_YEAR - START_YEAR) * 12
}
fun getPageCount(): Int = (END_YEAR - START_YEAR) * 12

fun getInitialPage(): Int {
return (firstVisibleMonth.year - START_YEAR) * 12 + firstVisibleMonth.monthValue - 1
}
fun getInitialPage(): Int =
(firstVisibleMonth.year - START_YEAR) * 12 + firstVisibleMonth.monthValue - 1

companion object {
const val START_YEAR = 2020
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import androidx.navigation.compose.currentBackStackEntryAsState
import androidx.navigation.compose.rememberNavController
import androidx.navigation.navOptions
import com.terning.feature.calendar.navigation.navigateCalendar
import com.terning.feature.home.navigation.Home
import com.terning.feature.home.navigation.navigateHome
import com.terning.feature.mypage.navigation.navigateMyPage
import com.terning.feature.onboarding.signin.navigation.SignIn
Expand All @@ -22,7 +23,7 @@ class MainNavigator(
@Composable get() = navController
.currentBackStackEntryAsState().value?.destination

val startDestination = SignIn
val startDestination = Home

val currentTab: MainTab?
@Composable get() = MainTab.find { tab ->
Expand Down

0 comments on commit c9680c0

Please sign in to comment.