Skip to content

Commit 7678b57

Browse files
committed
Implements EmptyStoresTableViewCell
1 parent 9ec3339 commit 7678b57

File tree

3 files changed

+83
-0
lines changed

3 files changed

+83
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import Foundation
2+
import UIKit
3+
4+
5+
/// EmptyStores: Displayed whenever there are no available WooCommerce Stores associated with the active account.
6+
///
7+
class EmptyStoresTableViewCell: UITableViewCell {
8+
9+
/// UITableView's Reuse Identifier.
10+
///
11+
static let reuseIdentifier = EmptyStoresTableViewCell.classNameWithoutNamespaces
12+
13+
/// LegendLabel: To be displayed below the ImageView.
14+
///
15+
@IBOutlet private var legendLabel: UILabel! {
16+
didSet {
17+
legendLabel.textColor = StyleManager.wooGreyTextMin
18+
legendLabel.font = .subheadline
19+
legendLabel.text = NSLocalizedString("Unable to find WooCommerce stores connected to this account",
20+
comment: "Displayed during the Login flow, whenever the user has no woo stores associated.")
21+
}
22+
}
23+
}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<document type="com.apple.InterfaceBuilder3.CocoaTouch.XIB" version="3.0" toolsVersion="14113" targetRuntime="iOS.CocoaTouch" propertyAccessControl="none" useAutolayout="YES" useTraitCollections="YES" useSafeAreas="YES" colorMatched="YES">
3+
<device id="retina4_7" orientation="portrait">
4+
<adaptation id="fullscreen"/>
5+
</device>
6+
<dependencies>
7+
<plugIn identifier="com.apple.InterfaceBuilder.IBCocoaTouchPlugin" version="14088"/>
8+
<capability name="Constraints to layout margins" minToolsVersion="6.0"/>
9+
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
10+
</dependencies>
11+
<objects>
12+
<placeholder placeholderIdentifier="IBFilesOwner" id="-1" userLabel="File's Owner"/>
13+
<placeholder placeholderIdentifier="IBFirstResponder" id="-2" customClass="UIResponder"/>
14+
<tableViewCell clipsSubviews="YES" contentMode="scaleToFill" preservesSuperviewLayoutMargins="YES" selectionStyle="none" indentationWidth="10" rowHeight="242" id="qMv-Pb-lgn" customClass="EmptyStoresTableViewCell" customModule="WooCommerce" customModuleProvider="target">
15+
<rect key="frame" x="0.0" y="0.0" width="375" height="242"/>
16+
<autoresizingMask key="autoresizingMask"/>
17+
<tableViewCellContentView key="contentView" opaque="NO" clipsSubviews="YES" multipleTouchEnabled="YES" contentMode="center" preservesSuperviewLayoutMargins="YES" insetsLayoutMarginsFromSafeArea="NO" tableViewCell="qMv-Pb-lgn" id="gcY-Gg-DvR">
18+
<rect key="frame" x="0.0" y="0.0" width="375" height="241.5"/>
19+
<autoresizingMask key="autoresizingMask"/>
20+
<subviews>
21+
<imageView userInteractionEnabled="NO" contentMode="scaleToFill" horizontalHuggingPriority="251" verticalHuggingPriority="251" image="woo-no-store" translatesAutoresizingMaskIntoConstraints="NO" id="uuh-xp-DA5">
22+
<rect key="frame" x="0.0" y="0.0" width="375" height="180"/>
23+
</imageView>
24+
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" text="Label" textAlignment="center" lineBreakMode="tailTruncation" numberOfLines="0" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="bPV-bJ-GBz">
25+
<rect key="frame" x="26" y="200.5" width="323" height="20.5"/>
26+
<fontDescription key="fontDescription" type="system" pointSize="17"/>
27+
<nil key="textColor"/>
28+
<nil key="highlightedColor"/>
29+
</label>
30+
</subviews>
31+
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
32+
<constraints>
33+
<constraint firstItem="bPV-bJ-GBz" firstAttribute="leading" secondItem="gcY-Gg-DvR" secondAttribute="leadingMargin" constant="10" id="02T-fd-amz"/>
34+
<constraint firstAttribute="trailingMargin" secondItem="bPV-bJ-GBz" secondAttribute="trailing" constant="10" id="4v0-dU-uL0"/>
35+
<constraint firstItem="uuh-xp-DA5" firstAttribute="top" secondItem="gcY-Gg-DvR" secondAttribute="top" id="AXH-sZ-i9m"/>
36+
<constraint firstItem="uuh-xp-DA5" firstAttribute="leading" secondItem="gcY-Gg-DvR" secondAttribute="leading" id="QK4-JX-5Z1"/>
37+
<constraint firstItem="bPV-bJ-GBz" firstAttribute="top" relation="greaterThanOrEqual" secondItem="uuh-xp-DA5" secondAttribute="bottom" constant="10" id="YHi-MJ-ZFK"/>
38+
<constraint firstAttribute="bottomMargin" secondItem="bPV-bJ-GBz" secondAttribute="bottom" constant="10" id="Zyf-Uq-D8M"/>
39+
<constraint firstAttribute="trailing" secondItem="uuh-xp-DA5" secondAttribute="trailing" id="egs-Ij-2lL"/>
40+
</constraints>
41+
</tableViewCellContentView>
42+
<color key="backgroundColor" white="0.0" alpha="0.0" colorSpace="custom" customColorSpace="genericGamma22GrayColorSpace"/>
43+
<connections>
44+
<outlet property="legendLabel" destination="bPV-bJ-GBz" id="sQX-ir-ghQ"/>
45+
</connections>
46+
<point key="canvasLocation" x="-162.5" y="-12"/>
47+
</tableViewCell>
48+
</objects>
49+
<resources>
50+
<image name="woo-no-store" width="320" height="180"/>
51+
</resources>
52+
</document>

WooCommerce/WooCommerce.xcodeproj/project.pbxproj

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,8 @@
4545
B57C744320F54F1C00EEFC87 /* AccountHeaderView.xib in Resources */ = {isa = PBXBuildFile; fileRef = B57C744220F54F1C00EEFC87 /* AccountHeaderView.xib */; };
4646
B57C744520F55BA600EEFC87 /* NSObject+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = B57C744420F55BA600EEFC87 /* NSObject+Helpers.swift */; };
4747
B57C744720F55BC800EEFC87 /* UIView+Helpers.swift in Sources */ = {isa = PBXBuildFile; fileRef = B57C744620F55BC800EEFC87 /* UIView+Helpers.swift */; };
48+
B57C744A20F5649300EEFC87 /* EmptyStoresTableViewCell.swift in Sources */ = {isa = PBXBuildFile; fileRef = B57C744920F5649300EEFC87 /* EmptyStoresTableViewCell.swift */; };
49+
B57C744C20F564B400EEFC87 /* EmptyStoresTableViewCell.xib in Resources */ = {isa = PBXBuildFile; fileRef = B57C744B20F564B400EEFC87 /* EmptyStoresTableViewCell.xib */; };
4850
B5A8532220BDBFAF00FAAB4D /* CircularImageView.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A8532120BDBFAE00FAAB4D /* CircularImageView.swift */; };
4951
B5A8F8A920B84D3F00D211DE /* ApiCredentials.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A8F8A720B84D3F00D211DE /* ApiCredentials.swift */; };
5052
B5A8F8AD20B88D9900D211DE /* LoginPrologueViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = B5A8F8AC20B88D9900D211DE /* LoginPrologueViewController.swift */; };
@@ -175,6 +177,8 @@
175177
B57C744220F54F1C00EEFC87 /* AccountHeaderView.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = AccountHeaderView.xib; sourceTree = "<group>"; };
176178
B57C744420F55BA600EEFC87 /* NSObject+Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "NSObject+Helpers.swift"; sourceTree = "<group>"; };
177179
B57C744620F55BC800EEFC87 /* UIView+Helpers.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "UIView+Helpers.swift"; sourceTree = "<group>"; };
180+
B57C744920F5649300EEFC87 /* EmptyStoresTableViewCell.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = EmptyStoresTableViewCell.swift; sourceTree = "<group>"; };
181+
B57C744B20F564B400EEFC87 /* EmptyStoresTableViewCell.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = EmptyStoresTableViewCell.xib; sourceTree = "<group>"; };
178182
B59F38DF20D40A24008C1829 /* WooCommerce.debug.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WooCommerce.debug.entitlements; sourceTree = "<group>"; };
179183
B59F38E020D40A24008C1829 /* WooCommerce.release.entitlements */ = {isa = PBXFileReference; lastKnownFileType = text.plist.entitlements; path = WooCommerce.release.entitlements; sourceTree = "<group>"; };
180184
B5A8532120BDBFAE00FAAB4D /* CircularImageView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CircularImageView.swift; sourceTree = "<group>"; };
@@ -436,6 +440,8 @@
436440
children = (
437441
B57C743C20F5493300EEFC87 /* AccountHeaderView.swift */,
438442
B57C744220F54F1C00EEFC87 /* AccountHeaderView.xib */,
443+
B57C744920F5649300EEFC87 /* EmptyStoresTableViewCell.swift */,
444+
B57C744B20F564B400EEFC87 /* EmptyStoresTableViewCell.xib */,
439445
B5D1AFC520BC7B7300DB0E8C /* StorePickerViewController.swift */,
440446
B5D1AFC720BC7B9600DB0E8C /* StorePickerViewController.xib */,
441447
);
@@ -663,6 +669,7 @@
663669
B5D1AFB420BC445A00DB0E8C /* Images.xcassets in Resources */,
664670
CE1EC8CF20B6FD53009762BF /* FootnoteView.xib in Resources */,
665671
CEE005F62076C4040079161F /* Orders.storyboard in Resources */,
672+
B57C744C20F564B400EEFC87 /* EmptyStoresTableViewCell.xib in Resources */,
666673
CE855367209BA6A700938BDC /* ShowHideSectionFooter.xib in Resources */,
667674
CE1EC8F020B8A408009762BF /* OrderNoteTableViewCell.xib in Resources */,
668675
B55D4BFD20B5CDE700D7A50F /* replace_secrets.rb in Resources */,
@@ -843,6 +850,7 @@
843850
B55D4C0620B6027200D7A50F /* AuthenticationManager.swift in Sources */,
844851
B5BE368E20BED80B00BE0A8C /* SafariViewController.swift in Sources */,
845852
CE855364209BA6A700938BDC /* ShowHideSectionFooter.swift in Sources */,
853+
B57C744A20F5649300EEFC87 /* EmptyStoresTableViewCell.swift in Sources */,
846854
B56DB3CA2049BFAA00D4AA8E /* AppDelegate.swift in Sources */,
847855
CE1F512B206985DF00C6C810 /* PaddedLabel.swift in Sources */,
848856
CE1EC8D120B6FE39009762BF /* FootnoteView.swift in Sources */,

0 commit comments

Comments
 (0)