From 4d35c4211f46deebdefce6f8a2523c0043e9faa5 Mon Sep 17 00:00:00 2001 From: Charles Cruzan Date: Tue, 24 May 2022 17:02:32 -0400 Subject: [PATCH 1/3] rename from borderRadius to blurRadius --- ios/PaymentSheetAppearance.swift | 5 +++-- src/types/PaymentSheet.ts | 4 ++-- 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/ios/PaymentSheetAppearance.swift b/ios/PaymentSheetAppearance.swift index 6c6da39dd..ad5121fb4 100644 --- a/ios/PaymentSheetAppearance.swift +++ b/ios/PaymentSheetAppearance.swift @@ -77,12 +77,12 @@ extension StripeSdk { if let opacity = params[PaymentSheetAppearanceKeys.OPACITY] as? CGFloat { shadow.opacity = opacity } - if let radius = params[PaymentSheetAppearanceKeys.BORDER_RADIUS] as? CGFloat { + if let radius = params[PaymentSheetAppearanceKeys.BLUR_RADIUS] as? CGFloat { shadow.radius = radius } if let offsetParams = params[PaymentSheetAppearanceKeys.OFFSET] as? NSDictionary { if let x = offsetParams[PaymentSheetAppearanceKeys.X] as? CGFloat, let y = offsetParams[PaymentSheetAppearanceKeys.Y] as? CGFloat { - shadow.offset = CGSize(width: x, height:y) + shadow.offset = CGSize(width: x, height:-y) } } @@ -199,6 +199,7 @@ private struct PaymentSheetAppearanceKeys { static let SHADOW_COLOR = "color" static let OPACITY = "opacity" static let OFFSET = "offset" + static let BLUR_RADIUS = "blurRadius" static let X = "x" static let Y = "y" diff --git a/src/types/PaymentSheet.ts b/src/types/PaymentSheet.ts index 21a8738ca..b4e4db9b4 100644 --- a/src/types/PaymentSheet.ts +++ b/src/types/PaymentSheet.ts @@ -103,10 +103,10 @@ export type ShadowConfig = { * @default {x: 0, y: 2} */ offset: { x: number; y: number }; - /** The border radius of the shadow. + /** The blur radius of the shadow. * @default 4 */ - borderRadius: number; + blurRadius: number; }; export type GlobalColorConfig = { From 4cc9f94add24f6cebff08c6e3cfc9e3f35f33725 Mon Sep 17 00:00:00 2001 From: Charles Cruzan Date: Tue, 24 May 2022 17:02:58 -0400 Subject: [PATCH 2/3] example app --- example/src/screens/PaymentSheetAppearance.ts | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/example/src/screens/PaymentSheetAppearance.ts b/example/src/screens/PaymentSheetAppearance.ts index 1333d7b13..35f595ba4 100644 --- a/example/src/screens/PaymentSheetAppearance.ts +++ b/example/src/screens/PaymentSheetAppearance.ts @@ -40,8 +40,8 @@ const appearance: PaymentSheet.AppearanceParams = { shadow: { opacity: 1, color: '#ffffff', - offset: { x: -5, y: 5 }, - borderRadius: 1, + offset: { x: -5, y: -5 }, + blurRadius: 1, }, }, primaryButton: { @@ -55,9 +55,9 @@ const appearance: PaymentSheet.AppearanceParams = { borderWidth: 2, shadow: { opacity: 1, - color: '#22ffffff', - offset: { x: -5, y: 5 }, - borderRadius: 1, + color: '#80ffffff', + offset: { x: 5, y: 5 }, + blurRadius: 1, }, }, }, From 42774472ad961d976cf612339f32ec1b2d662712 Mon Sep 17 00:00:00 2001 From: Charles Cruzan Date: Tue, 24 May 2022 17:09:20 -0400 Subject: [PATCH 3/3] [skip actions] changelog: --- CHANGELOG.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 77566645f..d70b9bb14 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,16 @@ ## Unreleased +### Breaking changes + +- Renamed `appearance.shapes.shadow.borderRadius` to `appearance.shapes.shadow.blurRadius`, and `appearance.primaryButton.shapes.shadow.borderRadius` to `appearance.primaryButton.shapes.shadow.blurRadius`. [#962](https://github.com/stripe/stripe-react-native/pull/962) + +### New features + +### Fixes + +- Fixed `appearance.shapes.shadow.offset` and `appearance.primaryButton.shapes.shadow.offset` not applying the y-coordinate in the correct direction. [#962](https://github.com/stripe/stripe-react-native/pull/962) + ## 0.11.0 ### Breaking changes