diff --git a/app/src/main/java/com/algorand/android/modules/keyreg/ui/components/KeyRegTable.kt b/app/src/main/java/com/algorand/android/modules/keyreg/ui/components/KeyRegTable.kt deleted file mode 100644 index b5a8ba74..00000000 --- a/app/src/main/java/com/algorand/android/modules/keyreg/ui/components/KeyRegTable.kt +++ /dev/null @@ -1,173 +0,0 @@ -/* - * Copyright 2022 Pera Wallet, LDA - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - */ - -package com.algorand.android.modules.keyreg.ui.components - -import android.annotation.SuppressLint -import androidx.compose.foundation.background -import androidx.compose.foundation.layout.Arrangement -import androidx.compose.foundation.layout.Column -import androidx.compose.foundation.layout.PaddingValues -import androidx.compose.foundation.layout.Row -import androidx.compose.foundation.layout.Spacer -import androidx.compose.foundation.layout.fillMaxHeight -import androidx.compose.foundation.layout.fillMaxWidth -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.padding -import androidx.compose.foundation.layout.width -import androidx.compose.foundation.layout.wrapContentHeight -import androidx.compose.foundation.lazy.LazyColumn -import androidx.compose.foundation.lazy.items -import androidx.compose.material3.FabPosition -import androidx.compose.material3.Scaffold -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.runtime.getValue -import androidx.compose.runtime.mutableStateOf -import androidx.compose.runtime.remember -import androidx.compose.ui.Alignment -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.platform.LocalDensity -import androidx.compose.ui.text.font.FontWeight -import androidx.compose.ui.tooling.preview.Preview -import androidx.compose.ui.unit.dp -import com.algorand.android.modules.keyreg.ui.model.KeyRegTransactionPreview - -@Preview -@SuppressLint("ComposableNaming") -@Composable -fun keyRegTable( - keyRegTransactionDetail: KeyRegTransactionPreview? = null, - onBackClick: () -> Unit = {}, - onConfirmClick: () -> Unit = {} -) { - if (keyRegTransactionDetail != null) { - val itemsList = listOf( - "Address" to keyRegTransactionDetail.address, - "Fee" to keyRegTransactionDetail.fee, - "Type" to keyRegTransactionDetail.type, - "Selection Key" to keyRegTransactionDetail.selectionKey, - "Voting Key" to keyRegTransactionDetail.votingKey, - "State Proof Key" to keyRegTransactionDetail.stateProofKey, - "First Valid Round" to keyRegTransactionDetail.firstValid, - "Last Valid Round" to keyRegTransactionDetail.lastValid, - "xNote" to keyRegTransactionDetail.xNote, - "Note" to keyRegTransactionDetail.note, - "Signing Address" to keyRegTransactionDetail.signingAddress, - ) - - val fabHeight by remember { - mutableStateOf(0) - } - - val heightInDp = with(LocalDensity.current) { fabHeight.toDp() } - - Scaffold( - topBar = { - scaffoldTopAppBar(onBackClick) - }, - floatingActionButton = { - algorandButton("Confirm Transaction", onConfirmClick) - }, - floatingActionButtonPosition = FabPosition.Center - ) { - contentPadding -> - LazyColumn( - horizontalAlignment = Alignment.CenterHorizontally, - contentPadding = PaddingValues(top = 75.dp, bottom = heightInDp + 100.dp), - modifier = Modifier - .background(Color.White) - .fillMaxWidth() - .fillMaxHeight(), - ) { - items(itemsList) { item -> - keyRegTableRowItem(item.first, item.second.toString()) - } - } - } - } else { - Column( - verticalArrangement = Arrangement.Center, - horizontalAlignment = Alignment.CenterHorizontally, - modifier = - Modifier - .fillMaxWidth() - .fillMaxHeight(), - ) { - Text( - color = Color.Black, - fontWeight = FontWeight.Bold, - text = "No Key Reg Transaction" - ) - } - } -} - -@Preview -@SuppressLint("ComposableNaming") -@Composable -fun keyRegTableRowItem(key: String = "", value: String? = "") { - Row( - modifier = - Modifier - .width(327.dp) - .wrapContentHeight() - .padding(5.dp) - .background(color = Color.White), - horizontalArrangement = Arrangement.SpaceEvenly, - ) { - Column( - verticalArrangement = Arrangement.Center, - horizontalAlignment = Alignment.Start, - modifier = - Modifier - .fillMaxHeight() - .width(100.dp), - ) { - Text( - color = Color.DarkGray, - modifier = - Modifier - .padding(end = 27.dp), - text = key - ) - } - Spacer(modifier = Modifier.width(27.dp)) - Column( - verticalArrangement = Arrangement.Center, - horizontalAlignment = Alignment.Start, - modifier = - Modifier - .fillMaxHeight() - .background(Color.White) - .width(200.dp), - ) { - Text( - fontWeight = FontWeight.Bold, - color = Color.Black, - modifier = - Modifier - .padding(end = 25.dp), - text = value.orEmpty() - ) - } - } - - when (key) { - "Type", "Key Dilution", "Last Valid Round", "Note" -> { - Spacer(Modifier.height(5.dp)) - algorandDivider() - Spacer(Modifier.height(5.dp)) - } - } -} diff --git a/app/src/main/java/com/algorand/android/modules/keyreg/ui/components/Reusables.kt b/app/src/main/java/com/algorand/android/modules/keyreg/ui/components/Reusables.kt deleted file mode 100644 index f671a66c..00000000 --- a/app/src/main/java/com/algorand/android/modules/keyreg/ui/components/Reusables.kt +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright 2022 Pera Wallet, LDA - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - */ - -package com.algorand.android.modules.keyreg.ui.components - -import android.annotation.SuppressLint -import androidx.compose.foundation.layout.height -import androidx.compose.foundation.layout.width -import androidx.compose.foundation.shape.RoundedCornerShape -import androidx.compose.material3.Button -import androidx.compose.material3.ButtonDefaults -import androidx.compose.material3.HorizontalDivider -import androidx.compose.material3.MaterialTheme -import androidx.compose.material3.Text -import androidx.compose.runtime.Composable -import androidx.compose.ui.Modifier -import androidx.compose.ui.graphics.Color -import androidx.compose.ui.unit.dp - -@SuppressLint("ComposableNaming") -@Composable -fun algorandDivider() { - HorizontalDivider( - modifier = - Modifier - .width(327.dp), - thickness = 1.dp, - color = Color.Gray, - ) -} - -@SuppressLint("ComposableNaming") -@Composable -fun algorandButton( - buttonText: String, - onClick: () -> Unit, -) { - Button( - onClick = onClick, - colors = ButtonDefaults.buttonColors(Color.Black), - shape = RoundedCornerShape(8.dp), - modifier = - Modifier - .width(327.dp) - .height(52.dp), - ) { - Text( - text = buttonText, - style = MaterialTheme.typography.labelLarge, - color = Color.White, - ) - } -} diff --git a/app/src/main/java/com/algorand/android/modules/keyreg/ui/components/TopAppBar.kt b/app/src/main/java/com/algorand/android/modules/keyreg/ui/components/TopAppBar.kt deleted file mode 100644 index defc0a49..00000000 --- a/app/src/main/java/com/algorand/android/modules/keyreg/ui/components/TopAppBar.kt +++ /dev/null @@ -1,48 +0,0 @@ -/* - * Copyright 2022 Pera Wallet, LDA - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 - * Unless required by applicable law or agreed to in writing, software - * distributed under the License is distributed on an "AS IS" BASIS, - * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. - * See the License for the specific language governing permissions and - * limitations under the License - */ - -package com.algorand.android.modules.keyreg.ui.components - -import android.annotation.SuppressLint -import androidx.compose.material.icons.Icons -import androidx.compose.material.icons.automirrored.filled.KeyboardArrowLeft -import androidx.compose.material3.ExperimentalMaterial3Api -import androidx.compose.material3.Icon -import androidx.compose.material3.IconButton -import androidx.compose.material3.Text -import androidx.compose.material3.TopAppBar -import androidx.compose.material3.TopAppBarDefaults -import androidx.compose.runtime.Composable -import androidx.compose.ui.graphics.Color - -@OptIn(ExperimentalMaterial3Api::class) -@SuppressLint("ComposableNaming") -@Composable -fun scaffoldTopAppBar(onBackClick: () -> Unit = {}) { - TopAppBar( - title = { - Text(text = "Transaction Signature Request", color = Color.Black) - }, - navigationIcon = { - IconButton(onClick = onBackClick) { - Icon( - imageVector = Icons.AutoMirrored.Filled.KeyboardArrowLeft, - contentDescription = "backIcon", - tint = Color.Black, - ) - } - }, - colors = TopAppBarDefaults.centerAlignedTopAppBarColors( - containerColor = Color.White, - ) - ) -} diff --git a/composeTestApp/src/commonMain/kotlin/co/algorand/app/ui/navigation/BottomNavigationGraph.kt b/composeTestApp/src/commonMain/kotlin/co/algorand/app/ui/navigation/BottomNavigationGraph.kt index 28eed64a..d04f7714 100644 --- a/composeTestApp/src/commonMain/kotlin/co/algorand/app/ui/navigation/BottomNavigationGraph.kt +++ b/composeTestApp/src/commonMain/kotlin/co/algorand/app/ui/navigation/BottomNavigationGraph.kt @@ -18,12 +18,12 @@ import androidx.navigation.NavController import androidx.navigation.NavGraphBuilder import androidx.navigation.compose.composable import androidx.navigation.toRoute -import co.algorand.app.ui.screens.DiscoverScreen -import co.algorand.app.ui.screens.home.AccountsScreen import co.algorand.app.ui.screens.NftsScreen import co.algorand.app.ui.screens.SettingsScreen +import co.algorand.app.ui.screens.home.AccountsScreen import co.algorand.app.ui.widgets.snackbar.SnackBarLayout import co.algorand.app.ui.widgets.snackbar.SnackbarViewModel +import com.algorand.common.account.ui.screens.RecoverAccountInfoScreen import org.koin.compose.viewmodel.koinNavViewModel import org.koin.core.annotation.KoinExperimentalAPI @@ -45,11 +45,12 @@ fun NavGraphBuilder.getBottomNavigationGraph( composable { val backStackEntry = remember(it) { navController.getBackStackEntry() } val sharedViewModel: SnackbarViewModel = koinNavViewModel(viewModelStoreOwner = backStackEntry) - DiscoverScreen( - tag = backStackEntry.toRoute().details.name, - navController = navController, - snackbarViewModel = sharedViewModel, - ) +// DiscoverScreen( +// tag = backStackEntry.toRoute().details.name, +// navController = navController, +// snackbarViewModel = sharedViewModel, +// ) + RecoverAccountInfoScreen() SnackBarLayout(sharedViewModel, snackbarHostState) } composable { diff --git a/wallet-sdk/src/commonMain/composeResources/drawable/ic_close.xml b/wallet-sdk/src/commonMain/composeResources/drawable/ic_close.xml new file mode 100644 index 00000000..3ec4f5af --- /dev/null +++ b/wallet-sdk/src/commonMain/composeResources/drawable/ic_close.xml @@ -0,0 +1,22 @@ + + + + + \ No newline at end of file diff --git a/wallet-sdk/src/commonMain/composeResources/drawable/ic_key.xml b/wallet-sdk/src/commonMain/composeResources/drawable/ic_key.xml new file mode 100644 index 00000000..89bc2f87 --- /dev/null +++ b/wallet-sdk/src/commonMain/composeResources/drawable/ic_key.xml @@ -0,0 +1,27 @@ + + + + + + + + \ No newline at end of file diff --git a/wallet-sdk/src/commonMain/composeResources/drawable/ic_left_arrow.xml b/wallet-sdk/src/commonMain/composeResources/drawable/ic_left_arrow.xml new file mode 100644 index 00000000..b5a7ae87 --- /dev/null +++ b/wallet-sdk/src/commonMain/composeResources/drawable/ic_left_arrow.xml @@ -0,0 +1,23 @@ + + + + + \ No newline at end of file diff --git a/wallet-sdk/src/commonMain/composeResources/values/strings.xml b/wallet-sdk/src/commonMain/composeResources/values/strings.xml index ccc42b56..344a56e3 100644 --- a/wallet-sdk/src/commonMain/composeResources/values/strings.xml +++ b/wallet-sdk/src/commonMain/composeResources/values/strings.xml @@ -5,6 +5,8 @@ Public Key Address Mnemomic / Passphrase Lock Wallet + Recover an Algorand account + In the following steps, you\'ll enter your recovery passphrase to recover an Algorand account. Have your recovery phrase handy before you begin. Could not create/recover wallet from passphrase diff --git a/wallet-sdk/src/commonMain/kotlin/com/algorand/common/account/ui/screens/AccountTypeBottomSheet.kt b/wallet-sdk/src/commonMain/kotlin/com/algorand/common/account/ui/screens/AccountTypeBottomSheet.kt new file mode 100644 index 00000000..1d6ca570 --- /dev/null +++ b/wallet-sdk/src/commonMain/kotlin/com/algorand/common/account/ui/screens/AccountTypeBottomSheet.kt @@ -0,0 +1,174 @@ +package com.algorand.common.account.ui.screens + +import algorand_android.wallet_sdk.generated.resources.Res +import algorand_android.wallet_sdk.generated.resources.ic_close +import algorand_android.wallet_sdk.generated.resources.ic_left_arrow +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Row +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.foundation.layout.wrapContentHeight +import androidx.compose.foundation.shape.RoundedCornerShape +import androidx.compose.material3.Card +import androidx.compose.material3.CardDefaults +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.ModalBottomSheet +import androidx.compose.material3.Text +import androidx.compose.material3.rememberModalBottomSheetState +import androidx.compose.runtime.Composable +import androidx.compose.runtime.LaunchedEffect +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import com.algorand.common.ui.theme.PeraTheme +import org.jetbrains.compose.resources.vectorResource + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun AccountTypeBottomSheet( + isVisible: Boolean, + onDismiss: () -> Unit +) { + val sheetState = rememberModalBottomSheetState( + skipPartiallyExpanded = true + ) + + LaunchedEffect(isVisible) { + if (isVisible) { + sheetState.show() + } else { + sheetState.hide() + } + } + + if (isVisible) { + ModalBottomSheet( + onDismissRequest = onDismiss, + sheetState = sheetState, + //windowInsets = WindowInsets(bottom = paddingValues.calculateBottomPadding()), + modifier = Modifier + .fillMaxWidth() + .wrapContentHeight() + ) { + Column { + CoreActionItem() + } + } + } +} + +@Composable +private fun CoreActionItem( +) { + Column( + modifier = Modifier + .fillMaxWidth() + .padding(16.dp) + ) { + Row { + Icon( + imageVector = vectorResource(Res.drawable.ic_close), + contentDescription = null, + modifier = Modifier.size(20.dp), + + ) + Text( + text = "Select your Mnemonic type", + style = PeraTheme.typography.body.regular.sansBold, + modifier = Modifier.padding(start = 16.dp) + ) + } + + // Card 1 + Card( + modifier = Modifier + .fillMaxWidth().padding(top = 16.dp), + elevation = CardDefaults.cardElevation(8.dp), + + shape = RoundedCornerShape(12.dp), + colors = CardDefaults.cardColors(containerColor = Color.White), + ) { + + Row(Modifier.padding(all = 16.dp)) { + Text( + text = "Bip39", + style = PeraTheme.typography.body.regular.sansBold, + ) + Text( + text = "Recommended", + style = PeraTheme.typography.body.regular.sans, + modifier = Modifier + .background( + color = Color.LightGray, // Set the background color to gray + shape = RoundedCornerShape(20.dp) // Optional: Add rounded corners + ) + .padding(start = 5.dp), + color = Color.White// Add padding for better readability + ) + } + Row(modifier = Modifier.padding(start = 16.dp, top = 16.dp), + horizontalArrangement = Arrangement.SpaceBetween, + verticalAlignment = Alignment.CenterVertically + ) { + Text( + text = "New inter-operable format that enables important features like HD Wallet", + style = PeraTheme.typography.body.regular.sans, + ) + Icon( + imageVector = vectorResource(Res.drawable.ic_left_arrow), + contentDescription = null, + modifier = Modifier.size(20.dp), + ) + } + Text( + text = "24 Key mnemonic keys", + style = PeraTheme.typography.body.regular.sans, + color = Color.Blue, + modifier = Modifier.padding(all = 16.dp) + + ) + + } + Card( + modifier = Modifier + .fillMaxWidth() + .padding(top = 16.dp), + elevation = CardDefaults.cardElevation(8.dp), + + shape = RoundedCornerShape(12.dp), + colors = CardDefaults.cardColors(containerColor = Color.White), + + ) { + Column(Modifier.padding(all=16.dp)) { + Text( + text = "Algo25", + style = PeraTheme.typography.body.regular.sansBold, + ) + Row { + Text( + text = "Legacy Format that is specific to Algorand ecosystem", + style = PeraTheme.typography.body.regular.sans, + ) + Icon( + imageVector = vectorResource(Res.drawable.ic_left_arrow), + contentDescription = null, + modifier = Modifier.size(20.dp), + ) + } + + } + + Text( + text = "25 Key mnemonic keys", + style = PeraTheme.typography.body.regular.sans, + color = Color.Blue, + modifier = Modifier.padding(all = 16.dp) + ) + } + } +} \ No newline at end of file diff --git a/wallet-sdk/src/commonMain/kotlin/com/algorand/common/account/ui/screens/RecoverAccountInfoScreen.kt b/wallet-sdk/src/commonMain/kotlin/com/algorand/common/account/ui/screens/RecoverAccountInfoScreen.kt new file mode 100644 index 00000000..b40a40c9 --- /dev/null +++ b/wallet-sdk/src/commonMain/kotlin/com/algorand/common/account/ui/screens/RecoverAccountInfoScreen.kt @@ -0,0 +1,112 @@ +package com.algorand.common.account.ui.screens + +import algorand_android.wallet_sdk.generated.resources.Res +import algorand_android.wallet_sdk.generated.resources.ic_key +import algorand_android.wallet_sdk.generated.resources.ic_left_arrow +import algorand_android.wallet_sdk.generated.resources.recover_an_algorand +import algorand_android.wallet_sdk.generated.resources.recover_in_the_following +import androidx.compose.foundation.background +import androidx.compose.foundation.layout.Arrangement +import androidx.compose.foundation.layout.Column +import androidx.compose.foundation.layout.Spacer +import androidx.compose.foundation.layout.fillMaxHeight +import androidx.compose.foundation.layout.fillMaxSize +import androidx.compose.foundation.layout.fillMaxWidth +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.padding +import androidx.compose.foundation.layout.size +import androidx.compose.material3.Icon +import androidx.compose.material3.MaterialTheme +import androidx.compose.material3.Scaffold +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.runtime.getValue +import androidx.compose.runtime.mutableStateOf +import androidx.compose.runtime.remember +import androidx.compose.runtime.setValue +import androidx.compose.ui.Alignment +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.text.font.FontWeight +import androidx.compose.ui.unit.dp +import androidx.compose.ui.unit.sp +import com.algorand.common.ui.theme.PeraTheme +import com.algorand.common.ui.widgets.BlackButtonWidget +import com.algorand.common.ui.widgets.TopAppBarWidget +import org.jetbrains.compose.resources.stringResource +import org.jetbrains.compose.resources.vectorResource + +@Composable +fun RecoverAccountInfoScreen( +) { + var isBottomSheetVisible by remember { mutableStateOf(false) } + + Scaffold( + modifier = Modifier + .fillMaxHeight() + .fillMaxWidth() + .background(Color.Blue) + , + topBar = { + TopAppBarWidget( + title = "", + image = vectorResource(Res.drawable.ic_left_arrow), + ) + } + ) { + Column( + verticalArrangement = Arrangement.SpaceEvenly, + horizontalAlignment = Alignment.CenterHorizontally, + modifier = Modifier + .fillMaxSize() + // .background(PeraTheme.colors.background) + .padding(top = 100.dp), + ) { + // Image + Icon( + imageVector = vectorResource(Res.drawable.ic_key), + contentDescription = null, + modifier = Modifier.size(200.dp), + tint = Color.Cyan + + ) + + Spacer(modifier = Modifier.height(16.dp)) + + // Title + Text( + text = stringResource(Res.string.recover_an_algorand), + style = PeraTheme.typography.body.regular.sansBold, + color = MaterialTheme.colorScheme.onBackground, + fontSize = 20.sp, + fontWeight = FontWeight.Bold, + modifier = Modifier.padding(start = 20.dp) + ) + + Spacer(modifier = Modifier.height(8.dp)) + + // Description + Text( + text = stringResource(Res.string.recover_in_the_following), + style = PeraTheme.typography.body.regular.sans, + color = MaterialTheme.colorScheme.onBackground, + modifier = Modifier.padding(start = 20.dp, top = 20.dp) + ) + + Spacer(modifier = Modifier.height(32.dp)) + + BlackButtonWidget( + title = stringResource(Res.string.recover_an_algorand), + onClick = { + isBottomSheetVisible = true + } + ) + + if (isBottomSheetVisible) { + AccountTypeBottomSheet(isBottomSheetVisible) { + isBottomSheetVisible = false // Callback to hide bottom sheet + } + } + } + } +} \ No newline at end of file diff --git a/wallet-sdk/src/commonMain/kotlin/com/algorand/common/ui/widgets/BlackButtonWidget.kt b/wallet-sdk/src/commonMain/kotlin/com/algorand/common/ui/widgets/BlackButtonWidget.kt new file mode 100644 index 00000000..19c1898e --- /dev/null +++ b/wallet-sdk/src/commonMain/kotlin/com/algorand/common/ui/widgets/BlackButtonWidget.kt @@ -0,0 +1,29 @@ +package com.algorand.common.ui.widgets + +import androidx.compose.foundation.layout.height +import androidx.compose.foundation.layout.width +import androidx.compose.material.Button +import androidx.compose.material.ButtonDefaults +import androidx.compose.material3.Text +import androidx.compose.runtime.Composable +import androidx.compose.ui.Modifier +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.unit.dp +import com.algorand.common.ui.theme.PeraTheme + +@Composable +fun BlackButtonWidget(title: String, onClick: () -> Unit) { + Button( + onClick = onClick, + colors = ButtonDefaults.buttonColors(Color.Black), + modifier = + Modifier + .width(327.dp) + .height(52.dp) + ) { + Text( + text = title, + style = PeraTheme.typography.body.regular.sans, + color = Color.White) + } +} \ No newline at end of file diff --git a/wallet-sdk/src/commonMain/kotlin/com/algorand/common/ui/widgets/TopAppBarWidget.kt b/wallet-sdk/src/commonMain/kotlin/com/algorand/common/ui/widgets/TopAppBarWidget.kt new file mode 100644 index 00000000..ace64de2 --- /dev/null +++ b/wallet-sdk/src/commonMain/kotlin/com/algorand/common/ui/widgets/TopAppBarWidget.kt @@ -0,0 +1,32 @@ +package com.algorand.common.ui.widgets + +import androidx.compose.material.icons.Icons +import androidx.compose.material.icons.automirrored.filled.KeyboardArrowLeft +import androidx.compose.material3.ExperimentalMaterial3Api +import androidx.compose.material3.Icon +import androidx.compose.material3.Text +import androidx.compose.material3.TopAppBar +import androidx.compose.material3.TopAppBarDefaults +import androidx.compose.runtime.Composable +import androidx.compose.ui.graphics.Color +import androidx.compose.ui.graphics.vector.ImageVector + + +@OptIn(ExperimentalMaterial3Api::class) +@Composable +fun TopAppBarWidget(title: String, image: ImageVector) { + TopAppBar( + colors = + TopAppBarDefaults.topAppBarColors( + containerColor = Color.White, + titleContentColor = Color.Black, + ), + title = { Text(text = title) }, + navigationIcon = { + Icon( + imageVector = Icons.AutoMirrored.Filled.KeyboardArrowLeft, + contentDescription = "backIcon", + ) + } + ) +} \ No newline at end of file