Skip to content

Commit

Permalink
Merge pull request #92 from YAPP-Github/feature/MZ-201-vote-list-ui
Browse files Browse the repository at this point in the history
Feature/mz 201 vote list UI
  • Loading branch information
jinukeu authored Jan 25, 2024
2 parents 8cfa319 + 9a86525 commit a093f7e
Show file tree
Hide file tree
Showing 17 changed files with 491 additions and 51 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import com.susu.core.ui.extension.susuClickable
fun BasicButton(
modifier: Modifier = Modifier,
shape: Shape = RectangleShape,
textModifier: Modifier = Modifier,
text: String? = null,
textStyle: TextStyle = TextStyle.Default,
contentColor: Color = Color.Unspecified,
Expand Down Expand Up @@ -72,6 +73,7 @@ fun BasicButton(

text?.let {
Text(
modifier = textModifier,
text = it,
style = textStyle,
color = contentColor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.susu.core.designsystem.R
Expand Down Expand Up @@ -49,6 +50,8 @@ enum class FilledButtonColor(
fun SusuFilledButton(
modifier: Modifier = Modifier,
shape: Shape = RoundedCornerShape(4.dp),
textModifier: Modifier = Modifier,
textAlign: TextAlign = TextAlign.Unspecified,
text: String? = null,
color: FilledButtonColor,
style: @Composable () -> ButtonStyle,
Expand All @@ -63,8 +66,9 @@ fun SusuFilledButton(
BasicButton(
modifier = modifier,
shape = shape,
textModifier = textModifier,
text = text,
textStyle = textStyle,
textStyle = textStyle.copy(textAlign = textAlign),
contentColor = if (isActive) activeContentColor else inactiveContentColor,
rippleColor = rippleColor,
backgroundColor = if (isActive) activeBackgroundColor else inactiveBackgroundColor,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
package com.susu.core.designsystem.component.button

import androidx.annotation.DrawableRes
import androidx.compose.foundation.Image
import androidx.compose.foundation.background
import androidx.compose.foundation.layout.Box
Expand All @@ -12,6 +13,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.draw.clip
import androidx.compose.ui.draw.shadow
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.res.stringResource
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.susu.core.designsystem.R
Expand All @@ -23,6 +25,7 @@ import com.susu.core.ui.extension.susuClickable
@Composable
fun SusuFloatingButton(
modifier: Modifier = Modifier,
@DrawableRes imageResId: Int = R.drawable.ic_floating_button_add,
onClick: () -> Unit = {},
) {
Box(
Expand All @@ -34,7 +37,10 @@ fun SusuFloatingButton(
.susuClickable(rippleColor = Gray10, onClick = onClick),
contentAlignment = Alignment.Center,
) {
Image(painter = painterResource(id = R.drawable.ic_floating_button_add), contentDescription = "추가 아이콘")
Image(
painter = painterResource(id = imageResId),
contentDescription = stringResource(id = com.susu.core.ui.R.string.content_description_add_button),
)
}
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.susu.core.designsystem.R
Expand Down Expand Up @@ -49,6 +50,8 @@ enum class GhostButtonColor(
fun SusuGhostButton(
modifier: Modifier = Modifier,
shape: Shape = RoundedCornerShape(4.dp),
textModifier: Modifier = Modifier,
textAlign: TextAlign = TextAlign.Unspecified,
text: String? = null,
color: GhostButtonColor,
style: @Composable () -> ButtonStyle,
Expand All @@ -64,8 +67,9 @@ fun SusuGhostButton(
BasicButton(
modifier = modifier,
shape = shape,
textModifier = textModifier,
text = text,
textStyle = textStyle,
textStyle = textStyle.copy(textAlign = textAlign),
contentColor = if (isActive) activeContentColor else inactiveContentColor,
rippleColor = rippleColor,
backgroundColor = if (isActive) activeBackgroundColor else inactiveBackgroundColor,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.res.painterResource
import androidx.compose.ui.text.style.TextAlign
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.susu.core.designsystem.R
Expand Down Expand Up @@ -56,6 +57,8 @@ enum class LinedButtonColor(
fun SusuLinedButton(
modifier: Modifier = Modifier,
shape: Shape = RoundedCornerShape(4.dp),
textModifier: Modifier = Modifier,
textAlign: TextAlign = TextAlign.Unspecified,
text: String? = null,
color: LinedButtonColor,
style: @Composable () -> ButtonStyle,
Expand All @@ -70,8 +73,9 @@ fun SusuLinedButton(
BasicButton(
modifier = modifier,
shape = shape,
textModifier = textModifier,
text = text,
textStyle = textStyle,
textStyle = textStyle.copy(textAlign = textAlign),
borderWidth = 1.dp,
borderColor = if (isActive) activeBorderColor else inactiveBorderColor,
contentColor = if (isActive) activeContentColor else inactiveContentColor,
Expand Down
1 change: 1 addition & 0 deletions core/ui/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,4 +44,5 @@
<string name="word_memo">메모</string>
<string name="word_register">등록</string>
<string name="word_free">자유</string>
<string name="content_description_report_button">신고 버튼</string>
</resources>

This file was deleted.

Loading

0 comments on commit a093f7e

Please sign in to comment.