Skip to content

Commit

Permalink
Feature #247: Create PriceWarningMessage
Browse files Browse the repository at this point in the history
  • Loading branch information
0se0 committed Nov 6, 2024
1 parent 03e65d6 commit cb66683
Showing 1 changed file with 105 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
package com.hankki.feature.storedetail.component

import android.graphics.drawable.Icon
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.Row
import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Icon
import androidx.compose.material3.Surface
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.unit.dp
import com.hankki.core.common.extension.noRippleClickable
import com.hankki.core.designsystem.theme.Gray200
import com.hankki.core.designsystem.theme.Gray300
import com.hankki.core.designsystem.theme.Gray50
import com.hankki.core.designsystem.theme.Gray600
import com.hankki.core.designsystem.theme.Gray850
import com.hankki.core.designsystem.theme.HankkiTheme
import com.hankki.core.designsystem.theme.WarnRed
import com.hankki.core.designsystem.theme.White
import com.hankki.feature.storedetail.R

@Composable
fun PriceWarningMessage(
onDeleteClick: () -> Unit,
onDismissClick: () -> Unit = {}
) {
Row(
modifier = Modifier
.fillMaxWidth()
.border(
width = 1.dp,
color = Gray200,
shape = RoundedCornerShape(8.dp)
)
.background(
color = Gray50,
shape = RoundedCornerShape(8.dp)
)
.padding(
start = 24.dp,
top = 16.dp,
bottom = 16.dp,
end = 16.dp
),
horizontalArrangement = Arrangement.SpaceBetween,
verticalAlignment = Alignment.CenterVertically
) {
Column(
modifier = Modifier.weight(1f)
) {
Text(
text = "가격이 올랐군요",
style = HankkiTheme.typography.body8,
color = Gray600
)
Text(
text = "8천원 이상은 메뉴 삭제를 추천해요",
style = HankkiTheme.typography.body5,
color = Gray850
)
}

Row(
horizontalArrangement = Arrangement.spacedBy(14.dp),
verticalAlignment = Alignment.CenterVertically
) {
Surface(
modifier = Modifier
.noRippleClickable(onClick = onDeleteClick),
color = WarnRed,
shape = RoundedCornerShape(8.dp)
) {
Text(
text = "삭제하기",
style = HankkiTheme.typography.body3,
color = White,
modifier = Modifier.padding(
horizontal = 8.dp,
vertical = 6.dp
)
)
}

Icon(
painter = painterResource(R.drawable.ic_cancel),
contentDescription = "닫기",
modifier = Modifier
.size(20.dp)
.noRippleClickable(onClick = onDismissClick),
tint = Gray300
)
}
}
}

0 comments on commit cb66683

Please sign in to comment.