Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
<uses-permission android:name="com.google.android.gms.permission.AD_ID" /> <!-- Allows unlocking your device and activating its screen so UI tests can succeed -->
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" /> <!-- Allows changing locales -->
<uses-permission android:name="android.permission.CHANGE_CONFIGURATION" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />


<meta-data android:name="google_analytics_default_allow_analytics_storage" android:value="true" />
Expand Down
2 changes: 2 additions & 0 deletions app/src/main/java/com/brainwallet/constants/BWConstants.kt
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,8 @@ object BWConstants {
const val TOS_LINK: String = "https://www.brainwallet.co/privacypolicy"
const val LINKTREE_URL: String = "https://linktr.ee/brainwallet"

const val BITREFILL_URL: String = "https://www.bitrefill.com/?ref=bAshL935"

/**
* API Hosts
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,12 @@ import androidx.navigation.compose.NavHost
import androidx.navigation.compose.composable
import androidx.navigation.compose.rememberNavController
import androidx.navigation.toRoute
import com.brainwallet.constants.BWConstants
import com.brainwallet.ui.screens.buyreceive.BuyReceiveScreen
import com.brainwallet.ui.screens.gamehub.GameHubScreen
import com.brainwallet.ui.screens.home.MainScreen
import com.brainwallet.ui.bentosections.buyreceivebento.receive.ReceiveDialog
import com.brainwallet.ui.screens.main.WebModalScreen
import com.brainwallet.ui.screens.restore.RestoreScreen
import com.brainwallet.ui.screens.ready.ReadyScreen
import com.brainwallet.ui.screens.send.SendScreen
Expand Down Expand Up @@ -132,8 +134,24 @@ fun NavGraphBuilder.mainNavGraph(
val route: Route.GameHub = navBackStackEntry.toRoute()
GameHubScreen(onNavigate = onNavigate)
}
composable<Route.MoonPayWeb> { navBackStackEntry ->
composable<Route.MoonPayBuy> { navBackStackEntry ->
val route: Route.GameHub = navBackStackEntry.toRoute()
BuyReceiveScreen(onNavigate = onNavigate)
}

composable<Route.LinktreeWeb> { navBackStackEntry ->
val route: Route.LinktreeWeb = navBackStackEntry.toRoute()
WebModalScreen(
onNavigate = onNavigate,
url = BWConstants.LINKTREE_URL
)
}

composable<Route.BitrefillWeb> { navBackStackEntry ->
val route: Route.LinktreeWeb = navBackStackEntry.toRoute()
WebModalScreen(
onNavigate = onNavigate,
url = BWConstants.BITREFILL_URL
)
}
}
8 changes: 7 additions & 1 deletion app/src/main/java/com/brainwallet/navigation/Route.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,5 +62,11 @@ sealed class Route : JavaSerializable {
object GameHub : Route()

@Serializable
object MoonPayWeb : Route()
object MoonPayBuy : Route()

@Serializable
object BitrefillWeb : Route()

@Serializable
object LinktreeWeb : Route()
}

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
package com.brainwallet.ui.bentosections.shopbento

import androidx.compose.animation.core.animateFloatAsState
import androidx.compose.animation.core.tween
import androidx.compose.foundation.layout.Box
import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.fillMaxHeight
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.foundation.layout.offset
import androidx.compose.runtime.Composable
import androidx.compose.runtime.LaunchedEffect
import androidx.compose.runtime.mutableStateOf
import androidx.compose.runtime.remember
import androidx.compose.ui.Modifier
import androidx.compose.ui.tooling.preview.Preview
import androidx.compose.ui.unit.dp
import com.brainwallet.ui.bentosections.shopbento.cards.CardAmazonComposable
import com.brainwallet.ui.bentosections.shopbento.cards.CardJustEatComposable
import com.brainwallet.ui.bentosections.shopbento.cards.CardVisaComposable
import androidx.compose.runtime.getValue
import androidx.compose.runtime.setValue

@Composable
fun GiftCardsComposable(
state: ShopBentoState,
cardData: String,
modifier: Modifier = Modifier,
) {
val cornerRadius = 4.dp
var appeared by remember { mutableStateOf(false) }

LaunchedEffect(Unit) {
appeared = true
}

val offsetVisa by animateFloatAsState(
targetValue = if (appeared) -10f else 100f,
animationSpec = tween(
500,
delayMillis = 200
),
label = "visaSlide"
)

val offsetJE by animateFloatAsState(
targetValue = if (appeared) 30f else 100f,
animationSpec = tween(
600,
delayMillis = 200
),
label = "jeSlide"
)

val offsetAmazon by animateFloatAsState(
targetValue = if (appeared) -12f else 50f,
animationSpec = tween(
400,
delayMillis = 200
),
label = "amazonSlide"
)

Box(
modifier = Modifier
.fillMaxSize()

) {
Column(
modifier = Modifier
.fillMaxHeight()
.offset(x = offsetVisa.dp, y = 5.dp)
) {
CardVisaComposable(rotation = 20f)
}

Column(
modifier = Modifier
.fillMaxHeight()
.offset(x = offsetAmazon.dp, y = -15.dp)

) {
CardAmazonComposable(rotation = 20f)
}

Column(
modifier = Modifier
.fillMaxHeight()
.offset(x = offsetJE.dp, y = 15.dp)

) {
CardJustEatComposable(rotation = -30f)
}
}
}

@Preview
@Composable
private fun GiftCardsComposablePreview() {
Box(modifier = Modifier) {
GiftCardsComposable(state = ShopBentoState(), cardData = "acr")
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.brainwallet.ui.bentosections.shopbento

sealed class ShopBentoEvent {
data object OnLoad : ShopBentoEvent()
data object OnTapShop : ShopBentoEvent()
}
Loading
Loading