From 5ed386c883e47036bd8babf63353687f309cc4fc Mon Sep 17 00:00:00 2001 From: Lekshmi S Date: Tue, 28 Apr 2020 18:26:48 +0530 Subject: [PATCH] code cleanup --- .../Headers/HeadersH2TinyButton.swift | 13 ++++++------- .../Headers/HeadersH2TinyButtonModel.swift | 9 +++------ 2 files changed, 9 insertions(+), 13 deletions(-) diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButton.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButton.swift index 39710425..7aeac02f 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButton.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButton.swift @@ -12,22 +12,21 @@ import Foundation //-------------------------------------------------- // MARK: - Outlets //-------------------------------------------------- - let headlineBody = HeadlineBody(frame: .zero) - let button = PillButton(frame: .zero) - var stack = Stack(frame: .zero) + public let headlineBody = HeadlineBody(frame: .zero) + public let button = PillButton(frame: .zero) + public var stack = Stack(frame: .zero) //------------------------------------------------------ - // MARK: - Properties + // MARK: - Constants //------------------------------------------------------ - var spacingBetwenHeadlineBodyAndButton: CGFloat = 16.0 + let spacingBetwenHeadlineBodyAndButton: CGFloat = 16.0 //------------------------------------------------------- // MARK: - View Lifecycle //------------------------------------------------------- open override func setupView() { super.setupView() - stack = Stack.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .leading)), - (view: button, model: StackItemModel(spacing: spacingBetwenHeadlineBodyAndButton, horizontalAlignment: .leading))], axis: .vertical) + stack = Stack.createStack(with: [(view: headlineBody, model: StackItemModel(horizontalAlignment: .leading)), (view: button, model: StackItemModel(spacing: spacingBetwenHeadlineBodyAndButton, horizontalAlignment: .leading))], axis: .vertical) headlineBody.stylePageHeader() addMolecule(stack) stack.restack() diff --git a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButtonModel.swift b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButtonModel.swift index 28048fa1..522c4910 100644 --- a/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButtonModel.swift +++ b/MVMCoreUI/Atomic/Molecules/DesignedComponents/Headers/HeadersH2TinyButtonModel.swift @@ -28,12 +28,9 @@ public class HeadersH2TinyButtonModel: HeaderModel, MoleculeModelProtocol { public override func setDefaults() { super.setDefaults() - topMarginPadding = PaddingDefaultVerticalSpacing3 - bottomMarginPadding = PaddingDefaultVerticalSpacing3 - //default secondary tiny - if button.style == nil { - button.style = .secondary - } + topPadding = PaddingDefaultVerticalSpacing3 + bottomPadding = PaddingDefaultVerticalSpacing3 + button.style = .secondary button.size = .tiny }