Skip to content

Commit 4e3a8f6

Browse files
Merge pull request #284 from woocommerce/issue/136-orders-list-states
Orders List: Empty + Error States
2 parents 624f206 + b73e2f9 commit 4e3a8f6

File tree

10 files changed

+404
-236
lines changed

10 files changed

+404
-236
lines changed
Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,43 @@
11
import UIKit
22

3+
4+
/// WooCommerce UIButton Style Helpers
5+
///
36
extension UIButton {
7+
8+
/// Applies the Primary Button Style: Solid BG!
9+
///
410
func applyPrimaryButtonStyle() {
5-
layer.borderColor = StyleManager.wooCommerceBrandColor.cgColor
611
backgroundColor = StyleManager.wooCommerceBrandColor
12+
contentEdgeInsets = Style.defaultEdgeInsets
713
tintColor = .white
8-
layer.cornerRadius = 8.0
9-
contentEdgeInsets = UIEdgeInsetsMake(16.0, 16.0, 16.0, 16.0)
14+
layer.borderColor = StyleManager.wooCommerceBrandColor.cgColor
15+
layer.borderWidth = Style.defaultBorderWidth
16+
layer.cornerRadius = Style.defaultCornerRadius
1017
titleLabel?.applyHeadlineStyle()
1118
}
19+
20+
/// Applies the Primary Button Style: Clear BG / Bordered Outline
21+
///
22+
func applySecondaryButtonStyle() {
23+
backgroundColor = .clear
24+
contentEdgeInsets = Style.defaultEdgeInsets
25+
tintColor = StyleManager.wooCommerceBrandColor
26+
layer.borderColor = StyleManager.wooCommerceBrandColor.cgColor
27+
layer.borderWidth = Style.defaultBorderWidth
28+
layer.cornerRadius = Style.defaultCornerRadius
29+
titleLabel?.applyHeadlineStyle()
30+
}
31+
}
32+
33+
34+
// MARK: - Private Structures
35+
//
36+
private extension UIButton {
37+
38+
struct Style {
39+
static let defaultCornerRadius = CGFloat(8.0)
40+
static let defaultBorderWidth = CGFloat(1.0)
41+
static let defaultEdgeInsets = UIEdgeInsets(top: 12, left: 22, bottom: 12, right: 22)
42+
}
1243
}

WooCommerce/Classes/Extensions/UIImage+Woo.swift

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,4 +32,16 @@ extension UIImage {
3232
static var jetpackLogoImage: UIImage {
3333
return UIImage(named: "icon-jetpack-gray")!
3434
}
35+
36+
/// Error State Image
37+
///
38+
static var errorStateImage: UIImage {
39+
return UIImage(named: "woo-error-state")!
40+
}
41+
42+
/// Waiting for Customers Image
43+
///
44+
static var waitingForCustomersImage: UIImage {
45+
return UIImage(named: "woo-waiting-customers")!
46+
}
3547
}

0 commit comments

Comments
 (0)