Skip to content

Commit

Permalink
Finish up making UI match RN version
Browse files Browse the repository at this point in the history
  • Loading branch information
creativedrewy committed Jul 27, 2022
1 parent 12efe77 commit 367eb80
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 21 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,11 +162,15 @@ fun SampleScreen(

Button(
modifier = Modifier.fillMaxWidth(),
enabled = false,
enabled = viewState.canTransact,
colors = ButtonDefaults.buttonColors(
backgroundColor = Color.Red.copy(red = 0.7f)
),
onClick = { /*TODO*/ }
) {
Text(
text = "Add funds to get started"
color = MaterialTheme.colors.onPrimary,
text = if (viewState.canTransact && viewState.solBalance >= 0) "Disconnect" else "Add funds to get started"
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,31 +31,13 @@ class SampleViewModel @Inject constructor(
viewModelScope.launch {
walletAdapter.transact(sender) {
val result = authorize(Uri.parse("https://solana.com"), Uri.parse("favicon.ico"), "Solana")


//8hEeWszgrA2XkRK4GH6zL4Qq5wJBwotwsB6VEweD8YEQ
// _state.update {
// _state.value.copy(
// isConnected = true,
// userAddress = result.publicKey
// )
// }
}
}
}

fun disconnect(sender: ActivityResultSender) {
viewModelScope.launch {
walletAdapter.transact(sender) {
//deauthorize()

// _state.update {
// _state.value.copy(
// isConnected = false,
// userAddress = ""
// )
// }
}
walletAdapter.transact(sender) { }
}
}
}

0 comments on commit 367eb80

Please sign in to comment.