diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyDeadlineContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyDeadlineContent.kt index 21b71db4..689e3e5e 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyDeadlineContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyDeadlineContent.kt @@ -100,7 +100,7 @@ internal fun SurveyDeadlineContent( WappButton( textRes = R.string.register_survey, onClick = onRegisterButtonClicked, - modifier = Modifier.padding(bottom = 20.dp), + modifier = Modifier.padding(bottom = 16.dp), ) } } diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyEventSelectionContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyEventSelectionContent.kt index 55df7eac..a78ddcb2 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyEventSelectionContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyEventSelectionContent.kt @@ -6,6 +6,7 @@ import androidx.compose.foundation.layout.Arrangement import androidx.compose.foundation.layout.Column import androidx.compose.foundation.layout.fillMaxSize import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.heightIn import androidx.compose.foundation.layout.padding import androidx.compose.foundation.lazy.LazyColumn import androidx.compose.foundation.lazy.items @@ -25,7 +26,7 @@ import com.wap.wapp.feature.management.survey.R @Composable internal fun SurveyEventSelectionContent( eventList: List, - eventSelection: Event, + selectedEvent: Event, onEventSelected: (Event) -> Unit, onNextButtonClicked: () -> Unit, ) { @@ -40,47 +41,62 @@ internal fun SurveyEventSelectionContent( LazyColumn( verticalArrangement = Arrangement.spacedBy(16.dp), + modifier = Modifier.heightIn(max = 400.dp), ) { items(eventList) { event -> - Card( - colors = CardDefaults.cardColors( - containerColor = WappTheme.colors.black25, - ), - modifier = Modifier - .fillMaxWidth() - .clickable { onEventSelected(event) }, - border = BorderStroke( - color = if (event.eventId == eventSelection.eventId) { - WappTheme.colors.yellow34 - } else { - WappTheme.colors.black25 - }, - width = 1.dp, - ), - ) { - Column( - verticalArrangement = Arrangement.spacedBy(8.dp), - modifier = Modifier.padding(16.dp), - ) { - Text( - text = event.title, - style = WappTheme.typography.titleBold, - color = WappTheme.colors.white, - ) - - Text( - text = event.content, - style = WappTheme.typography.captionMedium, - color = WappTheme.colors.yellow34, - ) - } - } + EventCard( + event = event, + selectedEvent = selectedEvent, + onEventSelected = onEventSelected, + ) } } WappButton( textRes = R.string.next, onClick = onNextButtonClicked, + modifier = Modifier.padding(bottom = 16.dp), ) } } + +@Composable +private fun EventCard( + event: Event, + selectedEvent: Event, + onEventSelected: (Event) -> Unit, +) { + Card( + colors = CardDefaults.cardColors( + containerColor = WappTheme.colors.black25, + ), + modifier = Modifier + .fillMaxWidth() + .clickable { onEventSelected(event) }, + border = BorderStroke( + color = if (event.eventId == selectedEvent.eventId) { + WappTheme.colors.yellow34 + } else { + WappTheme.colors.black25 + }, + width = 1.dp, + ), + ) { + Column( + verticalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier.padding(16.dp), + ) { + Text( + text = event.title, + style = WappTheme.typography.titleBold, + color = WappTheme.colors.white, + ) + + Text( + text = event.content, + style = WappTheme.typography.captionMedium, + color = WappTheme.colors.yellow34, + ) + } + } +} diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyInformationContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyInformationContent.kt index bc060227..fb101bb7 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyInformationContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyInformationContent.kt @@ -77,6 +77,7 @@ internal fun SurveyInformationContent( WappButton( onClick = onNextButtonClicked, textRes = R.string.next, + modifier = Modifier.padding(bottom = 16.dp), ) } } diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyQuestionContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyQuestionContent.kt index dc12447b..e4d39070 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyQuestionContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyQuestionContent.kt @@ -243,6 +243,7 @@ private fun SurveyQuestionButton( ) { Row( horizontalArrangement = Arrangement.spacedBy(8.dp), + modifier = Modifier.padding(bottom = 16.dp), ) { WappButton( onClick = onAddSurveyQuestionButtonClicked, diff --git a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyRegistrationContent.kt b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyRegistrationContent.kt index c7304138..a67b386e 100644 --- a/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyRegistrationContent.kt +++ b/feature/management-survey/src/main/java/com/wap/wapp/feature/management/survey/registration/SurveyRegistrationContent.kt @@ -44,7 +44,7 @@ internal fun SurveyRegistrationContent( onEventListChanged() SurveyEventSelectionContent( eventList = eventList, - eventSelection = eventSelection, + selectedEvent = eventSelection, // default prefix -> 함수 parameter <-> 콜백 함수 parameter conflict onEventSelected = onEventSelected, onNextButtonClicked = { onNextButtonClicked(SurveyRegistrationState.INFORMATION) }, diff --git a/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt b/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt index 69a61d1c..07e97f45 100644 --- a/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt +++ b/feature/management/src/main/java/com/wap/wapp/feature/management/ManagementScreen.kt @@ -4,15 +4,10 @@ package com.wap.wapp.feature.management import android.content.Context import android.widget.Toast import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.WindowInsets import androidx.compose.foundation.layout.padding -import androidx.compose.material3.ExperimentalMaterial3Api import androidx.compose.material3.Scaffold import androidx.compose.material3.SnackbarHost import androidx.compose.material3.SnackbarHostState -import androidx.compose.material3.Text -import androidx.compose.material3.TopAppBar -import androidx.compose.material3.TopAppBarDefaults import androidx.compose.runtime.Composable import androidx.compose.runtime.LaunchedEffect import androidx.compose.runtime.getValue @@ -23,8 +18,6 @@ import androidx.compose.runtime.setValue import androidx.compose.ui.Modifier import androidx.compose.ui.graphics.Color import androidx.compose.ui.platform.LocalContext -import androidx.compose.ui.res.stringResource -import androidx.compose.ui.unit.dp import androidx.hilt.navigation.compose.hiltViewModel import androidx.lifecycle.compose.collectAsStateWithLifecycle import com.wap.designsystem.WappTheme @@ -86,7 +79,6 @@ internal fun ManagementRoute( } } -@OptIn(ExperimentalMaterial3Api::class) @Composable internal fun ManagementScreen( snackBarHostState: SnackbarHostState,