Skip to content
This repository was archived by the owner on Nov 3, 2025. It is now read-only.

Commit 80b637a

Browse files
committed
♻️ (createCanal) deprecate createCanal API
1 parent 046bafd commit 80b637a

4 files changed

Lines changed: 38 additions & 9 deletions

File tree

docs/components/Warning.tsx

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import React from 'react';
2+
import { Text, View } from 'react-native';
3+
4+
export function Warning(props: { children: string }) {
5+
return (
6+
<View
7+
style={{
8+
padding: 8,
9+
backgroundColor: '#eee',
10+
borderLeftWidth: 3,
11+
borderLeftColor: '#fdcb00',
12+
borderRadius: 4,
13+
}}
14+
>
15+
<Text style={{ fontWeight: 'bold', fontSize: 16 }}>⚠️ Warning</Text>
16+
<Text style={{ marginTop: 4 }}>{props.children}</Text>
17+
</View>
18+
);
19+
}

doczrc.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ module.exports = {
1515
modifyBundlerConfig: config => {
1616
// Combine the default docz aliases with our custom aliases.
1717
config.resolve.alias = Object.assign({}, config.resolve.alias, {
18+
components: path.resolve(__dirname, 'docs/components/'),
1819
'react-native$': 'react-native-web',
1920
'react-gondola$': path.resolve(__dirname, 'src/index.ts'), // eslint-disable-line
2021
'react-gondola/transitions$': path.resolve(__dirname, 'src/transitions/index.ts'), // eslint-disable-line

src/createCanal.mdx

Lines changed: 15 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,13 @@ menu: API
44
route: /api/create-canal
55
---
66

7-
# createCanal
7+
# [deprecated] createCanal
8+
9+
import { Warning } from 'components/Warning';
10+
11+
<Warning>
12+
This API is deprecated and will be removed in the next major release; i.e. in `react-gondola` 2.
13+
</Warning>
814

915
`type: <Authorizations = { [K in Stop['name']]?: boolean }>(stopsList: Stop[]): ComponentType<CanalComponentProps<Authorizations>>`
1016

@@ -55,15 +61,15 @@ MobX Strem Listener of list of local Stops. All full screen stops are filtered o
5561
Link your pages in a canal.
5662

5763
```tsx
58-
import React from "react";
59-
import { createCanal } from "react-gondola";
60-
import { FirstName } from "./FirstName";
61-
import { LastName } from "./LastName";
62-
import { Confirm } from "./Confirm";
64+
import React from 'react';
65+
import { createCanal } from 'react-gondola';
66+
import { FirstName } from './FirstName';
67+
import { LastName } from './LastName';
68+
import { Confirm } from './Confirm';
6369

6470
export const SignInCanal = createCanal([
65-
{ name: "firstName", Component: FirstName },
66-
{ name: "lastName", Component: LastName },
67-
{ name: "confirm", Component: Confirm, isFullScreen: true }
71+
{ name: 'firstName', Component: FirstName },
72+
{ name: 'lastName', Component: LastName },
73+
{ name: 'confirm', Component: Confirm, isFullScreen: true },
6874
]);
6975
```

src/createCanal.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,9 @@ export interface CanalInterface {
2121
back$: Observable<BackEvent>;
2222
}
2323

24+
/**
25+
* @deprecated This will be removed in the next major.
26+
*/
2427
export const createCanal = <
2528
StopName extends string,
2629
Stop extends StopInterface<StopName>,

0 commit comments

Comments
 (0)