11package com.texthip.thip.ui.common.modal
22
33import androidx.compose.foundation.background
4+ import androidx.compose.foundation.border
5+ import androidx.compose.foundation.clickable
46import androidx.compose.foundation.layout.Box
57import androidx.compose.foundation.layout.Column
68import androidx.compose.foundation.layout.Row
79import androidx.compose.foundation.layout.Spacer
810import androidx.compose.foundation.layout.fillMaxWidth
911import androidx.compose.foundation.layout.height
1012import androidx.compose.foundation.layout.padding
13+ import androidx.compose.foundation.layout.size
1114import androidx.compose.foundation.rememberScrollState
1215import androidx.compose.foundation.shape.RoundedCornerShape
1316import androidx.compose.foundation.verticalScroll
17+ import androidx.compose.material3.Icon
1418import androidx.compose.material3.Text
1519import androidx.compose.runtime.Composable
1620import androidx.compose.ui.Alignment
1721import androidx.compose.ui.Modifier
22+ import androidx.compose.ui.graphics.Color
23+ import androidx.compose.ui.res.painterResource
1824import androidx.compose.ui.res.stringResource
1925import androidx.compose.ui.tooling.preview.Preview
2026import androidx.compose.ui.unit.dp
@@ -31,42 +37,73 @@ fun InfoPopup(
3137) {
3238 val scrollState = rememberScrollState()
3339
34- Box (
35- modifier = modifier
36- .fillMaxWidth()
37- .background(colors.DarkGrey , shape = RoundedCornerShape (12 .dp))
38- .padding(20 .dp)
40+ Column (
41+ horizontalAlignment = Alignment .CenterHorizontally ,
42+ modifier = Modifier .background(Color .Transparent )
3943 ) {
40- Column {
41- Row (
42- verticalAlignment = Alignment .CenterVertically ,
43- modifier = Modifier .fillMaxWidth()
44+ Box (
45+ modifier = modifier
46+ .fillMaxWidth()
47+ .background(colors.DarkGrey , shape = RoundedCornerShape (12 .dp))
48+ .padding(20 .dp)
49+ ) {
50+ Column (
51+ horizontalAlignment = Alignment .CenterHorizontally
4452 ) {
45- Text (
46- text = title,
47- color = colors.White ,
48- style = typography.smalltitle_sb600_s16_h24
49- )
53+ Row (
54+ verticalAlignment = Alignment .CenterVertically ,
55+ modifier = Modifier .fillMaxWidth()
56+ ) {
57+ Text (
58+ text = title,
59+ color = colors.White ,
60+ style = typography.smalltitle_sb600_s16_h24
61+ )
62+ }
63+ Spacer (modifier = Modifier .height(12 .dp))
64+ Box (
65+ modifier = Modifier
66+ .fillMaxWidth()
67+ .height(284 .dp)
68+ .verticalScroll(scrollState)
69+ .drawVerticalScrollbar(scrollState)
70+ ) {
71+ Text (
72+ modifier = Modifier .padding(end = 8 .dp),
73+ text = content,
74+ color = colors.White ,
75+ style = typography.copy_r400_s12_h20
76+ )
77+ }
5078 }
51- Spacer (modifier = Modifier .height( 12 .dp))
52- Box (
53- modifier = Modifier
54- .fillMaxWidth()
55- .height( 284 .dp)
56- .verticalScroll(scrollState )
57- .drawVerticalScrollbar(scrollState )
58- ) {
59- Text (
60- text = content ,
61- color = colors.White ,
62- style = typography.copy_r400_s12_h20
79+ }
80+
81+ // 아래쪽 X버튼 (원형)
82+ Box (
83+ modifier = Modifier
84+ .padding(top = 20 .dp )
85+ .size( 50 .dp )
86+ .background( Color . Transparent , shape = RoundedCornerShape ( 24 .dp))
87+ .border (
88+ width = 2 .dp ,
89+ color = colors.Grey02 ,
90+ shape = RoundedCornerShape ( 24 .dp)
6391 )
64- }
92+ .clickable { onDismiss() },
93+ contentAlignment = Alignment .Center
94+ ) {
95+ Icon (
96+ painter = painterResource(R .drawable.ic_x_20),
97+ contentDescription = " 닫기" ,
98+ tint = colors.White ,
99+ modifier = Modifier .size(24 .dp)
100+ )
65101 }
66102 }
67103}
68104
69- @Preview(showBackground = true )
105+
106+ @Preview()
70107@Composable
71108fun PreviewInfoPopup () {
72109 val dummyText = """
0 commit comments