Skip to content

Commit

Permalink
[UI] #93 : Bottom Button 하단 padding 적용
Browse files Browse the repository at this point in the history
  • Loading branch information
jeongjaino committed Jan 8, 2024
1 parent 5d5897c commit 4c488b3
Show file tree
Hide file tree
Showing 6 changed files with 54 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -25,7 +26,7 @@ import com.wap.wapp.feature.management.survey.R
@Composable
internal fun SurveyEventSelectionContent(
eventList: List<Event>,
eventSelection: Event,
selectedEvent: Event,
onEventSelected: (Event) -> Unit,
onNextButtonClicked: () -> Unit,
) {
Expand All @@ -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,
)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ internal fun SurveyInformationContent(
WappButton(
onClick = onNextButtonClicked,
textRes = R.string.next,
modifier = Modifier.padding(bottom = 16.dp),
)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -243,6 +243,7 @@ private fun SurveyQuestionButton(
) {
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp),
modifier = Modifier.padding(bottom = 16.dp),
) {
WappButton(
onClick = onAddSurveyQuestionButtonClicked,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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) },
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -86,7 +79,6 @@ internal fun ManagementRoute(
}
}

@OptIn(ExperimentalMaterial3Api::class)
@Composable
internal fun ManagementScreen(
snackBarHostState: SnackbarHostState,
Expand Down

0 comments on commit 4c488b3

Please sign in to comment.