Skip to content

Commit

Permalink
docs: add presentation types section
Browse files Browse the repository at this point in the history
  • Loading branch information
trevor-lambert committed Apr 3, 2024
1 parent a2698f0 commit 3584449
Show file tree
Hide file tree
Showing 6 changed files with 68 additions and 4 deletions.
8 changes: 4 additions & 4 deletions website/docs/for-super-capacitor/overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ The options for configuring your portal when using [`presentPortal`](#presentpor
```typescript
interface PortalOptions {
name: string;
presentationType: 'push' | 'modal';
startDir?: string;
initialContext?: InitialContext;
plugins?: CapacitorPlugin[];
liveUpdateConfig?: LiveUpdateConfig;
type: 'push' | 'modal';
modalStyle?: 'fullscreen' | 'sheet';
modalStyle?: 'fullScreen' | 'pageSheet';
}
```

Expand Down Expand Up @@ -64,8 +64,8 @@ presentPortal({ name: 'checkoutApp', startDir: 'portals/checkout', type: 'push'

#### Parameters

| Name | Type | Description |
| --------- | ------------------------------- | ------------------------------------------------------------------- |
| Name | Type | Description |
| --------- | --------------------------------- | --------------------------------------------------------------------- |
| `options` | [`PortalOptions`](#portaloptions) | The [`PortalOptions`](#portaloptions) object to configure the portal. |

### dismissPortal
Expand Down
63 changes: 63 additions & 0 deletions website/docs/for-super-capacitor/presentation-types.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
import useBaseUrl from '@docusaurus/useBaseUrl';

# Presentation Types

The `presentationType` option within the `PortalOptions` interface allows you to specify how the microapp will be presented to users. This section of the documentation provides an example of the available presentation types.

## Push

```typescript
const portalOptions: PortalOptions = {
name: 'Portal Name';
presentationType: 'push';
}
```

<em
style={{
textAlign: 'center',
display: 'block',
}}
>
<img src={useBaseUrl('/img/super-capacitor/presentation-types/push.gif')} width="300px" />
</em>
## Modal

### FullScreen

```typescript
const portalOptions: PortalOptions = {
name: 'Portal Name';
presentationType: 'modal';
modalStyle: 'fullScreen';
}
```

<em
style={{
textAlign: 'center',
display: 'block',
}}
>
<img src={useBaseUrl('/img/super-capacitor/presentation-types/fullscreen.gif')} width="300px" />
</em>
### PageSheet

```typescript
const portalOptions: PortalOptions = {
name: 'Portal Name';
presentationType: 'modal';
modalStyle: 'pageSheet';
}
```

<em
style={{
textAlign: 'center',
display: 'block',
}}
>
<img src={useBaseUrl('/img/super-capacitor/presentation-types/pagesheet.gif')} width="300px" />
</em>
1 change: 1 addition & 0 deletions website/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -225,6 +225,7 @@ module.exports = {
collapsed: true,
items: [
'for-super-capacitor/overview',
'for-super-capacitor/presentation-types',
{
type: 'category',
label: 'Tutorials',
Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3584449

Please sign in to comment.