From e9e1b5333b3cdb25e43a32f3faba0689cb0d5c18 Mon Sep 17 00:00:00 2001 From: Artem Chepurnoy Date: Fri, 16 Feb 2024 12:05:34 +0200 Subject: [PATCH] feat: Show a little Premium badge next to account that has Bitwarden premium --- .../feature/home/settings/accounts/AccountListViewModel.kt | 1 + .../home/settings/accounts/component/AccountListItem.kt | 6 ++++++ .../feature/home/settings/accounts/model/AccountItem.kt | 1 + 3 files changed, 8 insertions(+) diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/accounts/AccountListViewModel.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/accounts/AccountListViewModel.kt index f181885..5463892 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/accounts/AccountListViewModel.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/accounts/AccountListViewModel.kt @@ -255,6 +255,7 @@ fun accountListScreenState( text = it.host, error = error, hidden = profile?.hidden == true, + premium = profile?.premium == true, syncing = syncing, selecting = selectionMode, actions = listOf(), diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/accounts/component/AccountListItem.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/accounts/component/AccountListItem.kt index 7cd4aaf..dba26b2 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/accounts/component/AccountListItem.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/accounts/component/AccountListItem.kt @@ -39,6 +39,7 @@ import com.artemchep.keyguard.ui.ExpandedIfNotEmptyForRow import com.artemchep.keyguard.ui.FlatItemLayout import com.artemchep.keyguard.ui.FlatItemTextContent import com.artemchep.keyguard.ui.icons.ChevronIcon +import com.artemchep.keyguard.ui.icons.KeyguardPremium import com.artemchep.keyguard.ui.icons.SyncIcon import com.artemchep.keyguard.ui.theme.selectedContainer @@ -92,6 +93,11 @@ fun AccountListItemText( imageVector = Icons.Outlined.VisibilityOff, ) } + if (item.premium) { + AvatarBadgeIcon( + imageVector = Icons.Outlined.KeyguardPremium, + ) + } }, ) }, diff --git a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/accounts/model/AccountItem.kt b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/accounts/model/AccountItem.kt index 452d284..ba3e7a8 100644 --- a/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/accounts/model/AccountItem.kt +++ b/common/src/commonMain/kotlin/com/artemchep/keyguard/feature/home/settings/accounts/model/AccountItem.kt @@ -33,6 +33,7 @@ sealed interface AccountItem { val text: String?, val error: Boolean = false, val hidden: Boolean, + val premium: Boolean, val syncing: Boolean = false, val selecting: Boolean = false, val actionNeeded: Boolean,