Skip to content

Commit

Permalink
feat: add new presentationStyle options
Browse files Browse the repository at this point in the history
  • Loading branch information
charliecruzan-stripe committed Sep 26, 2023
1 parent ecf0b6e commit 3a97046
Show file tree
Hide file tree
Showing 4 changed files with 32 additions and 4 deletions.
8 changes: 8 additions & 0 deletions ios/AddressSheet/AddressSheetView.swift
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ class AddressSheetView: UIView {
switch (presentationStyle) {
case "fullscreen":
return .fullScreen
case "pageSheet":
return .pageSheet
case "formSheet":
return .formSheet
case "automatic":
return .automatic
case "overFullScreen":
return .overFullScreen
case "popover":
fallthrough
default:
Expand Down
8 changes: 8 additions & 0 deletions ios/CustomerSheet/CustomerSheetUtils.swift
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,14 @@ class CustomerSheetUtils {
switch (string) {
case "fullscreen":
return .fullScreen
case "pageSheet":
return .pageSheet
case "formSheet":
return .formSheet
case "automatic":
return .automatic
case "overFullScreen":
return .overFullScreen
case "popover":
fallthrough
default:
Expand Down
10 changes: 8 additions & 2 deletions src/components/AddressSheet.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,14 @@ const AddressSheetNative = requireNativeComponent<any>('AddressSheetView');
export interface Props extends AccessibilityProps {
/** Whether the sheet is visible. Defaults to false. */
visible: boolean;
/** Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. */
presentationStyle?: 'fullscreen' | 'popover';
/** Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. See https://developer.apple.com/documentation/uikit/uimodalpresentationstyle for more info. */
presentationStyle?:
| 'fullscreen'
| 'popover'
| 'pageSheet'
| 'formSheet'
| 'automatic'
| 'overFullScreen';
/** Controls how the modal animates. iOS only. */
animationStyle?: 'flip' | 'curl' | 'slide' | 'dissolve';
/** Configuration for the look and feel of the UI. */
Expand Down
10 changes: 8 additions & 2 deletions src/types/CustomerSheet.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,14 @@ export type CustomerSheetInitParams = {
};

export type CustomerSheetPresentParams = {
/** Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. */
presentationStyle?: 'fullscreen' | 'popover';
/** Controls how the modal is presented (after animation). iOS only. Defaults to `popover`. See https://developer.apple.com/documentation/uikit/uimodalpresentationstyle for more info. */
presentationStyle?:
| 'fullscreen'
| 'popover'
| 'pageSheet'
| 'formSheet'
| 'automatic'
| 'overFullScreen';
/** Controls how the modal animates. iOS only. */
animationStyle?: 'flip' | 'curl' | 'slide' | 'dissolve';
/** Time (in milliseconds) before the Customer Sheet will automatically dismiss. */
Expand Down

0 comments on commit 3a97046

Please sign in to comment.