Refactor: Update string resources in ChannelSideDrawer for improved localization
This commit enhances the ChannelSideDrawer component by replacing hardcoded strings with string resources, improving localization support and maintainability. - Updated content description for empty messages image. - Replaced static text with string resources for empty messages heading and body. - Updated text for the new conversation button to use string resources.
This commit is contained in:
parent
4ed6a0aa9a
commit
26e0c3443e
|
|
@ -724,18 +724,18 @@ private fun ColumnScope.DirectMessagesChannelListRenderer(
|
|||
Image(
|
||||
modifier = Modifier.size(100.dp),
|
||||
painter = painterResource(R.drawable.empty_direct_messages_img),
|
||||
contentDescription = "Empty Messages Sad Image"
|
||||
contentDescription = stringResource(R.string.empty_messages_content_description)
|
||||
)
|
||||
Spacer(Modifier.height(4.dp))
|
||||
Text(
|
||||
text = "It’s Quiet Here...",
|
||||
text = stringResource(R.string.empty_messages_heading),
|
||||
style = MaterialTheme.typography.labelLarge,
|
||||
textAlign = TextAlign.Center,
|
||||
fontSize = 24.sp
|
||||
)
|
||||
Spacer(Modifier.height(4.dp))
|
||||
Text(
|
||||
text = "Find friends to chat with or create a group conversation.",
|
||||
text = stringResource(R.string.empty_messages_body),
|
||||
style = MaterialTheme.typography.bodyMedium,
|
||||
textAlign = TextAlign.Center
|
||||
)
|
||||
|
|
@ -751,7 +751,7 @@ private fun ColumnScope.DirectMessagesChannelListRenderer(
|
|||
bottomEnd = CornerSize(8.dp)
|
||||
)
|
||||
) {
|
||||
Text(text = "New Conversation")
|
||||
Text(text = stringResource(R.string.new_conversation))
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -17,6 +17,10 @@
|
|||
<string name="privacy_policy">Privacy Policy</string>
|
||||
<string name="community_guidelines">Community Guidelines</string>
|
||||
<string name="message_friends">Message Friends</string>
|
||||
<string name="empty_messages_content_description">Empty Messages Sad Image</string>
|
||||
<string name="empty_messages_heading">It\'s Quiet Here...</string>
|
||||
<string name="empty_messages_body">Find friends to chat with or create a group conversation.</string>
|
||||
<string name="new_conversation">New Conversation</string>
|
||||
|
||||
<string name="login_onboarding_heading">Welcome to PepChat!</string>
|
||||
<string name="login_onboarding_body">Join endless chats and connections; PepChat is your place to vibe with friends!</string>
|
||||
|
|
|
|||
Loading…
Reference in New Issue