Skip to content

Commit 5d7a0f5

Browse files
committed
chore(fc): match textStyle in room open/close banner button with info text
Signed-off-by: Brandon McAnsh <[email protected]>
1 parent 0de44e1 commit 5d7a0f5

File tree

3 files changed

+15
-5
lines changed

3 files changed

+15
-5
lines changed

flipchatApp/src/main/kotlin/xyz/flipchat/app/features/chat/conversation/ConversationChatInput.kt

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ fun ConversationChatInput(
141141
),
142142
buttonState = ButtonState.Filled,
143143
text = stringResource(
144-
R.string.action_joinRoomWithCost,
144+
R.string.action_payToChatInRoom,
145145
formatAmountString(
146146
resources = LocalResources.current!!,
147147
currency = Currency.Kin,
@@ -202,11 +202,14 @@ private fun RoomOpenControlBar(
202202
)
203203

204204
CodeButton(
205-
text = stringResource(R.string.action_change),
205+
text = stringResource(
206+
if (isOpen) R.string.action_close else R.string.action_reopen
207+
),
206208
shape = CircleShape,
207209
buttonState = ButtonState.Filled,
208210
overrideContentPadding = true,
209211
contentPadding = PaddingValues(horizontal = CodeTheme.dimens.grid.x2),
212+
style = CodeTheme.typography.textSmall
210213
) {
211214
onChangeRequest()
212215
}

flipchatApp/src/main/res/values/strings.xml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,7 @@
9898

9999
<string name="action_joinRoomByName">Join %1$s</string>
100100
<string name="action_joinRoomWithCost">Join Room: ⬢ %1$s</string>
101+
<string name="action_payToChatInRoom">Pay to Chat: ⬢ %1$s</string>
101102
<string name="action_watchRoom">Watch Room</string>
102103

103104
<string name="title_leaveRoom">Leave Room?</string>
@@ -171,12 +172,14 @@
171172
<string name="subtitle_roomNameHint">Enter a name appropriate for all ages</string>
172173

173174
<string name="title_youHaveBeenMuted">You\'ve been muted</string>
174-
<string name="title_roomIsClosed">This room is currently closed. Only the host can message until they reopen it.</string>
175+
<string name="title_roomIsClosed">The host has temporarily closed this room. Only they can send messages until they reopen it</string>
175176
<string name="subtitle_roomIsOpen">Your room is currently open</string>
176177
<string name="subtitle_roomIsClosed">Your room is currently closed</string>
177178
<string name="action_change">Change</string>
179+
<string name="action_reopen">Reopen</string>
180+
<string name="action_close">Close</string>
178181
<string name="prompt_title_reopenRoom">Reopen Room?</string>
179-
<string name="prompt_description_reopenRoom">Room members will be able to send messages again</string>
182+
<string name="prompt_description_reopenRoom">People will be able to send messages again</string>
180183
<string name="prompt_title_closeRoom">Close Room Temporarily?</string>
181184
<string name="prompt_description_closeRoom">Only you will be able to send messages until you reopen the room</string>
182185
<string name="action_closeTemporarily">Close Temporarily</string>

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

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ import androidx.compose.ui.graphics.Color
2828
import androidx.compose.ui.graphics.Shape
2929
import androidx.compose.ui.graphics.takeOrElse
3030
import androidx.compose.ui.res.painterResource
31+
import androidx.compose.ui.text.TextStyle
3132
import androidx.compose.ui.unit.Dp
3233
import androidx.compose.ui.unit.DpSize
3334
import androidx.compose.ui.unit.dp
@@ -66,6 +67,7 @@ fun CodeButton(
6667
buttonState: ButtonState = ButtonState.Bordered,
6768
textColor: Color = Color.Unspecified,
6869
shape: Shape = CodeTheme.shapes.small,
70+
style: TextStyle = CodeTheme.typography.textMedium,
6971
onClick: () -> Unit,
7072
) {
7173
CodeButton(
@@ -79,6 +81,7 @@ fun CodeButton(
7981
overrideContentPadding = overrideContentPadding,
8082
shape = shape,
8183
contentColor = textColor,
84+
style = style,
8285
) {
8386
Text(text = text)
8487
}
@@ -100,6 +103,7 @@ fun CodeButton(
100103
),
101104
overrideContentPadding: Boolean = false,
102105
contentColor: Color = Color.Unspecified,
106+
style: TextStyle = CodeTheme.typography.textMedium,
103107
content: @Composable RowScope.() -> Unit,
104108
) {
105109
val isEnabled by remember(enabled, isLoading, isSuccess) {
@@ -160,7 +164,7 @@ fun CodeButton(
160164
}
161165

162166
else -> {
163-
ProvideTextStyle(value = CodeTheme.typography.textMedium) {
167+
ProvideTextStyle(value = style) {
164168
content()
165169
}
166170
}

0 commit comments

Comments
 (0)