Skip to content
Draft
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
4 changes: 4 additions & 0 deletions VultisigApp/VultisigApp.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -402,6 +402,7 @@
13AB73742EB9240300DA106B /* ClosureValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13AB73732EB923FD00DA106B /* ClosureValidator.swift */; };
13AB73762EB925A100DA106B /* AmountBalanceValidator.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13AB73752EB9259A00DA106B /* AmountBalanceValidator.swift */; };
13AC28082E61E294001CB9AA /* ScreenEdgeInsets.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13AC28072E61E293001CB9AA /* ScreenEdgeInsets.swift */; };
2A815BD9B4E8BD1F2B92DC8D /* ScreenEnvironmentKeys.swift in Sources */ = {isa = PBXBuildFile; fileRef = 37E842BB32016836B2202DE7 /* ScreenEnvironmentKeys.swift */; };
13AC84032EA8518700C1399E /* THORChainAPICache.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13AC84022EA8518700C1399E /* THORChainAPICache.swift */; };
13AF0D182E4CE655004D4FD2 /* NavigationRouter.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13AF0D172E4CE652004D4FD2 /* NavigationRouter.swift */; };
13AF0D1A2E4CE672004D4FD2 /* NavigationRouter+EnvironmentKey.swift in Sources */ = {isa = PBXBuildFile; fileRef = 13AF0D192E4CE672004D4FD2 /* NavigationRouter+EnvironmentKey.swift */; };
Expand Down Expand Up @@ -1741,6 +1742,7 @@
13AB73732EB923FD00DA106B /* ClosureValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ClosureValidator.swift; sourceTree = "<group>"; };
13AB73752EB9259A00DA106B /* AmountBalanceValidator.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AmountBalanceValidator.swift; sourceTree = "<group>"; };
13AC28072E61E293001CB9AA /* ScreenEdgeInsets.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScreenEdgeInsets.swift; sourceTree = "<group>"; };
37E842BB32016836B2202DE7 /* ScreenEnvironmentKeys.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ScreenEnvironmentKeys.swift; sourceTree = "<group>"; };
13AC84022EA8518700C1399E /* THORChainAPICache.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = THORChainAPICache.swift; sourceTree = "<group>"; };
13AF0D172E4CE652004D4FD2 /* NavigationRouter.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NavigationRouter.swift; sourceTree = "<group>"; };
13AF0D192E4CE672004D4FD2 /* NavigationRouter+EnvironmentKey.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NavigationRouter+EnvironmentKey.swift"; sourceTree = "<group>"; };
Expand Down Expand Up @@ -4676,6 +4678,7 @@
isa = PBXGroup;
children = (
13AC28072E61E293001CB9AA /* ScreenEdgeInsets.swift */,
37E842BB32016836B2202DE7 /* ScreenEnvironmentKeys.swift */,
137B2C882E3A84440074F648 /* Screen.swift */,
);
path = Screen;
Expand Down Expand Up @@ -7270,6 +7273,7 @@
13C0F79A2EC60C3A00C2A3B8 /* DefiBalanceService.swift in Sources */,
A65649F82B96701300E4B329 /* UTXOTransactionMempoolPreviousOutput.swift in Sources */,
13AC28082E61E294001CB9AA /* ScreenEdgeInsets.swift in Sources */,
2A815BD9B4E8BD1F2B92DC8D /* ScreenEnvironmentKeys.swift in Sources */,
137B2C892E3A84460074F648 /* Screen.swift in Sources */,
46F8F7212B99FDB70099454E /* TransactionBroadcastResponse.swift in Sources */,
131603452E609D74001ED972 /* FileExporterSheet.swift in Sources */,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,13 @@ struct CircleDepositView: View {
}

var content: some View {
Screen(
title: NSLocalizedString("circleDepositTitle", comment: "Deposit to Circle Account"),
showNavigationBar: true,
backgroundType: .plain
) {
Screen {
VStack(spacing: 0) {
scrollableContent
footerView
}
}
.screenTitle(NSLocalizedString("circleDepositTitle", comment: "Deposit to Circle Account"))
.withLoading(isLoading: $isLoading)
.task {
await loadData()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ struct CircleView: View {
}

var content: some View {
Screen(
title: NSLocalizedString("circleTitle", comment: "Circle"),
showNavigationBar: true,
backgroundType: .plain
) {
Screen {
if !hasCheckedBackend {
// Show loading while checking backend
ProgressView()
Expand Down Expand Up @@ -63,6 +59,7 @@ struct CircleView: View {
}
}
}
.screenTitle(NSLocalizedString("circleTitle", comment: "Circle"))
.onAppear {
Task { await checkExistingWallet() }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,13 @@ struct CircleWithdrawView: View {
}

var content: some View {
Screen(
title: NSLocalizedString("circleWithdrawTitle", comment: "Withdraw from Circle"),
showNavigationBar: true,
backgroundType: .plain
) {
Screen {
VStack(spacing: 0) {
scrollableContent
footerView
}
}
.screenTitle(NSLocalizedString("circleWithdrawTitle", comment: "Withdraw from Circle"))
.withLoading(isLoading: $isLoading)
.task {
await loadFastVaultStatus()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,11 +30,7 @@ struct TronFreezeView: View {
}

var content: some View {
Screen(
title: NSLocalizedString("tronFreezeTitle", comment: "Freeze TRX"),
showNavigationBar: true,
backgroundType: .plain
) {
Screen {
ZStack {
VStack(spacing: 0) {
scrollableContent
Expand All @@ -47,6 +43,7 @@ struct TronFreezeView: View {
}
}
}
.screenTitle(NSLocalizedString("tronFreezeTitle", comment: "Freeze TRX"))
.task {
await loadData()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,7 @@ struct TronUnfreezeView: View {
}

var content: some View {
Screen(
title: NSLocalizedString("tronUnfreezeTitle", comment: "Unfreeze TRX"),
showNavigationBar: true,
backgroundType: .plain
) {
Screen {
ZStack {
VStack(spacing: 0) {
scrollableContent
Expand All @@ -53,6 +49,7 @@ struct TronUnfreezeView: View {
}
}
}
.screenTitle(NSLocalizedString("tronUnfreezeTitle", comment: "Unfreeze TRX"))
.task {
await loadData()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,11 +21,7 @@ struct TronView: View {
}

var content: some View {
Screen(
title: NSLocalizedString("tronTitle", comment: "TRON Staking"),
showNavigationBar: true,
backgroundType: .plain
) {
Screen {
if model.missingTrx {
// Show warning to add TRX
VStack(spacing: 24) {
Expand Down Expand Up @@ -53,6 +49,7 @@ struct TronView: View {
TronDashboardView(vault: vault, model: model, onRefresh: loadData)
}
}
.screenTitle(NSLocalizedString("tronTitle", comment: "TRON Staking"))
.onAppear {
Task { await loadData() }
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ struct FormScreen<Content: View>: View {
}

var body: some View {
Screen(title: title) {
Screen {
VStack(spacing: 12) {
GeometryReader { geo in
ScrollViewReader { proxy in
Expand All @@ -51,5 +51,6 @@ struct FormScreen<Content: View>: View {
}
}
}
.screenTitle(title)
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ struct AssetSelectionListScreen: View {
}

var body: some View {
Screen(showNavigationBar: false) {
Screen {
VStack(spacing: 8) {
SearchTextField(value: $viewModel.searchText)
ScrollView {
Expand All @@ -41,15 +41,17 @@ struct AssetSelectionListScreen: View {
.cornerRadius(12)
}
}
.applySheetSize()
.sheetStyle()
.crossPlatformToolbar("selectAsset".localized, showsBackButton: false) {
.screenTitle("selectAsset".localized)
.screenBackButtonHidden()
.screenToolbar {
CustomToolbarItem(placement: .leading) {
ToolbarButton(image: "x") {
isPresented.toggle()
}
}
}
.applySheetSize()
.sheetStyle()
.onDisappear { viewModel.searchText = "" }
.onLoad {
Task {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct ImportVaultSelectionSheet: View {
let onVaultShare: () -> Void

var body: some View {
Screen(showNavigationBar: false) {
Screen {
VStack(spacing: 14) {
Text("importVaultSelectionTitle")
.foregroundStyle(Theme.colors.textPrimary)
Expand All @@ -40,7 +40,9 @@ struct ImportVaultSelectionSheet: View {
)
}
}
.crossPlatformToolbar(ignoresTopEdge: true, showsBackButton: false) {
.screenBackButtonHidden()
.screenIgnoresTopEdge()
.screenToolbar {
CustomToolbarItem(placement: .leading) {
ToolbarButton(image: "x") {
isPresented.toggle()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@ struct KeyImportChainsSetupScreen: View {
@Environment(\.router) var router

var body: some View {
Screen(
title: viewModel.screenTitle,
showNavigationBar: false,
backgroundType: viewModel.state == .activeChains ? .gradient : .plain
) {
Screen {
Group {
switch viewModel.state {
case .scanningChains:
Expand Down Expand Up @@ -47,8 +43,10 @@ struct KeyImportChainsSetupScreen: View {
.transition(.opacity)
.animation(.interpolatingSpring, value: viewModel.state)
}
.screenTitle(viewModel.screenTitle)
.screenIgnoresTopEdge(viewModel.state == .activeChains)
.screenBackground(viewModel.state == .activeChains ? .gradient : .plain)
.withLoading(isLoading: $viewModel.isLoading)
.crossPlatformToolbar(viewModel.screenTitle, ignoresTopEdge: viewModel.state == .activeChains)
}

func onCustomizeChains() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ struct OnboardingDevicesSelectionScreen: View {
@Environment(\.router) var router

var body: some View {
Screen(showNavigationBar: false, backgroundType: .clear) {
Screen {
VStack(spacing: 0) {
animationVM?.view()
.frame(maxWidth: 400)
Expand All @@ -31,9 +31,10 @@ struct OnboardingDevicesSelectionScreen: View {
}
.padding(.top, 64)
}
.screenIgnoresTopEdge()
.screenBackground(.clear)
.background(background)
.onLoad(perform: onLoad)
.crossPlatformToolbar(.empty, ignoresTopEdge: true)
}

var tipView: some View {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ struct OnboardingOverviewScreen: View {
}

var body: some View {
Screen(showNavigationBar: false) {
Screen {
VStack(alignment: .leading, spacing: 0) {
Spacer()
animation
Expand All @@ -46,6 +46,7 @@ struct OnboardingOverviewScreen: View {
}
}
}
.screenBackButtonHidden()
.onLoad(perform: onLoad)
.crossPlatformSheet(isPresented: $isVerificationLinkActive) {
ServerBackupVerificationScreen(
Expand All @@ -63,7 +64,6 @@ struct OnboardingOverviewScreen: View {
}
)
}
.crossPlatformToolbar(.empty, showsBackButton: false)
.navigationBarBackButtonHidden(true)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ struct OnboardingVaultSetupInformationScreen: View {
}

var body: some View {
Screen(edgeInsets: .init(leading: 24, trailing: 24)) {
Screen {
VStack(alignment: .leading, spacing: 0) {
VStack(alignment: .leading, spacing: 20) {
Text("yourVaultSetup".localized)
Expand Down Expand Up @@ -52,6 +52,7 @@ struct OnboardingVaultSetupInformationScreen: View {
}
.frame(maxWidth: .infinity, alignment: .leading)
}
.screenEdgeInsets(.init(leading: 24, trailing: 24))
.onLoad(perform: onLoad)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ struct OnboardingYourVaultSetupScreen: View {
@Environment(\.router) var router

var body: some View {
Screen(edgeInsets: .init(leading: 24, trailing: 24)) {
Screen {
VStack(alignment: .leading, spacing: 0) {
VStack(alignment: .leading, spacing: 20) {
Text("yourVaultSetup".localized)
Expand All @@ -45,6 +45,7 @@ struct OnboardingYourVaultSetupScreen: View {
}
.frame(maxWidth: .infinity, alignment: .leading)
}
.screenEdgeInsets(.init(leading: 24, trailing: 24))
.onLoad(perform: onLoad)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,10 @@ struct ImportVaultShareScreen: View {
@EnvironmentObject var appViewModel: AppViewModel

var body: some View {
Screen(title: "importVault".localized) {
Screen {
content
}
.screenTitle("importVault".localized)
.fileImporter(
isPresented: $backupViewModel.showVaultImporter,
allowedContentTypes: [.vaultBackup, .vaultFile],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -71,20 +71,20 @@ struct VaultSetupScreen: View {
// MARK: - Body

var body: some View {
Screen(edgeInsets: .init(leading: 24, trailing: 24)) {
Screen {
VStack(spacing: 0) {
ScrollView(showsIndicators: false) {
VStack(spacing: 0) {
stepIndicator
.padding(.top, 24)
.padding(.bottom, 24)

stepContent
}
}

Spacer()

PrimaryButton(
title: isLastStep && isCurrentStepValid
? "createVault".localized
Expand All @@ -99,6 +99,7 @@ struct VaultSetupScreen: View {
}
}
}
.screenEdgeInsets(.init(leading: 24, trailing: 24))
.onLoad {
viewModel.onLoad()
focusedField = .name
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ struct VultDiscountTiersScreen: View {
private let service = VultTierService()

var body: some View {
Screen(showNavigationBar: false, edgeInsets: .init(bottom: 0)) {
Screen {
ScrollViewReader { proxy in
ScrollView(showsIndicators: false) {
VStack(spacing: 12) {
Expand Down Expand Up @@ -58,7 +58,9 @@ struct VultDiscountTiersScreen: View {
.onLoad { scrollProxy = proxy }
}
}
.crossPlatformToolbar("vultDiscountTiers".localized) {
.screenTitle("vultDiscountTiers".localized)
.screenEdgeInsets(.init(bottom: 0))
.screenToolbar {
CustomToolbarItem(placement: .trailing) {
ToolbarButton(image: "globus") {
openURL(StaticURL.VultisigVultURL)
Expand Down
Loading