Skip to content
This repository has been archived by the owner on May 10, 2024. It is now read-only.

Commit

Permalink
Fix #7619: Wallet V2 onboarding flow (#7746)
Browse files Browse the repository at this point in the history
  • Loading branch information
nuo-xu authored Aug 8, 2023
1 parent e3e5976 commit de2f49d
Show file tree
Hide file tree
Showing 52 changed files with 1,547 additions and 716 deletions.
7 changes: 4 additions & 3 deletions Sources/BraveUI/SwiftUI/CustomPrivacySensitiveModifier.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@ import SwiftUI
/// The `.privacySensitive()` doesn't work in sheets because the
/// `redactedReasons` doesn't get passed through the environment in sheets.
private struct CustomPrivacySensitiveModifier: ViewModifier {
var isDisclosed: Bool

@State private var isBackgrounded: Bool = false
@State private var isCaptured: Bool = false

func body(content: Content) -> some View {
Group {
if isBackgrounded || isCaptured {
if isBackgrounded || isCaptured || !isDisclosed {
content
.opacity(0)
.overlay(alignment: .center) {
Expand Down Expand Up @@ -50,7 +51,7 @@ private struct CustomPrivacySensitiveModifier: ViewModifier {
extension View {
/// Redacts the given view if the app is backgrounded, or the system is actively
/// recording, mirroring, or using AirPlay to stream the contents of the screen.
public func customPrivacySensitive() -> some View {
modifier(CustomPrivacySensitiveModifier())
public func customPrivacySensitive(isDisclosed: Bool = true) -> some View {
modifier(CustomPrivacySensitiveModifier(isDisclosed: isDisclosed))
}
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
{
"images" : [
{
"filename" : "brave-wallet-setup.png",
"idiom" : "universal",
"scale" : "1x"
},
Expand All @@ -12,12 +11,11 @@
"value" : "dark"
}
],
"filename" : "brave-wallet-setup-dark.png",
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "brave-wallet-setup@2x.png",
"filename" : "background landing@2x.png",
"idiom" : "universal",
"scale" : "2x"
},
Expand All @@ -28,12 +26,12 @@
"value" : "dark"
}
],
"filename" : "brave-wallet-setup[email protected]",
"filename" : "background-landing[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "brave-wallet-setup@3x.png",
"filename" : "background landing@3x.png",
"idiom" : "universal",
"scale" : "3x"
},
Expand All @@ -44,7 +42,7 @@
"value" : "dark"
}
],
"filename" : "brave-wallet-setup[email protected]",
"filename" : "background-landing[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"images" : [
{
"idiom" : "universal",
"scale" : "1x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "2x"
},
{
"filename" : "[email protected]",
"idiom" : "universal",
"scale" : "3x"
}
],
"info" : {
"author" : "xcode",
"version" : 1
}
}
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
31 changes: 24 additions & 7 deletions Sources/BraveWallet/Crypto/CryptoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import SwiftUI
import BraveCore
import Introspect
import BraveUI
import Preferences

public struct CryptoView: View {
var walletStore: WalletStore
Expand All @@ -19,6 +20,8 @@ public struct CryptoView: View {
var openWalletURLAction: ((URL) -> Void)?

var appRatingRequestAction: (() -> Void)?

@ObservedObject var isOnboardingCompleted = Preferences.Wallet.isOnboardingCompleted

public init(
walletStore: WalletStore,
Expand Down Expand Up @@ -234,14 +237,28 @@ public struct CryptoView: View {
.transition(.move(edge: .bottom))
.zIndex(1) // Needed or the dismiss animation messes up
case .onboarding:
UIKitNavigationView {
SetupCryptoView(keyringStore: keyringStore)
.toolbar {
dismissButtonToolbarContents
}
if isOnboardingCompleted.value {
UIKitNavigationView {
OnboardingCompletedView(keyringStore: keyringStore)
}
.transition(.move(edge: .bottom))
.zIndex(2) // Needed or the dismiss animation messes up
} else {
UIKitNavigationView {
SetupCryptoView(keyringStore: keyringStore)
.toolbar {
ToolbarItemGroup(placement: .destructiveAction) {
Button(action: {
dismissAction()
}) {
Text(Strings.CancelString)
}
}
}
}
.transition(.move(edge: .bottom))
.zIndex(3) // Needed or the dismiss animation messes up
}
.transition(.move(edge: .bottom))
.zIndex(2) // Needed or the dismiss animation messes up
}
}
.animation(.default, value: visibleScreen) // Animate unlock dismiss (required for some reason)
Expand Down
Loading

0 comments on commit de2f49d

Please sign in to comment.