feat: Update ProfileNavigationItem to use a rounded corner shape with increased radius

This commit is contained in:
k1ngsterr1
2026-01-21 03:09:39 +05:00
parent 5145388e02
commit dcfbb020be
7 changed files with 105 additions and 42 deletions

View File

@@ -19,6 +19,7 @@ import androidx.compose.material3.Surface
import androidx.compose.runtime.*
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.platform.LocalContext
import androidx.core.content.ContextCompat
import androidx.lifecycle.lifecycleScope
import com.google.firebase.FirebaseApp
@@ -436,6 +437,21 @@ fun MainScreen(
val accountPublicKey = account?.publicKey ?: "04c266b98ae5"
val accountPrivateKey = account?.privateKey ?: ""
val privateKeyHash = account?.privateKeyHash ?: ""
// Username state - загружается из EncryptedAccount
var accountUsername by remember { mutableStateOf("") }
var reloadTrigger by remember { mutableIntStateOf(0) }
// Load username from AccountManager
val context = LocalContext.current
LaunchedEffect(accountPublicKey, reloadTrigger) {
if (accountPublicKey.isNotBlank() && accountPublicKey != "04c266b98ae5") {
val accountManager = AccountManager(context)
val encryptedAccount = accountManager.getAccount(accountPublicKey)
accountUsername = encryptedAccount?.username ?: ""
Log.d("MainActivity", "Loaded username from DB: $accountUsername")
}
}
// Состояние протокола для передачи в SearchScreen
val protocolState by ProtocolManager.state.collectAsState()
@@ -660,13 +676,15 @@ fun MainScreen(
ProfileScreen(
isDarkTheme = isDarkTheme,
accountName = accountName,
accountUsername = "", // TODO: Get from account
accountUsername = accountUsername,
accountPublicKey = accountPublicKey,
accountPrivateKeyHash = privateKeyHash,
onBack = { showProfileScreen = false },
onSaveProfile = { name, username ->
// Profile saved via ViewModel
Log.d("MainActivity", "Profile saved: name=$name, username=$username")
// Update username state and trigger reload from DB
accountUsername = username
reloadTrigger++
Log.d("MainActivity", "Profile saved: name=$name, username=$username, reloading...")
},
onLogout = onLogout,
onNavigateToTheme = {