Skip to content

Commit 2254a3e

Browse files
committed
Design updates to notifications StringStyles
1 parent edc7646 commit 2254a3e

File tree

3 files changed

+16
-11
lines changed

3 files changed

+16
-11
lines changed

WooCommerce/Classes/Extensions/NSParagraphStyle+Woo.swift

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,12 @@ extension NSParagraphStyle {
1818
return NSMutableParagraphStyle(standardLineHeightUsingFont: UIFont.body)
1919
}
2020

21+
/// Returns a ParagraphStyle with it's minimum Line Height set to accomodate `UIFont.footnote`
22+
///
23+
static var footnote: NSParagraphStyle {
24+
return NSMutableParagraphStyle(standardLineHeightUsingFont: UIFont.footnote)
25+
}
26+
2127
/// Returns a ParagraphStyle with it's minimum Line Height set to accomodate `UIFont.body` / Centered
2228
///
2329
static var badge: NSParagraphStyle {

WooCommerce/Classes/Tools/StringFormatter/StringStyles.swift

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,11 +60,11 @@ extension StringStyles {
6060
/// Styles: Notifications List / Subject Block
6161
///
6262
static let subject: StringStyles = {
63-
let regular: Style = [.paragraphStyle: NSParagraphStyle.subheadline, .font: UIFont.subheadline, .foregroundColor: StyleManager.defaultTextColor]
64-
let bold: Style = [.paragraphStyle: NSParagraphStyle.subheadline, .font: UIFont.subheadline.bold]
65-
let blockquote: Style = [.paragraphStyle: NSParagraphStyle.subheadline, .font: UIFont.subheadline.italics]
66-
let italics: Style = [.paragraphStyle: NSParagraphStyle.subheadline, .font: UIFont.subheadline.italics]
67-
let noticon: Style = [.paragraphStyle: NSParagraphStyle.subheadline, .font: UIFont.noticon(forStyle: .subheadline), .foregroundColor: StyleManager.defaultTextColor]
63+
let regular: Style = [.paragraphStyle: NSParagraphStyle.body, .font: UIFont.body, .foregroundColor: StyleManager.defaultTextColor]
64+
let bold: Style = [.paragraphStyle: NSParagraphStyle.body, .font: UIFont.body.bold]
65+
let blockquote: Style = [.paragraphStyle: NSParagraphStyle.body, .font: UIFont.body.italics]
66+
let italics: Style = [.paragraphStyle: NSParagraphStyle.body, .font: UIFont.body.italics]
67+
let noticon: Style = [.paragraphStyle: NSParagraphStyle.body, .font: UIFont.noticon(forStyle: .body), .foregroundColor: StyleManager.wooGreyMid]
6868

6969
return StringStyles(regular: regular, bold: bold, blockquote: blockquote, italics: italics, match: nil, noticon: noticon)
7070
}()
@@ -73,8 +73,7 @@ extension StringStyles {
7373
/// Styles: Notifications List / Snippet Block
7474
///
7575
static let snippet: StringStyles = {
76-
let regular: Style = [.paragraphStyle: NSParagraphStyle.subheadline, .font: UIFont.footnote, .foregroundColor: StyleManager.defaultTextColor]
77-
76+
let regular: Style = [.paragraphStyle: NSParagraphStyle.footnote, .font: UIFont.footnote, .foregroundColor: StyleManager.defaultTextColor]
7877
return StringStyles(regular: regular)
7978
}()
8079

@@ -108,7 +107,7 @@ extension StringStyles {
108107
let match: Style = [.paragraphStyle: NSParagraphStyle.body, .font: UIFont.body.bold, .foregroundColor: StyleManager.defaultTextColor]
109108
let noticon: Style = [.paragraphStyle: NSParagraphStyle.body, .font: UIFont.noticon(forStyle: .body), .foregroundColor: StyleManager.defaultTextColor]
110109
let italic: Style = [.paragraphStyle: NSParagraphStyle.body, .font: UIFont.body.italics, .foregroundColor: StyleManager.defaultTextColor]
111-
let link: Style = [.foregroundColor: StyleManager.defaultTextColor]
110+
let link: Style = [.foregroundColor: StyleManager.wooCommerceBrandColor]
112111

113112
return StringStyles(regular: regular, bold: bold, blockquote: blockquote, match: match, noticon: noticon, link: link)
114113
}()

WooCommerce/Classes/ViewRelated/Notifications/Cells/NoteTableViewCell.xib

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,8 @@
2727
<nil key="textColor"/>
2828
<nil key="highlightedColor"/>
2929
</label>
30-
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" translatesAutoresizingMaskIntoConstraints="NO" id="fNu-km-jyX">
31-
<rect key="frame" x="55" y="11" width="304" height="39"/>
30+
<stackView opaque="NO" contentMode="scaleToFill" axis="vertical" spacing="3" translatesAutoresizingMaskIntoConstraints="NO" id="fNu-km-jyX">
31+
<rect key="frame" x="55" y="11" width="304" height="42"/>
3232
<subviews>
3333
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" text="Subject" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="Ow4-CR-HAI" userLabel="Subject Label">
3434
<rect key="frame" x="0.0" y="0.0" width="304" height="19.5"/>
@@ -37,7 +37,7 @@
3737
<nil key="highlightedColor"/>
3838
</label>
3939
<label opaque="NO" userInteractionEnabled="NO" contentMode="left" horizontalHuggingPriority="251" verticalHuggingPriority="251" horizontalCompressionResistancePriority="752" text="Snippet" textAlignment="natural" lineBreakMode="tailTruncation" numberOfLines="2" baselineAdjustment="alignBaselines" adjustsFontSizeToFit="NO" translatesAutoresizingMaskIntoConstraints="NO" id="JQs-0C-rb6" userLabel="Snippet Label">
40-
<rect key="frame" x="0.0" y="19.5" width="304" height="19.5"/>
40+
<rect key="frame" x="0.0" y="22.5" width="304" height="19.5"/>
4141
<fontDescription key="fontDescription" type="system" pointSize="16"/>
4242
<nil key="textColor"/>
4343
<nil key="highlightedColor"/>

0 commit comments

Comments
 (0)