Skip to content

Commit

Permalink
Merge pull request #112 from Team-Ampersand/feature/111_button_border…
Browse files Browse the repository at this point in the history
…_customable

🔀 :: (#111) button customable items
  • Loading branch information
ImGaram authored Sep 20, 2023
2 parents afc8a99 + 8068c04 commit 5d386ad
Showing 1 changed file with 8 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import androidx.compose.foundation.layout.Spacer
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.height
import androidx.compose.foundation.layout.padding
import androidx.compose.foundation.shape.CircleShape
import androidx.compose.foundation.shape.RoundedCornerShape
import androidx.compose.material.Button
Expand All @@ -31,15 +30,17 @@ fun DotoriButton(
modifier: Modifier = Modifier,
text: String,
colors: Color = DotoriTheme.colors.primary10,
textColor: Color = DotoriTheme.colors.neutral30,
shape: Shape = RoundedCornerShape(8.dp),
border: BorderStroke = BorderStroke(1.dp, DotoriTheme.colors.neutral30),
paddingValues: PaddingValues = PaddingValues(0.dp),
textStyle: TextStyle = DotoriTheme.typography.smallTitle,
onClick: () -> Unit
) {
if (colors == Transparent) {
OutlinedButton(
modifier = modifier,
border = BorderStroke(1.dp, DotoriTheme.colors.neutral30),
border = border,
colors = ButtonDefaults.buttonColors(
backgroundColor = Transparent,
contentColor = DotoriTheme.colors.neutral20
Expand All @@ -50,6 +51,7 @@ fun DotoriButton(
) {
Text(
text = text,
color = textColor,
style = textStyle
)
}
Expand All @@ -66,6 +68,7 @@ fun DotoriButton(
) {
Text(
text = text,
color = textColor,
style = textStyle
)
}
Expand Down Expand Up @@ -98,7 +101,9 @@ fun DotoriButtonPreview() {
text = "button",
colors = Transparent,
paddingValues = PaddingValues(vertical = 8.dp, horizontal = 16.dp),
shape = CircleShape
shape = CircleShape,
border = BorderStroke(1.dp, DotoriTheme.colors.subRed),
textColor = DotoriTheme.colors.subRed
) {}
Spacer(modifier = Modifier.height(10.dp))

Expand Down

0 comments on commit 5d386ad

Please sign in to comment.