diff --git a/samples/Neutrino/src/scenes/components/AppStoreEntry.swift b/samples/Neutrino/src/scenes/components/AppStoreEntry.swift index a2977da8..383c0ce4 100644 --- a/samples/Neutrino/src/scenes/components/AppStoreEntry.swift +++ b/samples/Neutrino/src/scenes/components/AppStoreEntry.swift @@ -86,7 +86,7 @@ struct AppStoreEntry { // The main content view with the entry background image. private func configureContentView(configuration: UINode.Configuration) { - let margin: CGFloat = state.expanded ? 0 : MarginPreset.medium.cgFloatValue + let margin: CGFloat = state.expanded ? 0 : 8 let height: CGFloat = state.expanded ? 256 : 128 let radius: CornerRadiusPreset = state.expanded ? .none : .cornerRadius4 configuration.set(\UIImageView.image, props.image) @@ -105,7 +105,7 @@ struct AppStoreEntry { // The container takes all of the parent's width and 80% of the height. configuration.set(\UIView.yoga.percent.width, 100%) configuration.set(\UIView.yoga.percent.height, 80%) - configuration.set(\UIView.yoga.padding, MarginPreset.default.cgFloatValue) + configuration.set(\UIView.yoga.padding, 4) // Lays out the children horizontally. configuration.set(\UIView.yoga.flexDirection, .row) } @@ -117,7 +117,7 @@ struct AppStoreEntry { // The container takes all of the parent's width and 20% of the height. configuration.set(\UIView.yoga.percent.width, 100%) configuration.set(\UIView.yoga.percent.height, 20%) - configuration.set(\UIView.yoga.padding, MarginPreset.small.cgFloatValue) + configuration.set(\UIView.yoga.padding, 2) configuration.set(\UIView.yoga.justifyContent, .center) configuration.set(\UIView.yoga.flexDirection, .row) configuration.set(\UIView.backgroundColor, Palette.text.color) @@ -140,7 +140,7 @@ struct AppStoreEntry { // The main title. private func configureLabel(configuration: UINode.Configuration) { let font: UIFont = state.expanded ? Typography.mediumBold.font : Typography.medium.font - configuration.set(\UILabel.yoga.height, HeightPreset.medium.cgFloatValue) + configuration.set(\UILabel.yoga.height, 32) configuration.set(\UILabel.font, font) configuration.set(\UILabel.textColor, Palette.white.color) } diff --git a/samples/Neutrino/src/scenes/components/Index.swift b/samples/Neutrino/src/scenes/components/Index.swift index f02014a0..6bf43e82 100644 --- a/samples/Neutrino/src/scenes/components/Index.swift +++ b/samples/Neutrino/src/scenes/components/Index.swift @@ -57,7 +57,7 @@ struct Index { configuration.set(\UIView.backgroundColor, bkg, animator: animator) // You can configure your view both using the keyPath accessor (that offer an optional // animator parameter), or by accessing to the 'renderedView' manually. - configuration.view.yoga.padding = MarginPreset.default.cgFloatValue + configuration.view.yoga.padding = 8 configuration.view.depthPreset = props.isHighlighted ? .depth2 : .none } @@ -65,7 +65,7 @@ struct Index { let font = props.isHighlighted ? Typography.smallBold.font : Typography.small.font configuration.view.font = font configuration.view.textColor = Palette.white.color - configuration.view.yoga.margin = MarginPreset.tiny.cgFloatValue + configuration.view.yoga.margin = 2 } } } diff --git a/samples/Neutrino/src/scenes/fragments/Fragments.swift b/samples/Neutrino/src/scenes/fragments/Fragments.swift index 45eac378..c1787124 100644 --- a/samples/Neutrino/src/scenes/fragments/Fragments.swift +++ b/samples/Neutrino/src/scenes/fragments/Fragments.swift @@ -97,7 +97,7 @@ extension Fragment { view.textColor = foregroundColor view.depthPreset = .depth1 view.cornerRadiusPreset = .cornerRadius1 - view.yoga.padding = MarginPreset.small.cgFloatValue + view.yoga.padding = 4 view.titleLabel?.font = UIFont.boldSystemFont(ofSize: 13) return view } @@ -124,10 +124,9 @@ extension Fragment { /// Used as shape for many of the examples. static func Polygon() -> UINodeProtocol { return UINode { config in - let size = HeightPreset.medium.cgFloatValue config.set(\UIPolygonView.foregroundColor, Palette.white.color) - config.set(\UIPolygonView.yoga.width, size) - config.set(\UIPolygonView.yoga.height, size) + config.set(\UIPolygonView.yoga.width, 44) + config.set(\UIPolygonView.yoga.height, 44) config.set(\UIPolygonView.yoga.marginRight, 16) config.set(\UIPolygonView.depthPreset, .depth1) } diff --git a/samples/Neutrino/src/scenes/viewcontrollers/IndexViewController.swift b/samples/Neutrino/src/scenes/viewcontrollers/IndexViewController.swift index dce882ba..6c71e94f 100644 --- a/samples/Neutrino/src/scenes/viewcontrollers/IndexViewController.swift +++ b/samples/Neutrino/src/scenes/viewcontrollers/IndexViewController.swift @@ -16,7 +16,7 @@ class IndexViewController: UIComponentViewController { onCellSelected: presentAppStoreListComponentExample), Index.CellProps( title: "Stylesheet-based Counter", - subtitle: "A component that makes extensive use of styles.", + subtitle: "A component that uses styles.", onCellSelected: presentStylesheetCounterExample), ] return context.component(Index.Component.self, key: rootKey, props: props)