Skip to content

Commit

Permalink
Remove extra layer of logic for fonts (#1384)
Browse files Browse the repository at this point in the history
* Remove extra layer of logic for fonts

* Update Snapshots

* Fix snapshot for toast
  • Loading branch information
mohsen-schibsted authored Oct 22, 2024
1 parent 39c368d commit d0f2ff4
Show file tree
Hide file tree
Showing 52 changed files with 87 additions and 156 deletions.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ struct InfoboxSwiftUIPresentationView: View {
}

}
.finnFont(.caption)
.font(from: .caption)
.foregroundStyle(.secondary)
}
.padding()
Expand Down
3 changes: 2 additions & 1 deletion Demo/Sources/Components/Label/LabelDemoView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import FinniversKit
import DemoKit
import Warp

public class LabelDemoView: UIView, Demoable {
override init(frame: CGRect) {
Expand All @@ -28,7 +29,7 @@ public class LabelDemoView: UIView, Demoable {
let labelBody = Label(style: .body)
let labelDetail = Label(style: .detail)

let testStyle: Label.Style = .body
let testStyle: Warp.Typography = .body
let multilineLabel = Label(style: testStyle)
let label1 = Label(style: testStyle)
let label2 = Label(style: testStyle)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,11 +57,11 @@ class ObjectPageTitleDemoView: UIView, Tweakable {

private func configureTitleView(
title: String? = nil,
titleStyle: Label.Style = .title2,
titleStyle: Warp.Typography = .title2,
subtitle: String? = nil,
subtitleStyle: Label.Style = .body,
subtitleStyle: Warp.Typography = .body,
caption: String? = nil,
captionStyle: Label.Style = .caption,
captionStyle: Warp.Typography = .caption,
ribbonViewModel: RibbonViewModel? = nil,
spacingAfterTitle: CGFloat = Warp.Spacing.spacing50,
spacingAfterSubtitle: CGFloat = Warp.Spacing.spacing50,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ private class DemoCollectionViewCell: UICollectionViewCell, OverflowCollectionVi

// MARK: - Private properties

private static let labelStyle = Label.Style.body
private static let labelStyle = Warp.Typography.body
private static let margins = UIEdgeInsets(vertical: Warp.Spacing.spacing100, horizontal: Warp.Spacing.spacing200)
private lazy var label = Label(style: .body, withAutoLayout: true)

Expand Down Expand Up @@ -101,7 +101,7 @@ private class DemoCollectionViewCell: UICollectionViewCell, OverflowCollectionVi
// MARK: - OverflowCollectionViewCell

static func size(using model: String) -> CGSize {
let font = Self.labelStyle.font
let font = Self.labelStyle.uiFont
let margins = Self.margins

let width = model.width(withConstrainedHeight: .infinity, font: font) + (margins.leading + margins.trailing)
Expand Down
2 changes: 1 addition & 1 deletion Demo/Sources/SwiftUI/FinnTextField+Previews.swift
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ struct FinnTextFieldDemoView: View {
var body: some View {
ScrollView {
Text("Textfields")
.finnFont(.title1)
.font(from: .title1)
.padding(.bottom, Warp.Spacing.spacing200)

FinnTextField(placeholder: "Default", text: $text)
Expand Down
2 changes: 1 addition & 1 deletion Demo/Sources/SwiftUI/FinnTextView+Previews.swift
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ struct FinnTextViewDemoView: View {
var body: some View {
VStack {
Text("Textviews")
.finnFont(.title1)
.font(from: .title1)
.padding(.bottom, Warp.Spacing.spacing200)

FinnTextView(text: $text).frame(height: 100)
Expand Down
8 changes: 0 additions & 8 deletions FinniversKit/FinniversKit.xcodeproj/project.pbxproj
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@
444246032137D60400D42AB8 /* FavoriteFolderViewModel.swift in Sources */ = {isa = PBXBuildFile; fileRef = 444246002137D60400D42AB8 /* FavoriteFolderViewModel.swift */; };
4447F6C71FDB2B110033DBC1 /* Button+Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4447F6661FDB2B110033DBC1 /* Button+Style.swift */; };
4447F6C81FDB2B110033DBC1 /* Button.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4447F6671FDB2B110033DBC1 /* Button.swift */; };
4447F6D11FDB2B110033DBC1 /* Label+Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4447F6751FDB2B110033DBC1 /* Label+Style.swift */; };
4447F6D21FDB2B110033DBC1 /* Label.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4447F6761FDB2B110033DBC1 /* Label.swift */; };
4447F6E91FDB2B110033DBC1 /* Ribbon+Style.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4447F69F1FDB2B110033DBC1 /* Ribbon+Style.swift */; };
4447F6EA1FDB2B110033DBC1 /* RibbonView.swift in Sources */ = {isa = PBXBuildFile; fileRef = 4447F6A01FDB2B110033DBC1 /* RibbonView.swift */; };
Expand Down Expand Up @@ -258,7 +257,6 @@
9B93F210230FC3CD009B2D4B /* NSDirectionalEdgeInsetsExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B93F20F230FC3CD009B2D4B /* NSDirectionalEdgeInsetsExtensions.swift */; };
9B9663CB2460383900D34BA1 /* ConfigTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9B9663CA2460383900D34BA1 /* ConfigTests.swift */; };
9BA8248623859B4400163F24 /* MapZoomRange.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BA8248523859B4400163F24 /* MapZoomRange.swift */; };
9BB6802F2462F763001ADACF /* Font+SwiftUI.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BB6802E2462F763001ADACF /* Font+SwiftUI.swift */; };
9BB680322462F7AC001ADACF /* View+Extensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BB680312462F7AC001ADACF /* View+Extensions.swift */; };
9BB734C42462EA0500E05435 /* ButtonStyle.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BB734C32462EA0500E05435 /* ButtonStyle.swift */; };
9BBC903E24FD24D20003D2D8 /* UITraitCollectionExtensions.swift in Sources */ = {isa = PBXBuildFile; fileRef = 9BBC903D24FD24D20003D2D8 /* UITraitCollectionExtensions.swift */; };
Expand Down Expand Up @@ -541,7 +539,6 @@
444246002137D60400D42AB8 /* FavoriteFolderViewModel.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = FavoriteFolderViewModel.swift; sourceTree = "<group>"; };
4447F6661FDB2B110033DBC1 /* Button+Style.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Button+Style.swift"; sourceTree = "<group>"; };
4447F6671FDB2B110033DBC1 /* Button.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Button.swift; sourceTree = "<group>"; };
4447F6751FDB2B110033DBC1 /* Label+Style.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Label+Style.swift"; sourceTree = "<group>"; };
4447F6761FDB2B110033DBC1 /* Label.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = Label.swift; sourceTree = "<group>"; };
4447F69F1FDB2B110033DBC1 /* Ribbon+Style.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Ribbon+Style.swift"; sourceTree = "<group>"; };
4447F6A01FDB2B110033DBC1 /* RibbonView.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RibbonView.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -700,7 +697,6 @@
9B93F20F230FC3CD009B2D4B /* NSDirectionalEdgeInsetsExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = NSDirectionalEdgeInsetsExtensions.swift; sourceTree = "<group>"; };
9B9663CA2460383900D34BA1 /* ConfigTests.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ConfigTests.swift; sourceTree = "<group>"; };
9BA8248523859B4400163F24 /* MapZoomRange.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = MapZoomRange.swift; sourceTree = "<group>"; };
9BB6802E2462F763001ADACF /* Font+SwiftUI.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = "Font+SwiftUI.swift"; sourceTree = "<group>"; };
9BB680312462F7AC001ADACF /* View+Extensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = "View+Extensions.swift"; sourceTree = "<group>"; };
9BB734C32462EA0500E05435 /* ButtonStyle.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ButtonStyle.swift; sourceTree = "<group>"; };
9BBC903D24FD24D20003D2D8 /* UITraitCollectionExtensions.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = UITraitCollectionExtensions.swift; sourceTree = "<group>"; };
Expand Down Expand Up @@ -1195,7 +1191,6 @@
4408A6A12027AC41008C0BD9 /* Font */ = {
isa = PBXGroup;
children = (
9BB6802E2462F763001ADACF /* Font+SwiftUI.swift */,
4408A6A22027AC41008C0BD9 /* UIFont+FinniversKit.swift */,
);
path = Font;
Expand Down Expand Up @@ -1441,7 +1436,6 @@
4447F6741FDB2B110033DBC1 /* Label */ = {
isa = PBXGroup;
children = (
4447F6751FDB2B110033DBC1 /* Label+Style.swift */,
4447F6761FDB2B110033DBC1 /* Label.swift */,
);
path = Label;
Expand Down Expand Up @@ -3236,7 +3230,6 @@
44A557B522E72187001667AE /* HeartTableViewCell.swift in Sources */,
B2829E2D2C7F054F0032BDFA /* HTMLAttributeStack.swift in Sources */,
573B3FF82ACC1B75005096EC /* SettingsViewIconCellModel.swift in Sources */,
4447F6D11FDB2B110033DBC1 /* Label+Style.swift in Sources */,
441FE431209A24E500B04EF1 /* AdRecommendationsGridHeaderView.swift in Sources */,
0881432A22E1B974008CB5DA /* ToastButton.swift in Sources */,
9B28DE8023266C5000D69C15 /* Panel.swift in Sources */,
Expand Down Expand Up @@ -3414,7 +3407,6 @@
45B2E06A207CF5C100C68B92 /* StringExtensions.swift in Sources */,
E87A7BF328ED6AE0007094F2 /* NeighborhoodProfileBannerView.swift in Sources */,
4447F6C81FDB2B110033DBC1 /* Button.swift in Sources */,
9BB6802F2462F763001ADACF /* Font+SwiftUI.swift in Sources */,
4441F9F322CCF76300DCFD2F /* AddressMapView.swift in Sources */,
9BEB287D231D486100D28BAD /* LoanValuesView.swift in Sources */,
9BB680322462F7AC001ADACF /* View+Extensions.swift in Sources */,
Expand Down
18 changes: 12 additions & 6 deletions FinniversKit/Sources/Base Components/ButtonStyle.swift
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ public struct InlineFlatStyle: ButtonStyle {
private let textColor: Color

public init(size: Button.Size = .normal, textColor: Color = .textLink) {
self.font = size == .normal ? .finnFont(.bodyStrong) : .finnFont(.detailStrong)
self.font = Self.font(for: size)
self.textColor = textColor
}

Expand All @@ -36,7 +36,7 @@ public struct FlatStyle: ButtonStyle {
padding: EdgeInsets = .init(top: Warp.Spacing.spacing100, leading: Warp.Spacing.spacing200, bottom: Warp.Spacing.spacing100, trailing: Warp.Spacing.spacing200)
) {
self.size = size
self.font = size == .normal ? .finnFont(.bodyStrong) : .finnFont(.detailStrong)
self.font = Self.font(for: size)
self.textColor = textColor
self.fullWidth = fullWidth
self.padding = padding
Expand Down Expand Up @@ -71,7 +71,7 @@ public struct DefaultStyle: ButtonStyle {
padding: EdgeInsets = .init(top: Warp.Spacing.spacing100, leading: Warp.Spacing.spacing200, bottom: Warp.Spacing.spacing100, trailing: Warp.Spacing.spacing200)
) {
self.size = size
self.font = size == .normal ? .finnFont(.bodyStrong) : .finnFont(.detailStrong)
self.font = Self.font(for: size)
self.textColor = textColor
self.fullWidth = fullWidth
self.padding = padding
Expand Down Expand Up @@ -118,7 +118,7 @@ public struct CallToAction: ButtonStyle {
) {
self.background = background
self.fullWidth = fullWidth
self.font = size == .normal ? .finnFont(.bodyStrong) : .finnFont(.detailStrong)
self.font = Self.font(for: size)

if let padding {
self.padding = padding
Expand Down Expand Up @@ -162,15 +162,21 @@ private extension CGFloat {
static let normalButtonVerticalPadding: CGFloat = 13
}

private extension ButtonStyle {
static func font(for size: Button.Size) -> Font {
(size == .normal ? Warp.Typography.bodyStrong : Warp.Typography.detailStrong).font
}
}

#Preview {
VStack {
HStack(spacing: 0) {
Text("Example ")
.finnFont(.body)
.font(from: .body)
SwiftUI.Button("inline style", action: {})
.buttonStyle(InlineFlatStyle())
Text(" with some text")
.finnFont(.body)
.font(from: .body)
}
SwiftUI.Button("Flat", action: {})
.buttonStyle(FlatStyle())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ public class AddressComponentFieldView: UIView {
// MARK: - Private extensions

private extension Label {
static func create(style: Label.Style, textColor: UIColor = .text) -> Label {
static func create(style: Warp.Typography, textColor: UIColor = .text) -> Label {
let label = Label(style: style, withAutoLayout: true)
label.textColor = textColor
return label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ public class AddressComponentPostalFieldView: UIView {
// MARK: - Private extensions

private extension Label {
static func create(style: Label.Style, textColor: UIColor = .text) -> Label {
static func create(style: Warp.Typography, textColor: UIColor = .text) -> Label {
let label = Label(style: style, withAutoLayout: true)
label.textColor = textColor
return label
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ extension CollapsibleContentView {
public let borderWidth: CGFloat
public let borderColor: UIColor?
public let contentInsets: UIEdgeInsets
public let titleStyle: Label.Style
public let titleStyle: Warp.Typography
public let headerContentSpacing: CGFloat
public let hairlineColor: UIColor?

Expand All @@ -18,7 +18,7 @@ extension CollapsibleContentView {
borderWidth: CGFloat = 0,
borderColor: UIColor? = nil,
contentInsets: UIEdgeInsets,
titleStyle: Label.Style,
titleStyle: Warp.Typography,
headerContentSpacing: CGFloat,
hairlineColor: UIColor? = nil
) {
Expand Down Expand Up @@ -58,7 +58,7 @@ extension CollapsibleContentView {
borderWidth: CGFloat? = nil,
borderColor: UIColor? = nil,
contentInsets: UIEdgeInsets? = nil,
titleStyle: Label.Style? = nil,
titleStyle: Warp.Typography? = nil,
headerContentSpacing: CGFloat? = nil,
hairlineColor: UIColor? = nil
) -> CollapsibleContentView.Style {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ public class ColumnListsView: UIView {

private var textItems: [String] = []

private var style: Label.Style = .caption
private var style: Warp.Typography = .caption

private lazy var stackView: UIStackView = {
let stackView = UIStackView(withAutoLayout: true)
Expand All @@ -46,7 +46,7 @@ public class ColumnListsView: UIView {

// MARK: - Public methods

public func configure(with textItems: [String], numberOfColumns: Int, style: Label.Style) {
public func configure(with textItems: [String], numberOfColumns: Int, style: Warp.Typography) {
self.textItems = textItems
self.numberOfColumns = numberOfColumns
self.style = style
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,19 +15,19 @@ public struct FrontPageTransactionView: View {
public var body: some View {
VStack(alignment: .leading, spacing: Warp.Spacing.spacing100) {
Text(model.headerTitle)
.finnFont(.bodyStrong)
.font(from: .bodyStrong)
.foregroundColor(.text)
.accessibilityAddTraits(.isHeader)

VStack {
HStack(alignment: .top, spacing: Warp.Spacing.spacing100) {
VStack(alignment: .leading, spacing: Warp.Spacing.spacing50) {
Text(model.title)
.finnFont(.bodyStrong)
.font(from: .bodyStrong)
.foregroundColor(.text)

Text(model.subtitle)
.finnFont(.body)
.font(from: .body)
.foregroundColor(.text)
}

Expand Down
4 changes: 3 additions & 1 deletion FinniversKit/Sources/Components/HTMLLabel/HTMLLabel.swift
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Warp

public class HTMLLabel: Label {
private var htmlText: String?
private let spanMapper: HTMLStringUIKitStyleTranslator.SpanMapper
Expand All @@ -11,7 +13,7 @@ public class HTMLLabel: Label {
}
}

public init(style: Style, spanMapper: @escaping HTMLStringUIKitStyleTranslator.SpanMapper = { _, _ in }, withAutoLayout: Bool = false) {
public init(style: Warp.Typography, spanMapper: @escaping HTMLStringUIKitStyleTranslator.SpanMapper = { _, _ in }, withAutoLayout: Bool = false) {
self.spanMapper = spanMapper
super.init(style: style, withAutoLayout: withAutoLayout)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ import Warp

public class HorizontalIconCollectionViewCell: UICollectionViewCell {
private static let titleSideMargin = Warp.Spacing.spacing100
private static let titleStyle = Label.Style.body
private static let bodyStyle = Label.Style.bodyStrong
private static let titleStyle = Warp.Typography.body
private static let bodyStyle = Warp.Typography.bodyStrong

static func height(for viewModel: IconCollectionViewModel, withWidth width: CGFloat) -> CGFloat {
let imageSize = viewModel.image.size
let textWidth = width - imageSize.width - (3 * titleSideMargin)

let titleHeight = viewModel.title?.height(withConstrainedWidth: textWidth, font: titleStyle.font) ?? 0
let bodyHeight = viewModel.text.height(withConstrainedWidth: textWidth, font: bodyStyle.font)
let titleHeight = viewModel.title?.height(withConstrainedWidth: textWidth, font: titleStyle.uiFont) ?? 0
let bodyHeight = viewModel.text.height(withConstrainedWidth: textWidth, font: bodyStyle.uiFont)

let textHeight = titleHeight + bodyHeight + Warp.Spacing.spacing50

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import Warp

public class VerticalIconCollectionViewCell: UICollectionViewCell {
private static let textSideMargin = Warp.Spacing.spacing100
private static let bodyStyle = Label.Style.body
private static let bodyStyle = Warp.Typography.body

static func height(for viewModel: IconCollectionViewModel, withWidth width: CGFloat) -> CGFloat {
let textWidth = width - (2 * textSideMargin)
let textHeight = viewModel.text.height(withConstrainedWidth: textWidth, font: bodyStyle.font)
let textHeight = viewModel.text.height(withConstrainedWidth: textWidth, font: bodyStyle.uiFont)

let imageHeight = viewModel.image.size.height

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,9 @@ public struct InfoboxSwiftUIView: View {
public var body: some View {
VStack(alignment: .center, spacing: Warp.Spacing.spacing200) {
Text(viewModel.title)
.finnFont(style.titleStyle)
.font(from: style.titleStyle)
Text(viewModel.detail)
.finnFont(style.detailStyle)
.font(from: style.detailStyle)

VStack(spacing: Warp.Spacing.spacing50) {
primaryButton(for: viewModel)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@

import Foundation
import SwiftUI
import Warp

public extension InfoboxView {
enum Style {
case small(backgroundColor: UIColor)
case normal(backgroundColor: UIColor, primaryButtonIcon: UIImage?)
case warning

var titleStyle: Label.Style {
var titleStyle: Warp.Typography {
switch self {
case .small:
return .bodyStrong
Expand All @@ -22,7 +23,7 @@ public extension InfoboxView {
}
}

var detailStyle: Label.Style {
var detailStyle: Warp.Typography {
switch self {
case .small:
return .caption
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@ public class KeyValueGridView: UIView {
// MARK: - Private properties

private var data: [KeyValuePair] = []
private var titleStyle: Label.Style = .body
private var valueStyle: Label.Style = .bodyStrong
private var titleStyle: Warp.Typography = .body
private var valueStyle: Warp.Typography = .bodyStrong
private lazy var verticalStackView = UIStackView(axis: .vertical, spacing: Warp.Spacing.spacing200, alignment: .leading, distribution: .equalSpacing, withAutoLayout: true)

// MARK: - Initializers
Expand All @@ -34,8 +34,8 @@ public class KeyValueGridView: UIView {

public func configure(
with data: [KeyValuePair],
titleStyle: Label.Style = .body,
valueStyle: Label.Style = .bodyStrong
titleStyle: Warp.Typography = .body,
valueStyle: Warp.Typography = .bodyStrong
) {
self.data = data
self.titleStyle = titleStyle
Expand Down
Loading

0 comments on commit d0f2ff4

Please sign in to comment.