Skip to content

Commit

Permalink
move #7 : seats 폴더로 구현 내용 옮김
Browse files Browse the repository at this point in the history
  • Loading branch information
tunaunnie committed Nov 21, 2024
1 parent 042476f commit 451e48f
Show file tree
Hide file tree
Showing 7 changed files with 114 additions and 52 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.sopt.cgv.core.common.norippleclick
import org.sopt.cgv.core.designsystem.theme.PrimaryRed400
import org.sopt.cgv.core.designsystem.theme.Typography
import org.sopt.cgv.core.designsystem.theme.White
Expand Down Expand Up @@ -65,7 +66,7 @@ fun ModalButton(
buttonType: String,
initialActivation: Boolean,
content: String,
length: String, //long, half로 사용
length: String,
){

var isActivated by remember { mutableStateOf(initialActivation) }
Expand All @@ -90,7 +91,7 @@ fun ModalButton(
else
Modifier
)
.clickable {
.norippleclick() {
/* Todo - behavior after cliking the button */
}
) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,13 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import org.sopt.cgv.core.designsystem.theme.Gray100
import org.sopt.cgv.core.designsystem.theme.Gray700
import org.sopt.cgv.core.designsystem.theme.Typography

@Composable
fun SeatChoiceModalChip(
fun Chip(
modifier: Modifier = Modifier,
type: String, //Date, Location, Time 으로 구분
content: String
){

Expand All @@ -39,9 +37,8 @@ fun SeatChoiceModalChip(
@Preview
@Composable
fun SeatChoiceModalChipPreview(){
SeatChoiceModalChip(
Chip(
modifier = Modifier,
type = "Date",
content = "2024.11.9 (토)"
)
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
package org.sopt.cgv.feature.seats

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.width
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import org.sopt.cgv.core.designsystem.component.chip.Chip
import androidx.compose.foundation.lazy.items
import androidx.compose.ui.Alignment

@Composable
fun SeatSelectionChipRow(
modifier: Modifier = Modifier,
contents: List<String>,
){
Row(
horizontalArrangement = Arrangement.spacedBy(8.dp, Alignment.CenterHorizontally),
modifier = modifier.fillMaxWidth()
) {
contents.forEach {
chipContent ->
Chip(content = chipContent)
}
}

}


@Preview(showBackground = true)
@Composable
fun SeatSelectionChipRowPreview(){
val ChipContents = listOf(
"2024.11.05 (월)",
"구리",
"10:40 ~ 12:39"
)
SeatSelectionChipRow(contents = ChipContents)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package org.sopt.cgv.core.designsystem.component.bottomsheet
package org.sopt.cgv.feature.seats

import androidx.compose.foundation.BorderStroke
import androidx.compose.foundation.layout.*
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.*
import androidx.compose.runtime.*
Expand All @@ -10,16 +10,16 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import kotlinx.coroutines.launch
import org.sopt.cgv.core.designsystem.component.button.ModalButton
import org.sopt.cgv.core.designsystem.component.button.Stepper
import org.sopt.cgv.core.designsystem.component.chip.SeatChoiceModalChip
import org.sopt.cgv.core.designsystem.theme.Black
import org.sopt.cgv.core.designsystem.theme.Typography
import org.sopt.cgv.core.designsystem.component.chip.Chip

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun SeatScreenModal1(
fun SeatSelectionModal1(
seatSelectionMovieTitle: String,
chipContents: List<String>,
onBackClick: () -> Unit,
onSeatSelectionClick: () -> Unit
) {
Expand All @@ -37,21 +37,14 @@ fun SeatScreenModal1(
.fillMaxWidth()
) {
Text(
text = "글래디에이터 2",
text = seatSelectionMovieTitle,
style = Typography.head6_b_17,
modifier = Modifier.align(Alignment.CenterHorizontally)
)

Spacer(modifier = Modifier.height(16.dp))

Row(
horizontalArrangement = Arrangement.SpaceEvenly,
modifier = Modifier.fillMaxWidth()
) {
SeatChoiceModalChip(type = "Date", content = "2024.11.05 (월)")
SeatChoiceModalChip(type = "Location", content = "구리")
SeatChoiceModalChip(type = "Time", content = "10:40 ~ 12:39")
}
SeatSelectionChipRow(contents = chipContents)

Spacer(modifier = Modifier.height(24.dp))

Expand All @@ -77,7 +70,7 @@ fun SeatScreenModal1(

Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.spacedBy(16.dp)
horizontalArrangement = Arrangement.Center
) {
ModalButton(
modifier = Modifier,
Expand All @@ -86,6 +79,9 @@ fun SeatScreenModal1(
content = "뒤로가기",
length = "half"
)

Spacer(modifier = Modifier.width(16.dp))

ModalButton(
modifier = Modifier,
buttonType = "Choice",
Expand All @@ -99,33 +95,19 @@ fun SeatScreenModal1(
}


@Composable
fun StepperRow(label: String) {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = label,
style = Typography.body4_m_15,
color = Color.Black
)
Stepper(
modifier = Modifier,
initialValue = 0,
onValueChange = { newValue ->
println("$label 인원: $newValue")
}
)
}
}


@Preview(showBackground = true)
@Composable
fun ReservationBottomSheetPreview() {
SeatScreenModal1(
fun SeatSelectionModal1Preview() {

val ChipContents = listOf(
"2024.11.05 (월)",
"구리",
"10:40 ~ 12:39"
)

SeatSelectionModal1(
seatSelectionMovieTitle = "글래디에이터 2",
chipContents = ChipContents,
onBackClick = { },
onSeatSelectionClick = { }
)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
package org.sopt.cgv.feature.seats

import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.tooling.preview.Preview
import org.sopt.cgv.core.designsystem.theme.Typography

@Composable
fun StepperRow(label: String) {
Row(
modifier = Modifier.fillMaxWidth(),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
Text(
text = label,
style = Typography.body4_m_15,
color = Color.Black
)
Stepper(
modifier = Modifier,
initialValue = 0,
onValueChange = { newValue ->
println("$label 인원: $newValue")
}
)
}
}

@Preview(showBackground = true)
@Composable
fun StepperRowPreview(){
StepperRow(
label = "하이"
)
}
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package org.sopt.cgv.core.designsystem.component.button
package org.sopt.cgv.feature.seats

import androidx.compose.foundation.background
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Row
Expand All @@ -23,7 +22,6 @@ import androidx.compose.ui.graphics.Color
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import androidx.compose.ui.unit.sp
import org.sopt.cgv.R
import org.sopt.cgv.core.common.norippleclick
import org.sopt.cgv.core.designsystem.theme.Gray100
Expand Down
1 change: 0 additions & 1 deletion gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,6 @@ retrofit = { group = "com.squareup.retrofit2", name = "retrofit", version.ref =
retrofit-kotlin-serialization-converter = { group = "com.jakewharton.retrofit", name = "retrofit2-kotlinx-serialization-converter", version.ref = "retrofitKotlinSerializationConverter" }
kotlinx-serialization-json = { group = "org.jetbrains.kotlinx", name = "kotlinx-serialization-json", version.ref = "kotlinxSerializationJson" }


[plugins]
android-application = { id = "com.android.application", version.ref = "agp" }
kotlin-android = { id = "org.jetbrains.kotlin.android", version.ref = "kotlin" }
Expand Down

0 comments on commit 451e48f

Please sign in to comment.