Skip to content

Commit 2ecee8c

Browse files
committed
style(ui): update CodeButton states from Filled10 => Filled50
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 5927c7e commit 2ecee8c

5 files changed

Lines changed: 25 additions & 16 deletions

File tree

apps/codeApp/src/main/java/com/getcode/navigation/screens/ModalContainerMessage.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ private data class ModalContainerMessage(
9898
if (negativeText.isNotEmpty()) {
9999
CodeButton(
100100
modifier = Modifier.fillMaxWidth(),
101-
buttonState = ButtonState.Filled10,
101+
buttonState = ButtonState.Filled50,
102102
text = negativeText,
103103
onClick = {
104104
message.onNegative()

apps/codeApp/src/main/java/com/getcode/view/main/account/AccountPhone.kt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ fun AccountPhone(
101101
text = if (!dataState.isLinked) stringResource(R.string.action_linkPhoneNumber) else stringResource(
102102
R.string.action_removeYourPhoneNumber
103103
),
104-
buttonState = if (!dataState.isLinked) ButtonState.Filled else ButtonState.Filled10,
104+
buttonState = if (!dataState.isLinked) ButtonState.Filled else ButtonState.Filled50,
105105
modifier = Modifier
106106
.fillMaxWidth()
107107
.padding(bottom = CodeTheme.dimens.inset)

libs/messaging/src/main/kotlin/com/getcode/manager/BottomBarManager.kt

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ object BottomBarManager {
4949
replaceWith = ReplaceWith("actions.getOrNull(1)?.style ?: \"\""),
5050
level = DeprecationLevel.WARNING
5151
)
52-
val negativeStyle: BottomBarButtonStyle = BottomBarButtonStyle.Filled10,
52+
val negativeStyle: BottomBarButtonStyle = BottomBarButtonStyle.Filled50,
5353
@Deprecated(
5454
message = "Use actions instead (e.g., the third item in actions)",
5555
replaceWith = ReplaceWith("actions.getOrNull(2)?.title"),
@@ -81,7 +81,7 @@ object BottomBarManager {
8181
positiveText: String,
8282
positiveStyle: BottomBarButtonStyle = BottomBarButtonStyle.Filled,
8383
negativeText: String = "",
84-
negativeStyle: BottomBarButtonStyle = BottomBarButtonStyle.Filled10,
84+
negativeStyle: BottomBarButtonStyle = BottomBarButtonStyle.Filled50,
8585
tertiaryText: String? = null,
8686
onPositive: () -> Unit,
8787
onNegative: () -> Unit = {},
@@ -141,9 +141,14 @@ object BottomBarManager {
141141

142142
fun clear() = _messages.update { listOf() }
143143

144-
fun clearByType(type: BottomBarMessageType) = _messages.update { it.filterNot { m -> m.type == type } }
144+
fun clearByType(type: BottomBarMessageType) =
145+
_messages.update { it.filterNot { m -> m.type == type } }
145146

146-
enum class BottomBarMessageType { DESTRUCTIVE, REMOTE_SEND, THEMED }
147+
enum class BottomBarMessageType {
148+
DESTRUCTIVE,
149+
@Deprecated("This is no longer necessary with the VM and balance deductions are handled intelligently")
150+
REMOTE_SEND, THEMED
151+
}
147152

148153
enum class BottomBarActionType {
149154
Positive,
@@ -152,7 +157,7 @@ object BottomBarManager {
152157
}
153158

154159
enum class BottomBarButtonStyle {
155-
Filled, Filled10
160+
Filled, Filled50
156161
}
157162

158163
}

ui/components/src/main/kotlin/com/getcode/ui/components/bars/BottomBarContainer.kt

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ import androidx.compose.runtime.setValue
3434
import androidx.compose.ui.Alignment
3535
import androidx.compose.ui.Modifier
3636
import androidx.compose.ui.draw.alpha
37+
import androidx.compose.ui.graphics.Color
3738
import androidx.compose.ui.res.stringResource
3839
import androidx.compose.ui.text.style.TextAlign
3940
import androidx.compose.ui.util.fastForEach
4041
import com.getcode.manager.BottomBarManager
4142
import com.getcode.theme.Black40
42-
import com.getcode.theme.Brand
4343
import com.getcode.theme.CodeTheme
4444
import com.getcode.theme.White
4545
import com.getcode.ui.theme.ButtonState
@@ -190,13 +190,17 @@ fun BottomBarView(
190190
onClose(true)
191191
},
192192
textColor = when (bottomBarMessage.type) {
193-
BottomBarManager.BottomBarMessageType.DESTRUCTIVE -> CodeTheme.colors.error
193+
BottomBarManager.BottomBarMessageType.DESTRUCTIVE -> when (action.style) {
194+
BottomBarManager.BottomBarButtonStyle.Filled -> CodeTheme.colors.error
195+
BottomBarManager.BottomBarButtonStyle.Filled50 -> Color.White
196+
}
197+
198+
BottomBarManager.BottomBarMessageType.THEMED -> CodeTheme.colors.brand
194199
BottomBarManager.BottomBarMessageType.REMOTE_SEND -> CodeTheme.colors.brandLight
195-
BottomBarManager.BottomBarMessageType.THEMED -> Brand
196200
},
197201
buttonState = when (action.style) {
198202
BottomBarManager.BottomBarButtonStyle.Filled -> ButtonState.Filled
199-
BottomBarManager.BottomBarButtonStyle.Filled10 -> ButtonState.Filled10
203+
BottomBarManager.BottomBarButtonStyle.Filled50 -> ButtonState.Filled50
200204
},
201205
text = action.text
202206
)

ui/components/src/main/kotlin/com/getcode/ui/theme/CodeButton.kt

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ import com.getcode.ui.utils.plus
4747
enum class ButtonState {
4848
Bordered,
4949
Filled,
50-
Filled10,
50+
Filled50,
5151
Subtle
5252
}
5353

@@ -182,7 +182,7 @@ fun getRipple(
182182
color = when (buttonState) {
183183
ButtonState.Bordered -> White
184184
ButtonState.Filled -> CodeTheme.colors.brandLight
185-
ButtonState.Filled10 -> White50
185+
ButtonState.Filled50 -> White50
186186
ButtonState.Subtle -> White
187187
}
188188
)
@@ -208,11 +208,11 @@ fun getButtonColors(
208208
contentColor = textColor.takeOrElse { Color.LightGray }
209209
)
210210

211-
ButtonState.Filled10 ->
211+
ButtonState.Filled50 ->
212212
ButtonDefaults.outlinedButtonColors(
213-
backgroundColor = White10,
213+
backgroundColor = White50,
214214
disabledContentColor = White50,
215-
contentColor = textColor.takeOrElse { White50 },
215+
contentColor = textColor.takeOrElse { White },
216216
)
217217

218218
ButtonState.Subtle ->

0 commit comments

Comments
 (0)