@@ -38,36 +38,36 @@ import com.eatssu.design_system.theme.Warning
3838import com.eatssu.design_system.theme.WarningBg
3939import com.eatssu.design_system.theme.WarningBr
4040
41- enum class EatSsuToastType {
41+ enum class EatSsuSnackbarType {
4242 Success , Danger , Info , Warning
4343}
4444
45- private data class EatSsuToastColor (
45+ private data class EatSsuSnackbarColor (
4646 val container : Color ,
4747 val stroke : Color ,
4848 val action : Color
4949)
5050
51- private fun EatSsuToastType .colors (): EatSsuToastColor = when (this ) {
52- EatSsuToastType .Success -> EatSsuToastColor (
51+ private fun EatSsuSnackbarType .colors (): EatSsuSnackbarColor = when (this ) {
52+ EatSsuSnackbarType .Success -> EatSsuSnackbarColor (
5353 container = SuccessBg ,
5454 stroke = SuccessBr ,
5555 action = Success
5656 )
5757
58- EatSsuToastType .Danger -> EatSsuToastColor (
58+ EatSsuSnackbarType .Danger -> EatSsuSnackbarColor (
5959 container = DangerBg ,
6060 stroke = DangerBr ,
6161 action = Danger
6262 )
6363
64- EatSsuToastType .Info -> EatSsuToastColor (
64+ EatSsuSnackbarType .Info -> EatSsuSnackbarColor (
6565 container = InfoBg ,
6666 stroke = InfoBr ,
6767 action = Info
6868 )
6969
70- EatSsuToastType .Warning -> EatSsuToastColor (
70+ EatSsuSnackbarType .Warning -> EatSsuSnackbarColor (
7171 container = WarningBg ,
7272 stroke = WarningBr ,
7373 action = Warning
@@ -79,7 +79,7 @@ fun EatSsuSnackbarHost(
7979 hostState : SnackbarHostState ,
8080 modifier : Modifier = Modifier ,
8181 icon : Painter ? = null,
82- type : EatSsuToastType = EatSsuToastType .Info ,
82+ type : EatSsuSnackbarType = EatSsuSnackbarType .Info ,
8383) {
8484 SnackbarHost (
8585 hostState = hostState,
@@ -98,14 +98,14 @@ fun EatSsuSnackbar(
9898 snackbarData : SnackbarData ,
9999 modifier : Modifier = Modifier ,
100100 icon : Painter ? = null,
101- type : EatSsuToastType = EatSsuToastType .Info ,
101+ type : EatSsuSnackbarType = EatSsuSnackbarType .Info ,
102102) {
103103 val colors = type.colors()
104104
105105 Surface (
106106 shape = RoundedCornerShape (12 .dp),
107107 border = BorderStroke (1 .dp, colors.stroke),
108- color = Color .Transparent , // Snackbar 자체의 containerColor를 쓰기 위해 투명 처리
108+ color = Color .Transparent ,
109109 modifier = modifier.padding(vertical = 14 .dp, horizontal = 16 .dp)
110110 ) {
111111 Snackbar (
@@ -131,7 +131,6 @@ fun EatSsuSnackbar(
131131 horizontalArrangement = Arrangement .spacedBy(8 .dp),
132132 ) {
133133 if (icon != null ) {
134- // todo 제훈 pr에 리소스 있음
135134 androidx.compose.material3.Icon (
136135 painter = icon,
137136 contentDescription = null ,
@@ -151,7 +150,6 @@ fun EatSsuSnackbar(
151150 }
152151}
153152
154-
155153private class PreviewSnackbarData (
156154 message : String ,
157155 actionLabel : String? = null
@@ -180,7 +178,8 @@ private fun EatSsuSnackbarPreview() {
180178 actionLabel = " 취소"
181179 ),
182180 modifier = Modifier .padding(16 .dp),
183- type = EatSsuToastType .Success
181+ type = EatSsuSnackbarType .Success
184182 )
185183 }
186184}
185+
0 commit comments