forked from reya/coop-mobile
chore: clean up codebase (#42)
Reviewed-on: https://git.reya.su/reya/coop-mobile/pulls/42
This commit is contained in:
@@ -3,16 +3,15 @@ package su.reya.coop.screens
|
||||
import androidx.compose.runtime.Composable
|
||||
import androidx.compose.runtime.getValue
|
||||
import androidx.lifecycle.compose.collectAsStateWithLifecycle
|
||||
import su.reya.coop.LocalAccountViewModel
|
||||
import su.reya.coop.LocalNavigator
|
||||
import su.reya.coop.Screen
|
||||
import su.reya.coop.shared.ProfileEditor
|
||||
import su.reya.coop.viewmodel.AccountViewModel
|
||||
|
||||
@Composable
|
||||
fun NewIdentityScreen() {
|
||||
val accountViewModel = LocalAccountViewModel.current
|
||||
fun NewIdentityScreen(viewModel: AccountViewModel) {
|
||||
val navigator = LocalNavigator.current
|
||||
val accountState by accountViewModel.state.collectAsStateWithLifecycle()
|
||||
val accountState by viewModel.state.collectAsStateWithLifecycle()
|
||||
|
||||
ProfileEditor(
|
||||
title = "Create a new identity",
|
||||
@@ -20,7 +19,7 @@ fun NewIdentityScreen() {
|
||||
isBusy = accountState.isImporting,
|
||||
onBack = { navigator.goBack() },
|
||||
onConfirm = { name, bio, bytes, type ->
|
||||
accountViewModel.createIdentity(name, bio, bytes, type)
|
||||
viewModel.createIdentity(name, bio, bytes, type)
|
||||
navigator.navigate(Screen.Home)
|
||||
}
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user