Skip to content

Commit

Permalink
minor changes.
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-sneh-s committed Dec 9, 2024
1 parent b603608 commit 0c6a714
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ import com.canopas.yourspace.ui.theme.AppTheme
@Composable
fun NoMemberEmptyContent(
loadingInviteCode: Boolean,
title: Int,
subtitle: Int,
addMember: () -> Unit
) {
Column(
Expand All @@ -40,12 +42,12 @@ fun NoMemberEmptyContent(
)
Spacer(modifier = Modifier.height(24.dp))
Text(
text = stringResource(id = R.string.threads_screen_no_members_title),
text = stringResource(id = title),
style = AppTheme.appTypography.header4
)
Spacer(modifier = Modifier.height(16.dp))
Text(
text = stringResource(id = R.string.threads_screen_no_members_subtitle),
text = stringResource(id = subtitle),
style = AppTheme.appTypography.subTitle1,
color = AppTheme.colorScheme.textDisabled,
textAlign = TextAlign.Center
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,11 @@ fun PlacesListScreen() {
} else if (state.hasMembers) {
PlacesListContent(modifier = Modifier.padding(it))
} else {
NoMemberEmptyContent(state.loadingInviteCode) {
NoMemberEmptyContent(
loadingInviteCode = state.loadingInviteCode,
title = R.string.place_list_screen_no_members_title,
subtitle = R.string.place_list_screen_no_members_subtitle
) {
viewModel.addMember()
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,11 @@ private fun ThreadsContent(modifier: Modifier) {
deleteThread = { viewModel.deleteThread(it) }
)
} else {
NoMemberEmptyContent(state.loadingInviteCode) {
NoMemberEmptyContent(
loadingInviteCode = state.loadingInviteCode,
title = R.string.threads_screen_no_members_title,
subtitle = R.string.threads_screen_no_members_subtitle
) {
viewModel.addMember()
}
}
Expand Down
3 changes: 3 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -293,4 +293,7 @@
<string name="toast_failed_open_navigation">Failed to open navigation</string>
<string name="toast_invalid_coordinates">Invalid coordinates</string>
<string name="toast_failed_share_location">Failed to share location</string>

<string name="place_list_screen_no_members_title">Add members to add places</string>
<string name="place_list_screen_no_members_subtitle">At least one member needs to join your group to be able to add places.</string>
</resources>

0 comments on commit 0c6a714

Please sign in to comment.