Skip to content

Commit

Permalink
refactor: @PreviewParameterProvider 적용
Browse files Browse the repository at this point in the history
각 화면의 component 파일별로 분리 -> preview 적용
  • Loading branch information
medi-jihun-lee committed Aug 26, 2024
1 parent 088d39f commit e644475
Show file tree
Hide file tree
Showing 46 changed files with 1,666 additions and 1,317 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ fun BoothFilterChip(

@ComponentPreview
@Composable
fun BoothFilterChipPreview() {
private fun BoothFilterChipPreview() {
UnifestTheme {
BoothFilterChip(
filterName = "주점",
Expand All @@ -67,7 +67,7 @@ fun BoothFilterChipPreview() {

@ComponentPreview
@Composable
fun SelectedBoothFilterChipPreview() {
private fun SelectedBoothFilterChipPreview() {
UnifestTheme {
BoothFilterChip(
filterName = "주점",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ fun UnifestButton(

@ComponentPreview
@Composable
fun UnifestButtonPreview() {
private fun UnifestButtonPreview() {
UnifestTheme {
UnifestButton(
onClick = {},
Expand All @@ -60,7 +60,7 @@ fun UnifestButtonPreview() {

@ComponentPreview
@Composable
fun UnifestDisabledButtonPreview() {
private fun UnifestDisabledButtonPreview() {
UnifestTheme {
UnifestButton(
onClick = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,22 +708,23 @@ fun WaitingCancelDialog(

@ComponentPreview
@Composable
fun ServerErrorDialogPreview() {
private fun ServerErrorDialogPreview() {
UnifestTheme {
ServerErrorDialog(onRetryClick = {})
}
}

@ComponentPreview
@Composable
fun NetworkErrorDialogPreview() {
private fun NetworkErrorDialogPreview() {
UnifestTheme {
NetworkErrorDialog(onRetryClick = {})
}
}

@ComponentPreview
@Composable
fun LikedFestivalDeleteDialogPreview() {
private fun LikedFestivalDeleteDialogPreview() {
UnifestTheme {
LikedFestivalDeleteDialog(
onCancelClick = {},
Expand All @@ -734,7 +735,7 @@ fun LikedFestivalDeleteDialogPreview() {

@ComponentPreview
@Composable
fun AppUpdateDialogPreview() {
private fun AppUpdateDialogPreview() {
UnifestTheme {
AppUpdateDialog(
onDismissRequest = {},
Expand All @@ -745,7 +746,7 @@ fun AppUpdateDialogPreview() {

@ComponentPreview
@Composable
fun WaitingPinDialogPreview() {
private fun WaitingPinDialogPreview() {
UnifestTheme {
WaitingPinDialog(
boothName = "컴공 주점",
Expand All @@ -760,7 +761,7 @@ fun WaitingPinDialogPreview() {

@ComponentPreview
@Composable
fun WaitingDialogPreview() {
private fun WaitingDialogPreview() {
UnifestTheme {
WaitingDialog(
boothName = "컴공 주점",
Expand All @@ -782,7 +783,7 @@ fun WaitingDialogPreview() {

@ComponentPreview
@Composable
fun WaitingConfirmDialogPreview() {
private fun WaitingConfirmDialogPreview() {
UnifestTheme {
WaitingConfirmDialog(
boothName = "컴공 주점",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ fun UnifestHorizontalDivider(

@ComponentPreview
@Composable
fun UnifestHorizontalDividerPreview() {
private fun UnifestHorizontalDividerPreview() {
UnifestTheme {
UnifestHorizontalDivider()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ fun LoadingWheel(

@ComponentPreview
@Composable
fun LoadingWheelPreview() {
private fun LoadingWheelPreview() {
UnifestTheme {
LoadingWheel()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ fun NetworkImage(

@ComponentPreview
@Composable
fun NetworkImagePreview() {
private fun NetworkImagePreview() {
UnifestTheme {
NetworkImage(
imgUrl = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ fun UnifestOutlinedButton(

@ComponentPreview
@Composable
fun UnifestOutlinedButtonPreview() {
private fun UnifestOutlinedButtonPreview() {
UnifestTheme {
UnifestOutlinedButton(
onClick = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ fun FestivalSearchTextField(

@ComponentPreview
@Composable
fun SearchTextFieldPreview() {
private fun SearchTextFieldPreview() {
UnifestTheme {
SearchTextField(
searchText = TextFieldValue(),
Expand All @@ -233,7 +233,7 @@ fun SearchTextFieldPreview() {

@ComponentPreview
@Composable
fun FestivalSearchTextFieldPreview() {
private fun FestivalSearchTextFieldPreview() {
UnifestTheme {
FestivalSearchTextField(
searchText = TextFieldValue("건국대학교"),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ fun SchoolSearchTitleWithToolTip(

@ComponentPreview
@Composable
fun LikedFestivalToolTipPreview() {
private fun LikedFestivalToolTipPreview() {
UnifestTheme {
LikedFestivalToolTip(
completeOnboarding = {},
Expand All @@ -149,7 +149,7 @@ fun LikedFestivalToolTipPreview() {

@ComponentPreview
@Composable
fun SchoolSearchTitleWithToolTipPreview() {
private fun SchoolSearchTitleWithToolTipPreview() {
UnifestTheme {
SchoolSearchTitleWithToolTip(
title = "건국대학교",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ fun SchoolSearchTitle(

@ComponentPreview
@Composable
fun UnifestTopAppBarPreview() {
private fun UnifestTopAppBarPreview() {
UnifestTheme {
UnifestTopAppBar(
navigationType = TopAppBarNavigationType.None,
Expand All @@ -148,7 +148,7 @@ fun UnifestTopAppBarPreview() {

@ComponentPreview
@Composable
fun SchoolSearchTitlePreview() {
private fun SchoolSearchTitlePreview() {
UnifestTheme {
SchoolSearchTitle(
title = "건국대학교",
Expand All @@ -159,7 +159,7 @@ fun SchoolSearchTitlePreview() {

@ComponentPreview
@Composable
fun UnifestTopAppBarWithBackButtonPreview() {
private fun UnifestTopAppBarWithBackButtonPreview() {
UnifestTheme {
UnifestTopAppBar(
navigationType = TopAppBarNavigationType.Back,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ fun BoothFilterChips(

@ComponentPreview
@Composable
fun BoothFilterChipsPreview() {
private fun BoothFilterChipsPreview() {
UnifestTheme {
BoothFilterChips(
onChipClick = {},
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ fun EmptyLikedBoothItem(

@ComponentPreview
@Composable
fun EmptyLikedBoothItemPreview() {
private fun EmptyLikedBoothItemPreview() {
UnifestTheme {
EmptyLikedBoothItem(
modifier = Modifier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
Expand Down Expand Up @@ -50,9 +49,7 @@ fun LikedBoothItem(
.padding(horizontal = 20.dp),
) {
Spacer(modifier = Modifier.height(16.dp))
Row(
modifier = Modifier.fillMaxSize(),
) {
Row {
NetworkImage(
imgUrl = booth.thumbnail,
contentDescription = "Booth Thumbnail",
Expand Down Expand Up @@ -124,7 +121,7 @@ fun LikedBoothItem(

@ComponentPreview
@Composable
fun LikedBoothItemPreview() {
private fun LikedBoothItemPreview() {
UnifestTheme {
LikedBoothItem(
booth = LikedBoothModel(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,30 +162,29 @@ fun FestivalItem(

@ComponentPreview
@Composable
fun FestivalItemPreview() {
val festival = FestivalModel(
1,
1,
"https://picsum.photos/36",
"서울대학교",
"서울",
"설대축제",
"2024-04-21",
"2024-04-23",
126.957f,
37.460f,
)
private fun FestivalItemPreview() {
UnifestTheme {
FestivalItem(
festival = festival,
festival = FestivalModel(
1,
1,
"https://picsum.photos/36",
"서울대학교",
"서울",
"설대축제",
"2024-04-21",
"2024-04-23",
126.957f,
37.460f,
),
onFestivalSelected = {},
)
}
}

@ComponentPreview
@Composable
fun LikedFestivalsGridPreview() {
private fun LikedFestivalsGridPreview() {
val selectedFestivals = persistentListOf<FestivalModel>()
repeat(5) {
selectedFestivals.add(
Expand Down Expand Up @@ -214,7 +213,7 @@ fun LikedFestivalsGridPreview() {

@ComponentPreview
@Composable
fun LikedFestivalsGridEditModePreview() {
private fun LikedFestivalsGridEditModePreview() {
val selectedFestivals = persistentListOf<FestivalModel>()
repeat(5) {
selectedFestivals.add(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ fun StarImage(

@ComponentPreview
@Composable
fun StarImagePreview() {
private fun StarImagePreview() {
UnifestTheme {
StarImage(
imgUrl = "",
Expand All @@ -75,7 +75,7 @@ fun StarImagePreview() {

@ComponentPreview
@Composable
fun StarImageClickedPreview() {
private fun StarImageClickedPreview() {
UnifestTheme {
StarImage(
imgUrl = "",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,12 +52,11 @@ import com.unifest.android.core.designsystem.theme.Content3
import com.unifest.android.core.designsystem.theme.DarkGrey100
import com.unifest.android.core.designsystem.theme.Title2
import com.unifest.android.core.designsystem.theme.UnifestTheme
import com.unifest.android.core.model.BoothDetailModel
import com.unifest.android.core.ui.DevicePreview
import com.unifest.android.feature.booth.component.BoothBottomBar
import com.unifest.android.feature.booth.component.BoothDescription
import com.unifest.android.feature.booth.component.MenuItem
import com.unifest.android.feature.booth.preview.BoothDetailUiStatePreviewParameterProvider
import com.unifest.android.feature.booth.preview.BoothDetailPreviewParameterProvider
import com.unifest.android.feature.booth.viewmodel.BoothUiAction
import com.unifest.android.feature.booth.viewmodel.BoothUiEvent
import com.unifest.android.feature.booth.viewmodel.BoothUiState
Expand Down Expand Up @@ -309,13 +308,13 @@ fun BoothDetailContent(
@DevicePreview
@Composable
private fun BoothScreenPreview(
@PreviewParameter(BoothDetailUiStatePreviewParameterProvider::class)
boothDetailInfo: BoothDetailModel,
@PreviewParameter(BoothDetailPreviewParameterProvider::class)
boothUiState: BoothUiState,
) {
UnifestTheme {
BoothDetailScreen(
padding = PaddingValues(),
uiState = BoothUiState(boothDetailInfo = boothDetailInfo),
uiState = boothUiState,
snackBarState = SnackbarHostState(),
onAction = {},
)
Expand Down
Loading

0 comments on commit e644475

Please sign in to comment.