From 5636660422dace1a2bdb4d0797280ef3302aad11 Mon Sep 17 00:00:00 2001 From: Matt Bruce Date: Tue, 22 Aug 2023 08:59:34 -0500 Subject: [PATCH] updated sample Signed-off-by: Matt Bruce --- .../ViewControllers/ButtonGroupViewController.swift | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/VDSSample/ViewControllers/ButtonGroupViewController.swift b/VDSSample/ViewControllers/ButtonGroupViewController.swift index 60bc010..6e7a062 100644 --- a/VDSSample/ViewControllers/ButtonGroupViewController.swift +++ b/VDSSample/ViewControllers/ButtonGroupViewController.swift @@ -202,12 +202,13 @@ class ButtonGroupViewController: BaseViewController { extension ButtonGroupViewController: ComponentSampleable { static func makeSample() -> ComponentSample { let component = Self.makeComponent() + let onClick: (ButtonBase) -> Void = { button in print("\(button.text!) clicked")} component.buttons = [ - Button().with{ $0.use = .secondary; $0.text = "Secondary" }, - Button().with{ $0.use = .primary; $0.text = "Primary" }, - TextLink().with { $0.size = .large; $0.text = "Large Text Link" }, - TextLink().with { $0.text = "Widge Label Button" }, - TextLinkCaret().with { $0.text = "Text Link Caret" } + Button().with{ $0.use = .secondary; $0.text = "Secondary"; $0.onClick = onClick}, + Button().with{ $0.use = .primary; $0.text = "Primary"; $0.onClick = onClick }, + TextLink().with { $0.size = .large; $0.text = "Large Text Link"; $0.onClick = onClick }, + TextLink().with { $0.text = "Widge Label Button"; $0.onClick = onClick }, + TextLinkCaret().with { $0.text = "Text Link Caret"; $0.onClick = onClick} ] return ComponentSample(component: component)