Skip to content

Commit fc83b28

Browse files
committed
demo
1 parent 76def68 commit fc83b28

File tree

14 files changed

+237
-102
lines changed

14 files changed

+237
-102
lines changed

demo/App.tsx

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import { ApplicationProvider, IconRegistry } from '@ui-kitten/components';
2-
import { EvaIconsPack } from '@ui-kitten/eva-icons';
3-
42
import { OneSlotFactory } from 'rn-declarative-eva';
3+
import { EvaIconsPack } from '@ui-kitten/eva-icons';
54

65
import * as eva from '@eva-design/eva';
76

@@ -12,9 +11,9 @@ export default function App() {
1211
<>
1312
<IconRegistry icons={EvaIconsPack} />
1413
<ApplicationProvider {...eva} theme={eva.light}>
15-
<OneSlotFactory>
16-
<MainPage />
17-
</OneSlotFactory>
14+
<OneSlotFactory>
15+
<MainPage />
16+
</OneSlotFactory>
1817
</ApplicationProvider>
1918
</>
2019
);
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import * as React from 'react';
2+
3+
import { OneSlotFactory as OneSlotFactoryInternal } from 'rn-declarative';
4+
5+
import CheckBox from './components/CheckBox';
6+
import Button from './components/Button';
7+
import Combo from './components/Combo';
8+
import Items from './components/Items';
9+
import Radio from './components/Radio';
10+
import Text from './components/Text';
11+
import Switch from './components/Switch';
12+
import YesNo from './components/YesNo';
13+
14+
interface IOneSlotFactoryProps {
15+
children: React.ReactNode;
16+
}
17+
18+
const defaultSlots = {
19+
CheckBox,
20+
Combo,
21+
Items,
22+
Radio,
23+
Button,
24+
Text,
25+
Switch,
26+
YesNo,
27+
};
28+
29+
export const OneSlotFactory = ({
30+
children
31+
}: IOneSlotFactoryProps) => (
32+
<OneSlotFactoryInternal
33+
{...defaultSlots}
34+
>
35+
{children}
36+
</OneSlotFactoryInternal>
37+
);
38+
39+
export default OneSlotFactory;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as React from 'react';
2+
3+
import { Text } from '@ui-kitten/components';
4+
5+
import { IButtonSlot } from 'rn-declarative';
6+
7+
export const Button = ({}: IButtonSlot) => (
8+
<Text>
9+
FieldType.Button is not provided (see OneSlotFactory)
10+
</Text>
11+
)
12+
13+
export default Button;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as React from 'react';
2+
3+
import { Text } from '@ui-kitten/components';
4+
5+
import { ICheckBoxSlot } from 'rn-declarative';
6+
7+
export const CheckBox = ({}: ICheckBoxSlot) => (
8+
<Text>
9+
FieldType.Checkbox is not provided (see OneSlotFactory)
10+
</Text>
11+
);
12+
13+
export default CheckBox;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as React from "react";
2+
3+
import { Text } from '@ui-kitten/components';
4+
5+
import { IComboSlot } from "rn-declarative";
6+
7+
export const Combo = ({}: IComboSlot) => (
8+
<Text>
9+
FieldType.Combo is not provided (see OneSlotFactory)
10+
</Text>
11+
);
12+
13+
export default Combo;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as React from 'react';
2+
3+
import { Text } from '@ui-kitten/components';
4+
5+
import { IItemsSlot } from 'rn-declarative';
6+
7+
export const Items = ({}: IItemsSlot) => (
8+
<Text>
9+
FieldType.Items is not provided (see OneSlotFactory)
10+
</Text>
11+
);
12+
13+
export default Items;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as React from 'react';
2+
3+
import { Text } from '@ui-kitten/components';
4+
5+
import { IRadioSlot } from 'rn-declarative';
6+
7+
export const Radio = ({}: IRadioSlot) => (
8+
<Text>
9+
FieldType.Radio is not provided (see OneSlotFactory)
10+
</Text>
11+
);
12+
13+
export default Radio;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import * as React from "react";
2+
3+
import { Text } from '@ui-kitten/components';
4+
5+
import { ISwitchSlot } from "rn-declarative";
6+
7+
export const Switch = ({}: ISwitchSlot) => (
8+
<Text>
9+
FieldType.Switch is not provided (see OneSlotFactory)
10+
</Text>
11+
);
12+
13+
14+
export default Switch;
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
import * as React from "react";
2+
3+
import { Text as UiText } from 'react-native';
4+
5+
import { ITextSlot } from "rn-declarative";
6+
7+
export const Text = ({}: ITextSlot) => (
8+
<UiText>
9+
FieldType.Text is not provided (see OneSlotFactory)
10+
</UiText>
11+
);
12+
13+
export default Text;
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
import * as React from "react";
2+
3+
import { Text } from '@ui-kitten/components';
4+
5+
import { IYesNoSlot } from "rn-declarative";
6+
7+
export const YesNoField = ({}: IYesNoSlot) => (
8+
<Text>
9+
FieldType.YesNo is not provided (see OneSlotFactory)
10+
</Text>
11+
);
12+
13+
14+
export default YesNoField;

0 commit comments

Comments
 (0)