Skip to content

Commit b5caf63

Browse files
committed
chore(chat): add verbs (sent/received) to cash bubbles
Signed-off-by: Brandon McAnsh <git@bmcreations.dev>
1 parent 8e3a93c commit b5caf63

2 files changed

Lines changed: 32 additions & 12 deletions

File tree

  • apps/flipcash
    • core/src/main/res/values
    • features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/components

apps/flipcash/core/src/main/res/values/strings.xml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,4 +764,8 @@
764764

765765
<string name="action_sendCash">Send Cash</string>
766766
<string name="action_sendMessage">Send Message</string>
767+
768+
<string name="subtitle_verb_youSent">You sent</string>
769+
<string name="subtitle_verb_youReceived">You received</string>
770+
767771
</resources>

apps/flipcash/features/messenger/src/main/kotlin/com/flipcash/app/messenger/internal/screens/components/MessageBubble.kt

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ import androidx.compose.ui.Modifier
2020
import androidx.compose.ui.draw.clip
2121
import androidx.compose.ui.graphics.Shape
2222
import androidx.compose.ui.platform.LocalContext
23+
import androidx.compose.ui.res.stringResource
2324
import androidx.compose.ui.tooling.preview.Preview
2425
import androidx.compose.ui.tooling.preview.PreviewWrapper
2526
import androidx.compose.ui.unit.Dp
@@ -28,6 +29,7 @@ import androidx.paging.compose.LazyPagingItems
2829
import com.flipcash.app.core.ui.TokenIconWithName
2930
import com.flipcash.app.theme.FlipcashThemeWrapper
3031
import com.flipcash.services.models.chat.MessageContent
32+
import com.flipcash.shared.flags.R
3133
import com.getcode.opencode.compose.ExchangeStub
3234
import com.getcode.opencode.compose.LocalExchange
3335
import com.getcode.opencode.model.financial.Fiat
@@ -118,20 +120,34 @@ private fun CashBubble(
118120
)
119121
}
120122

121-
PriceWithFlag(
123+
Column(
122124
modifier = Modifier
123125
.padding(vertical = CodeTheme.dimens.grid.x5),
124-
amount = amount.formatted(),
125-
currencyCode = amount.currencyCode.name,
126-
flag = exchange.getFlagByCurrency(amount.currencyCode.name),
127-
text = { text ->
128-
Text(
129-
text = text,
130-
style = CodeTheme.typography.displayMedium,
131-
color = CodeTheme.colors.textMain,
132-
)
133-
}
134-
)
126+
horizontalAlignment = Alignment.CenterHorizontally,
127+
) {
128+
Text(
129+
text = if (isFromSelf) {
130+
stringResource(R.string.subtitle_youSent)
131+
} else {
132+
stringResource(R.string.subtitle_youReceived)
133+
},
134+
style = CodeTheme.typography.caption,
135+
color = CodeTheme.colors.textSecondary,
136+
)
137+
PriceWithFlag(
138+
modifier = Modifier.padding(top = CodeTheme.dimens.grid.x1),
139+
amount = amount.formatted(),
140+
currencyCode = amount.currencyCode.name,
141+
flag = exchange.getFlagByCurrency(amount.currencyCode.name),
142+
text = { text ->
143+
Text(
144+
text = text,
145+
style = CodeTheme.typography.displayMedium,
146+
color = CodeTheme.colors.textMain,
147+
)
148+
}
149+
)
150+
}
135151
}
136152
}
137153
}

0 commit comments

Comments
 (0)