Skip to content

Commit 70a7027

Browse files
docs: add presentation types section
1 parent 54ad6df commit 70a7027

File tree

6 files changed

+68
-4
lines changed

6 files changed

+68
-4
lines changed

website/docs/for-super-capacitor/overview.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ The options for configuring your portal when using [`presentPortal`](#presentpor
1818
```typescript
1919
interface PortalOptions {
2020
name: string;
21+
presentationType: 'push' | 'modal';
2122
startDir?: string;
2223
initialContext?: InitialContext;
2324
plugins?: CapacitorPlugin[];
2425
liveUpdateConfig?: LiveUpdateConfig;
25-
type: 'push' | 'modal';
26-
modalStyle?: 'fullscreen' | 'sheet';
26+
modalStyle?: 'fullScreen' | 'pageSheet';
2727
}
2828
```
2929

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

6565
#### Parameters
6666

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

7171
### dismissPortal
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import useBaseUrl from '@docusaurus/useBaseUrl';
2+
3+
# Presentation Types
4+
5+
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.
6+
7+
## Push
8+
9+
```typescript
10+
const portalOptions: PortalOptions = {
11+
name: 'Portal Name';
12+
presentationType: 'push';
13+
}
14+
```
15+
16+
<em
17+
style={{
18+
textAlign: 'center',
19+
display: 'block',
20+
}}
21+
>
22+
<img src={useBaseUrl('/img/super-capacitor/presentation-types/push.gif')} width="300px" />
23+
</em>
24+
25+
## Modal
26+
27+
### FullScreen
28+
29+
```typescript
30+
const portalOptions: PortalOptions = {
31+
name: 'Portal Name';
32+
presentationType: 'modal';
33+
modalStyle: 'fullScreen';
34+
}
35+
```
36+
37+
<em
38+
style={{
39+
textAlign: 'center',
40+
display: 'block',
41+
}}
42+
>
43+
<img src={useBaseUrl('/img/super-capacitor/presentation-types/fullscreen.gif')} width="300px" />
44+
</em>
45+
46+
### PageSheet
47+
48+
```typescript
49+
const portalOptions: PortalOptions = {
50+
name: 'Portal Name';
51+
presentationType: 'modal';
52+
modalStyle: 'pageSheet';
53+
}
54+
```
55+
56+
<em
57+
style={{
58+
textAlign: 'center',
59+
display: 'block',
60+
}}
61+
>
62+
<img src={useBaseUrl('/img/super-capacitor/presentation-types/pagesheet.gif')} width="300px" />
63+
</em>

website/sidebars.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -225,6 +225,7 @@ module.exports = {
225225
collapsed: true,
226226
items: [
227227
'for-super-capacitor/overview',
228+
'for-super-capacitor/presentation-types',
228229
{
229230
type: 'category',
230231
label: 'Tutorials',
Loading
Loading
Loading

0 commit comments

Comments
 (0)