Skip to content

Commit

Permalink
refactor: Contained, Outlined Chip width가 동적으로 변하도록 수정
Browse files Browse the repository at this point in the history
  • Loading branch information
BEEEAM-J committed Dec 5, 2023
1 parent b2db94c commit 1940b2b
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 18 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@ package com.suwiki.core.designsystem.component.chips

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.size
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
Expand Down Expand Up @@ -47,15 +49,20 @@ fun SuwikiContainedChip(
.clip(RoundedCornerShape(5.dp))
.background(color = backgroundColor)
.clickable(onClick = onClick)
.size(41.dp, 26.dp),
.height(26.dp)
) {
Text(
text = text,
color = contentColor,
Column(
modifier = Modifier
.align(Alignment.Center),
fontSize = 12.sp,
)
.padding(top = 4.dp, bottom = 4.dp, start = 6.dp, end = 6.dp)
.height(18.dp),
verticalArrangement = Arrangement.Center,
) {
Text(
text = text,
color = contentColor,
fontSize = 12.sp,
)
}
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,18 @@ package com.suwiki.core.designsystem.component.chips
import androidx.compose.foundation.background
import androidx.compose.foundation.border
import androidx.compose.foundation.clickable
import androidx.compose.foundation.layout.Arrangement
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.size
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material3.Text
import androidx.compose.runtime.Composable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.runtime.setValue
import androidx.compose.ui.Alignment
import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.graphics.Color
Expand Down Expand Up @@ -44,17 +46,22 @@ fun SuwikiOutlinedChip(
modifier = Modifier
.clip(RoundedCornerShape(5.dp))
.clickable(onClick = onClick)
.size(41.dp, 26.dp)
.height(26.dp)
.background(color = Color(0xFFFFFFFF))
.border(width = 1.dp, color = borderLineColor, shape = RoundedCornerShape(5.dp)),
) {
Text(
text = text,
color = contentColor,
Column(
modifier = Modifier
.align(Alignment.Center),
fontSize = 12.sp,
)
.padding(top = 4.dp, bottom = 4.dp, start = 6.dp, end = 6.dp)
.height(18.dp),
verticalArrangement = Arrangement.Center,
) {
Text(
text = text,
color = contentColor,
fontSize = 12.sp,
)
}
}
}

Expand Down

0 comments on commit 1940b2b

Please sign in to comment.