feat(react-native-elements): add utility exports

This commit is contained in:
Ifiok Jr
2017-09-17 23:11:16 +01:00
parent 64bbfa8c78
commit 08753baeb1
2 changed files with 48 additions and 1 deletions
+40
View File
@@ -2206,3 +2206,43 @@ export interface TileProps {
* @see https://react-native-training.github.io/react-native-elements/API/tile/
*/
export class Tile extends React.Component<TileProps, any> {}
/**
* Colors
*/
export interface Colors {
readonly primary: string;
readonly primary1: string;
readonly primary2: string;
readonly secondary: string;
readonly secondary2: string;
readonly secondary3: string;
readonly grey0: string;
readonly grey1: string;
readonly grey2: string;
readonly grey3: string;
readonly grey4: string;
readonly grey5: string;
readonly dkGreyBg: string;
readonly greyOutline: string;
readonly searchBg: string;
readonly disabled: string;
readonly white: string;
readonly error: string;
readonly [key: string]: string;
}
export const colors: Colors;
/* Utility Functions */
/**
* TODO make the Icon Type an export of the react-native-vector-icons type definitions.
*/
export function getIconType(type: IconType): any;
/**
* Method to normalize size of fonts across devices
*/
export function normalize(size: number): number;
@@ -34,7 +34,10 @@ import {
SwipeDeck,
Tabs,
Tab,
Tile
Tile,
colors,
getIconType,
normalize
} from 'react-native-elements';
const { width, height } = Dimensions.get('window');
@@ -967,3 +970,7 @@ const TileTest: React.StatelessComponent = () => (
/>
</View>
);
const CustomIcon = getIconType('material');
const fontSize = normalize(20);
const white = colors.white;