File tree Expand file tree Collapse file tree 14 files changed +237
-102
lines changed
components/OneSlotFactory Expand file tree Collapse file tree 14 files changed +237
-102
lines changed Original file line number Diff line number Diff line change 11import { ApplicationProvider , IconRegistry } from '@ui-kitten/components' ;
2- import { EvaIconsPack } from '@ui-kitten/eva-icons' ;
3-
42import { OneSlotFactory } from 'rn-declarative-eva' ;
3+ import { EvaIconsPack } from '@ui-kitten/eva-icons' ;
54
65import * 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 ) ;
Original file line number Diff line number Diff line change 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 ;
Original file line number Diff line number Diff line change 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 ;
Original file line number Diff line number Diff line change 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 ;
Original file line number Diff line number Diff line change 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 ;
Original file line number Diff line number Diff line change 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 ;
Original file line number Diff line number Diff line change 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 ;
Original file line number Diff line number Diff line change 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 ;
Original file line number Diff line number Diff line change 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 ;
Original file line number Diff line number Diff line change 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 ;
You can’t perform that action at this time.
0 commit comments