-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
245 additions
and
124 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
44 changes: 44 additions & 0 deletions
44
dydx/dydxViews/dydxViews/_v4/Receipt/Components/ReceiptLoadingItemView.swift
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// | ||
// dydxReceiptLoadingItemView.swift | ||
// dydxUI | ||
// | ||
// Created by Mike Maguire on 6/11/24. | ||
// Copyright © 2024 dYdX Trading Inc. All rights reserved. | ||
// | ||
|
||
import SwiftUI | ||
import PlatformUI | ||
import Utilities | ||
|
||
public class dydxReceiptLoadingItemView: PlatformViewModel { | ||
@Published public var title: String | ||
|
||
public init(title: String) { | ||
self.title = title | ||
} | ||
|
||
public static var previewValue: dydxReceiptChangeItemView { | ||
let vm = dydxReceiptChangeItemView(title: "Title") | ||
return vm | ||
} | ||
|
||
public override func createView(parentStyle: ThemeStyle = ThemeStyle.defaultStyle, styleKey: String? = nil) -> PlatformView { | ||
PlatformView(viewModel: self, parentStyle: parentStyle, styleKey: styleKey) { [weak self] _ in | ||
guard let self = self else { return AnyView(PlatformView.nilView) } | ||
let textFontSize = ThemeFont.FontSize.small | ||
return AnyView( | ||
HStack(alignment: .top) { | ||
Text(self.title) | ||
.themeFont(fontSize: textFontSize) | ||
.themeColor(foreground: .textTertiary) | ||
.lineLimit(2) | ||
Spacer() | ||
ProgressView() | ||
.progressViewStyle(.circular) | ||
.tint(ThemeColor.SemanticColor.textSecondary.color) | ||
.frame(height: ThemeSettings.shared.themeConfig.themeFont.uiFont(of: .base, fontSize: textFontSize)?.lineHeight) | ||
} | ||
) | ||
} | ||
} | ||
} |
Oops, something went wrong.