diff --git a/types/react-native-elements/README.md b/types/react-native-elements/README.md index 4dfe95d256..a4f1a85472 100644 --- a/types/react-native-elements/README.md +++ b/types/react-native-elements/README.md @@ -6,22 +6,22 @@ List will update as typings are added - [x] Buttons - [x] Badge - [ ] Social Icons / Social Icon Buttons -- [ ] Icons -- [ ] Side Menu -- [ ] Form Elements +- [x] Icons +- [ ] ~~Side Menu~~ DEPRECATED +- [x] Form Elements - [ ] Search Bar -- [ ] ButtonGroup -- [ ] Checkboxes -- [ ] List Element -- [ ] Badge -- [ ] Tab Bar Component +- [x] ButtonGroup +- [x] CheckBoxes +- [x] List Element +- [ ] ~~Tab Bar Component~~ DEPRECATED - [x] HTML style headings - [x] Card component -- [ ] Pricing Component -- [ ] Grid Component +- [x] Pricing Component +- [x] ~~Grid Component~~ DEPRECATED - [ ] Slider Component - [ ] Tile Component - [x] Avatar Component - [ ] Rating Component - [ ] SwipeDeck Component -- [ ] Header Component +- [x] Header Component +- [x] Divider diff --git a/types/react-native-elements/index.d.ts b/types/react-native-elements/index.d.ts index e838b0dd27..1d57e000f0 100644 --- a/types/react-native-elements/index.d.ts +++ b/types/react-native-elements/index.d.ts @@ -1,20 +1,51 @@ -// Type definitions for react-native-elements 0.13 +// Type definitions for react-native-elements 0.16 // Project: https://github.com/react-native-training/react-native-elements#readme // Definitions by: Kyle Roach +// Ifiok Jr. // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 import * as React from 'react'; -import { ViewStyle, TextStyle, ImageStyle, ImageURISource } from 'react-native'; +import { stringify } from '../wellknown/index'; +import { numberTypeAnnotation } from '../babel-types/index'; +import { + ViewStyle, + TextStyle, + ImageStyle, + ImageURISource, + TouchableWithoutFeedbackProps, + TouchableHighlightProperties, + TouchableOpacityProperties, + ViewProperties, + TextInputProperties, + TextInput, + StatusBarProperties, + KeyboardType, + KeyboardTypeIOS, + StyleProp, +} from 'react-native'; -export interface Icon { +export type IconType = + | 'material' + | 'material-community' + | 'simple-line-icon' + | 'zocial' + | 'font-awesome' + | 'octicon' + | 'ionicon' + | 'foundation' + | 'evilicon' + | 'entypo'; + +export interface IconObject { name?: string; color?: string; size?: number; - type?: 'material' | 'material-community' | 'simple-line-icon' | 'zocial' | 'font-awesome' | 'octicon' | 'ionicon' | 'foundation' | 'evilicon' | 'entypo'; + type?: IconType; + style?: any; } -export interface AvatarIcon extends Icon { +export interface AvatarIcon extends IconObject { iconStyle?: TextStyle; } @@ -139,7 +170,7 @@ export interface AvatarProps { icon?: AvatarIcon; /** - * extra styling for icon component (optional) + * extra styling for icon component */ iconStyle?: TextStyle; @@ -171,17 +202,17 @@ export interface AvatarProps { */ export class Avatar extends React.Component {} -export interface ButtonIcon extends Icon { +export interface ButtonIcon extends IconObject { buttonStyle?: TextStyle; } -export interface ButtonProperties { +export interface ButtonProps extends TouchableWithoutFeedbackProps { /** * Specify other component such as TouchableOpacity or other * * @default TouchableHighlight (iOS), TouchableNativeFeedback (android) */ - Component?: JSX.Element; + component?: React.ComponentClass; /** * Additional styling for button component @@ -323,9 +354,9 @@ export interface ButtonProperties { * * @see https://react-native-training.github.io/react-native-elements/API/buttons/ */ -export class Button extends React.Component {} +export class Button extends React.Component {} -export interface BadgeProperties { +export interface BadgeProps { /** * Text value to be displayed by badge * @@ -371,7 +402,7 @@ export interface BadgeProperties { * * @see https://react-native-training.github.io/react-native-elements/API/badge/ */ -export class Badge extends React.Component {} +export class Badge extends React.Component {} export interface CardProps { /** @@ -458,3 +489,1039 @@ export interface CardProps { * @see https://react-native-training.github.io/react-native-elements/API/card/ */ export class Card extends React.Component {} + +/** + * Set the buttons within a Group. + */ +export interface ElementObject { + element: JSX.Element | React.ReactType; +} + +/** + * Set the border styles for a component. + * + * @export + * @interface InnerBorderStyleProperty + */ +export interface InnerBorderStyleProperty { + color?: string; + width?: number; +} + +export interface ButtonGroupProps { + /** + * Current selected index of array of buttons + */ + selectedIndex: number; + + /** + * Method to update Button Group Index + */ + // onPress(): void; + onPress(selectedIndex: number): void; + + /** + * Array of buttons for component, if returning a component, must be an object with { element: componentName } + */ + buttons: string[] | ElementObject[]; + + /** + * Choose other button component such as TouchableOpacity + * + * @default TouchableHighlight + */ + component?: React.ComponentClass; + + /** + * Specify styling for main button container + */ + containerStyle?: ViewStyle; + + /** + * inherited styling object (style) specify styling for button + */ + buttonStyle?: ViewStyle; + + /** + * Specify color for selected state of button + * + * @default 'white' + */ + selectedBackgroundColor?: string; + + /** + * Specify specific styling for text + */ + textStyle?: TextStyle; + + /** + * Specify specific styling for text in the selected state + */ + selectedTextStyle?: TextStyle; + + /** + * inherited styling object { width, color } update the styling of the interior border of the list of buttons + */ + innerBorderStyle?: InnerBorderStyleProperty; + + /** + * Specify underlayColor for TouchableHighlight + * + * @default 'white' + */ + underlayColor?: string; + + /** + * Disables the currently selected button if true + * + * @default false + */ + disableSelected?: boolean; + + /** + * Determines what the opacity of the wrapped view should be when touch is active. + */ + activeOpacity?: number; + + /** + * Border radius for the container + * + * @type {number} + * @memberof ButtonGroupProps + */ + containerBorderRadius?: number; + + /** + * Styling for the final border edge + * + * @type {(ViewStyle | TextStyle)} + * @memberof ButtonGroupProps + */ + lastBorderStyle?: ViewStyle | TextStyle; + + /** + * + * Called immediately after the underlay is hidden + */ + onHideUnderlay?(): void; + + /** + * Called immediately after the underlay is shown + */ + onShowUnderlay?(): void; + + /** + * Animate the touchable to a new opacity. + */ + setOpacityTo?(value: number): void; +} + +export class ButtonGroup extends React.Component {} + +export interface CheckBoxProps { + /** + * Icon family, can be one of the following + * (required only if specifying an icon that is not from font-awesome) + */ + iconType?: IconType; + + /** + * Specify React Native component for main button + */ + component?: React.ComponentClass; + + /** + * Flag for checking the icon + * + * @default false + */ + checked: boolean; + + /** + * Moves icon to right of text. + * + * @default false + */ + iconRight?: boolean; + + /** + * Aligns checkbox to right + * + * @default false + */ + right?: boolean; + + /** + * Aligns checkbox to center + * + * @default false + */ + center?: boolean; + + /** + * Title of checkbox + */ + title?: string | JSX.Element; + + /** + * Style of main container + */ + containerStyle?: ViewStyle; + + /** + * object (style) style of text + */ + textStyle?: TextStyle; + + /** + * onLongPress function for checkbox + */ + onLongPress?(): void; + + /** + * onLongPress function for checkbox + */ + onLongIconPress?(): void; + + /** + * onPress function for container + */ + onPress?(): void; + + /** + * onPress function for checkbox + */ + onIconPress?(): void; + + /** + * Default checked icon (Font Awesome Icon) + * + * @default 'check-square-o' + */ + checkedIcon?: string; + + /** + * Default checked icon (Font Awesome Icon) + * + * @default 'square-o' + */ + uncheckedIcon?: string; + + /** + * Default checked color + * + * @default 'green' + */ + checkedColor?: string; + + /** + * Default unchecked color + * @default '#bfbfbf' + */ + uncheckedColor?: string; + + /** + * Specify a custom checked message + */ + checkedTitle?: string; + + /** + * Specify different font family + * @default 'System font bold (iOS)' + * @default 'Sans Serif Bold (android)' + */ + fontFamily?: string; +} +export class CheckBox extends React.Component {} + +export interface DividerProps { + /** + * Style the divider + * + * @default {height: 1, backgroundColor: #e1e8ee} + * + * @type {ViewStyle} + * @memberof DividerProps + */ + style?: ViewStyle; +} + +export class Divider extends React.Component {} + +export interface FormValidationMessageProps extends ViewProperties { + /** + * Style of the container + * + * @type {ViewStyle} + * @memberof FormValidationMessageProps + */ + containerStyle?: ViewStyle; + + /** + * Style of the text within the label message + * + * @type {TextStyle} + * @memberof FormValidationMessageProps + */ + labelStyle?: TextStyle; + + /** + * Font family for the message + * + * @type {string} + * @memberof FormValidationMessageProps + */ + fontFamily?: string; +} +export class FormValidationMessage extends React.Component< + FormValidationMessageProps, + any +> {} + +export interface FormInputProps extends TextInputProperties { + /** + * TextInput container styling + */ + containerStyle?: ViewStyle; + + /** + * TextInput styling + */ + inputStyle?: TextStyle; + + /** + * DEPRECATED + * Get ref of TextInput + */ + textInputRef?(ref: TextInput): void; + + /** + * DEPRECATED + * Get ref of TextInput container + */ + containerRef?(ref: any): void; + + /** + * Shake the TextInput if not a falsy value and different from the previous value + */ + shake?: any; +} + +export class FormInput extends React.Component { + /** + * Holds reference to the stored input. + * + * @type {TextInput} + * @memberof FormInput + */ + input: TextInput; + + /** + * Shake the TextInput + * + * eg `this.formInputRef.shake()` + */ + shake(): void; + + /** + * Call focus on the TextInput + */ + focus(): void; + + /** + * Call blur on the TextInput + */ + blur(): void; + + /** + * Call clear on the TextInput + */ + clearText(): void; +} + +export interface FormLabelProps extends ViewProperties { + /** + * Additional label container style + */ + containerStyle?: ViewStyle; + + /** + * Additional label styling + */ + labelStyle?: TextStyle; + + /** + * Specify different font family + * + * @default System font bold (iOS), Sans Serif Bold (android) + */ + fontFamily?: string; +} + +export class FormLabel extends React.Component {} + +export interface GridProps extends ViewProperties { + /** + * Outer grid styling + */ + containerStyle?: ViewStyle; + + /** + * Opacity on pressing + * + * @type {number} + * @memberof GridProps + */ + activeOpacity?: number; + + /** + * onPress method + */ + onPress?(): void; + + children: React.ReactNode; +} + +/** + * DEPRECATED + * Warning: Grid has been deprecated and will be removed in a future version of React Native Elements + * + * @export + * @class Grid + * @extends {React.Component} + */ +export class Grid extends React.Component {} + +export interface SubGridProps extends ViewProperties { + /** + * Size for column or row + */ + size?: number; + + /** + * Opacity on pressing + * + * @default 1 + */ + activeOpacity?: number; + + /** + * Styling for the outer column or row + */ + containerStyle?: ViewStyle; + + /** + * onPress method + */ + onPress?(): void; +} + +/** + * DEPRECATED + * Warning: Row has been deprecated and will be removed in a future version of React Native Elements + * @export + * @class Row + * @extends {React.Component} + */ +export class Row extends React.Component {} + +/** + * DEPRECATED + * Warning: Col has been deprecated and will be removed in a future version of React Native Elements + * + * @export + * @class Col + * @extends {React.Component} + */ +export class Col extends React.Component {} + +export interface HeaderIcon extends IconObject { + icon?: string; +} + +/** + * Defines the types that can be used in a header sub component + */ +export type HeaderSubComponent = JSX.Element | TextProps | HeaderIcon; + +export interface HeaderProps extends ViewProperties { + /** + * Accepts all props for StatusBar + */ + statusBarProps?: StatusBarProperties; + + /** + * Configuration object for default component (icon: string, ...props for React Native Elements Icon) or a valid React Element define your left component here + */ + leftComponent?: HeaderSubComponent; + + /** + * Configuration object for default component (text: string, ...props for React Native Text component) valid React Element define your center component here + */ + centerComponent?: HeaderSubComponent; + + /** + * Configuration object for default component (icon: string, ...props for React Native Elements Icon component) or a valid React Element define your right component here + */ + rightComponent?: HeaderSubComponent; + + /** + * string sets backgroundColor of the parent component + */ + backgroundColor?: string; + + /** + * Styling for outer container + */ + outerContainerStyles?: ViewStyle; + + /** + * Styling for inner container + */ + innerContainerStyles?: ViewStyle; +} + +/** + * Header component + * @see https://react-native-training.github.io/react-native-elements/API/header/ + * + * @export + * @class Header + * @extends {React.Component} + */ +export class Header extends React.Component {} + +export interface IconProps { + /** + * Name of icon (required) + */ + name: string; + + /** + * Type (defaults to material, options are material-community, zocial, font-awesome, octicon, ionicon, foundation, evilicon, simple-line-icon, or entypo) + * @default 'material' + */ + type?: IconType; + + /** + * Size of icon (optional) + * @default 26 + */ + size?: number; + + /** + * Color of icon (optional) + * + * @default 'black' + */ + color?: string; + + /** + * Additional styling to icon (optional) + */ + iconStyle?: ViewStyle | TextStyle; + + /** + * View if no onPress method is defined, TouchableHighlight if onPress method is defined React Native component update React Native Component (optional) + */ + component?: React.ComponentClass; + + /** + * onPress method for button (optional) + */ + onPress?(): void; + + /** + * onLongPress method for button (optional) + */ + onLongPress?(): void; + + /** + * UnderlayColor for press event + */ + underlayColor?: string; + + /** + * Reverses color scheme (optional) + * + * @default false + */ + reverse?: boolean; + + /** + * Adds box shadow to button (optional) + * + * @default false + */ + raised?: boolean; + + /** + * Add styling to container holding icon (optional) + */ + containerStyle?: ViewStyle; + + /** + * Specify reverse icon color (optional) + * + * @default 'white' + */ + reverseColor?: string; +} + +/** + * Icon component + * @see https://react-native-training.github.io/react-native-elements/API/icons/ + * + * @export + * @class Icon + * @extends {React.Component} + */ +export class Icon extends React.Component {} + +export interface ListProps extends ViewProperties { + /** + * Style the list container + * @default '{marginTop: 20, borderTopWidth: 1, borderBottomWidth: 1, borderBottomColor: #cbd2d9}' + */ + containerStyle?: ViewStyle; +} + +/** + * List component + * @see https://react-native-training.github.io/react-native-elements/API/lists/ + * + * @export + * @class List + * @extends {React.Component} + */ +export class List extends React.Component {} + +export interface ListItemProps { + /** + * Left avatar. This is the React Native Image source prop. Avatar can be used in parallel to leftIcon if needed. + */ + avatar?: ImageURISource | ImageURISource[]; + + /** + * Avatar styling (optional). This is the React Native Image style prop + */ + avatarStyle?: ImageStyle; + + /** + * Avatar outer container styling (optional) + */ + avatarContainerStyle?: ViewStyle; + + /** + * Avatar overlay container styling (optional) + */ + avatarOverlayContainerStyle?: ViewStyle; + + /** + * Set chevron color + * + * @default '#bdc6cf' + */ + chevronColor?: string; + + /** + * View or TouchableHighlight if onPress method is added as prop + * Replace element with custom element (optional) + */ + component?: React.ComponentClass; + + /** + * Additional main container styling (optional) + */ + containerStyle?: StyleProp; + + /** + * Additional wrapper styling (optional) + */ + wrapperStyle?: StyleProp; + + /** + * Define underlay color for TouchableHighlight (optional) + * + * @default 'white' + */ + underlayColor?: string; + + /** + * Specify different font family + * + * @default 'HelevticaNeue' (iOS) + * @default 'Sans Serif' (android) + */ + fontFamily?: string; + + /** + * Set if you do not want a chevron (optional) + * + * @default false + */ + hideChevron?: boolean; + + /** + * onPress method for link (optional) + */ + onPress?(): void; + + /** + * onLongPress method for link (optional) + */ + onLongPress?(): void; + + /** + * Make left avatar round + * + * @default false + */ + roundAvatar?: boolean; + + /** + * Main title for list item, can be text or custom view (required) + */ + title?: string; + + /** + * Number of lines for title + * + * @default 1 + */ + titleNumberOfLines?: number; + + /** + * Additional title styling (optional) + */ + titleStyle?: StyleProp; + + /** + * Provide styling for title container + */ + titleContainerStyle?: StyleProp; + + /** + * Subtitle text or custom view (optional) + */ + subtitle?: string | JSX.Element; + + /** + * Number of lines for Subtitle + * + * @default 1 + */ + subtitleNumberOfLines?: number; + + /** + * Provide styling for subtitle container + */ + subtitleContainerStyle?: StyleProp; + + /** + * Additional subtitle styling (optional) + */ + subtitleStyle?: StyleProp; + + /** + * Provide a rightTitle to have a title show up on the right side of the button + */ + rightTitle?: string; + + /** + * Number of lines for Right Title + * + * @default 1 + */ + rightTitleNumberOfLines?: number; + + /** + * Style the outer container of the rightTitle text + * + * @default "{flex: 1, alignItems: 'flex-end', justifyContent: 'center'}"" + */ + rightTitleContainerStyle?: StyleProp; + + /** + * Style the text of the rightTitle text + * + * @default "{marginRight: 5, color: '#bdc6cf'}" + */ + rightTitleStyle?: StyleProp; + + /** + * Add a label with your own styling by providing a label={} prop to ListItem + */ + label?: JSX.Element; + + /** + * Icon configuration for left icon (optional), either a name from the icon library (like material) or a React Native element like Image. + * leftIcon can be used in parallel to avatar if needed. + * {name, color, style, type} + * (type defaults to material icons) OR React Native element + */ + leftIcon?: IconObject | JSX.Element; + + /** + * Attaches an onPress on left Icon + */ + leftIconOnPress?(): void; + + /** + * Attaches an onLongPress on left Icon + */ + leftIconOnLongPress?(): void; + + /** + * Underlay color for left Icon + * + * @default 'white' + */ + leftIconUnderlayColor?: string; + + /** + * {name: 'chevron-right'} object {name, color, style, type} (type defaults to material icons) OR + * React Native element icon configuration for right icon (optional), either a name from the icon library (like material) or a React Native element like Image. + * Shows up unless hideChevron is set + */ + rightIcon?: IconObject | JSX.Element; + + /** + * Attaches an onPress on right Icon + */ + onPressRightIcon?(): void; + + /** + * Add a switch to the right side of your component + * + * @default false + */ + switchButton?: boolean; + + /** + * Add a callback function when the switch is toggled + */ + onSwitch?(value: boolean): void; + + /** + * If true the user won't be able to toggle the switch. Default value is false. + * @default false + */ + switchDisabled?: boolean; + + /** + * Background color when the switch is turned on. + */ + switchOnTintColor?: string; + + /** + * Color of the foreground switch grip. + */ + switchThumbTintColor?: string; + + /** + * Border color on iOS and background color on Android when the switch is turned off. + */ + switchTintColor?: string; + + /** + * The value of the switch. If true the switch will be turned on. Default value is false. + * + * @default false + */ + switched?: boolean; + + /** + * Whether to have the right title area be an input text component. + * + * @default false + */ + textInput?: boolean; + + /** + * Can tell TextInput to automatically capitalize certain characters. + */ + textInputAutoCapitalize?: boolean; + + /** + * Can tell TextInput to automatically capitalize certain characters. + */ + textInputAutoCorrect?: boolean; + + /** + * If true, focuses the input on componentDidMount. The default value is false. + */ + textInputAutoFocus?: boolean; + + /** + * If false, text is not editable. The default value is true. + */ + textInputEditable?: boolean; + + /** + * Can be one of the following: + * 'default', 'email-address', 'numeric', 'phone-pad', 'ascii-capable', 'numbers-and-punctuation', 'url', 'number-pad', 'name-phone-pad', 'decimal-pad', 'twitter', 'web-search' + */ + textInputKeyboardType?: KeyboardType | KeyboardTypeIOS; + + /** + * Limits the maximum number of characters that can be entered. + */ + textInputMaxLength?: number; + + /** + * If true, the text input can be multiple lines. The default value is false. + */ + textInputMultiline?: boolean; + + /** + * Callback that is called when the text input's text changes. Changed text is passed as an argument to the callback handler. + */ + textInputOnChangeText?(text: string): void; + + /** + * Callback that is called when the text input is focused. + */ + textInputOnFocus?(): void; + + /** + * Manually set value of the input + */ + textInputValue?: string; + + /** + * If true, obscures the text entered so that sensitive text like passwords stay secure. + */ + textInputSecure?: boolean; + + /** + * object (style) Style for the input text + */ + textInputStyle?: StyleProp; + + /** + * object (style) Style for the container surrounding the input text + */ + textInputContainerStyle?: StyleProp; + + /** + * Placeholder for the text input + */ + textInputPlaceholder?: string; + + /** + * Callback that is called when the text input is blurred. + */ + textInputOnBlur?(): void; + + /** + * If true, all text will automatically be selected on focus. + */ + textInputSelectTextOnFocus?: boolean; + + /** + * Determines how the return key should look. For more info see the React Native docs + */ + textInputReturnKeyType?: string; + + /** + * Add a badge to the ListItem by using this prop + * + * @type {(BadgeProps | ElementObject)} + * @memberof ListItemProps + */ + badge?: BadgeProps | ElementObject; +} + +/** + * ListItem component + * @see https://react-native-training.github.io/react-native-elements/API/lists/ + * + * @export + * @class ListItem + * @extends {React.Component} + */ +export class ListItem extends React.Component {} + +export interface ButtonInformation { + title: string; + icon: string; + buttonStyle?: ViewStyle; +} + +export interface PricingCardProps { + /** + * Title (required) + */ + title?: string; + + /** + * Price (required) + */ + price: string; + + /** + * Color scheme for button & title (required) + */ + color: string; + + /** + * Pricing information (optional) + */ + info?: string[]; + + /** + * {title, icon, buttonStyle} + * button information (required) + */ + button: ButtonInformation; + + /** + * Function to be run when button is pressed + */ + onButtonPress?(): void; + + /** + * Outer component styling (optional) + */ + containerStyle?: StyleProp; + + /** + * Inner wrapper component styling (optional) + */ + wrapperStyle?: StyleProp; + + /** + * Specify title font family + * + * System font (font weight 800) (iOS) + * Sans Serif Black (android) + */ + titleFont?: string; + + /** + * Specify pricing font family + * + * System font (font weight 700) (iOS) + * Sans Serif Bold (android) + */ + pricingFont?: string; + + /** + * Specify pricing information font family + * + * System font bold (iOS) + * Sans Serif Bold (android) + */ + infoFont?: string; + + /** + * Specify button font family + * + * System font (iOS) + * Sans Serif (android) + */ + buttonFont?: string; +} + +export class PricingCard extends React.Component {} diff --git a/types/react-native-elements/react-native-elements-tests.tsx b/types/react-native-elements/react-native-elements-tests.tsx index 5a9db2fd2a..01e1e60be7 100644 --- a/types/react-native-elements/react-native-elements-tests.tsx +++ b/types/react-native-elements/react-native-elements-tests.tsx @@ -1,239 +1,498 @@ import * as React from 'react'; -import { View, StyleSheet, TouchableNativeFeedback, Image } from 'react-native'; -import { Button, Text, Badge, Avatar, Card } from 'react-native-elements'; +import { + ListView, + View, + StyleSheet, + TouchableNativeFeedback, + Image, +} from 'react-native'; +import { + Button, + Text, + Badge, + Avatar, + Card, + ButtonGroup, + CheckBox, + Divider, + FormInput, + FormValidationMessage, + FormLabel, + Header, + Icon, + List, + ListItem, + PricingCard, +} from 'react-native-elements'; class TextTest extends React.Component { - render() { - return ( - - Heading 1 - Heading 2 - Heading 3 - Heading 4 - - ); - } + render() { + return ( + + Heading 1 + Heading 2 + Heading 3 + Heading 4 + + ); + } } class AvatarTest extends React.Component { - render() { - return ( - - - Avatars - console.log("Works!")} - activeOpacity={0.7} - /> - console.log("Works!")} - activeOpacity={0.7} - /> - console.log("Works!")} - activeOpacity={0.7} - /> - console.log("Works!")} - activeOpacity={0.7} - /> - + render() { + return ( + + + Avatars + console.log('Works!')} + activeOpacity={0.7} + /> + console.log('Works!')} + activeOpacity={0.7} + /> + console.log('Works!')} + activeOpacity={0.7} + /> + console.log('Works!')} + activeOpacity={0.7} + /> + - - Avatar with initials - console.log("Works!")} - activeOpacity={0.7} - /> - console.log("Works!")} - activeOpacity={0.7} - /> - console.log("Works!")} - activeOpacity={0.7} - /> - console.log("Works!")} - activeOpacity={0.7} - /> - + + Avatar with initials + console.log('Works!')} + activeOpacity={0.7} + /> + console.log('Works!')} + activeOpacity={0.7} + /> + console.log('Works!')} + activeOpacity={0.7} + /> + console.log('Works!')} + activeOpacity={0.7} + /> + - - Avatar with icons - console.log("Works!")} - activeOpacity={0.7} - containerStyle={{flex: 2, marginLeft: 20, marginTop: 115}} - /> - console.log("Works!")} - activeOpacity={0.7} - containerStyle={{flex: 3, marginTop: 100}} - /> - console.log("Works!")} - activeOpacity={0.7} - containerStyle={{flex: 4, marginTop: 75}} - /> - console.log("Works!")} - activeOpacity={0.7} - containerStyle={{flex: 5, marginRight: 60}} - /> - - - ); - } + + Avatar with icons + console.log('Works!')} + activeOpacity={0.7} + containerStyle={{ + flex: 2, + marginLeft: 20, + marginTop: 115, + }} + /> + console.log('Works!')} + activeOpacity={0.7} + containerStyle={{ flex: 3, marginTop: 100 }} + /> + console.log('Works!')} + activeOpacity={0.7} + containerStyle={{ flex: 4, marginTop: 75 }} + /> + console.log('Works!')} + activeOpacity={0.7} + containerStyle={{ flex: 5, marginRight: 60 }} + /> + + + ); + } } const AvatarStyles = StyleSheet.create({ - title: { - fontSize: 30, - marginBottom: 10 - } + title: { + fontSize: 30, + marginBottom: 10, + }, }); class BadgeTest extends React.Component { - render() { - return ( - - + render() { + return ( + + - - User 1 - + + User 1 + - console.log('pressed')} value="5" /> + console.log('pressed')} value="5" /> - - - ); - } + + + ); + } } class ButtonTest extends React.Component { - handleButtonPress() { - console.log('I got pressed'); - } + handleButtonPress() { + console.log('I got pressed'); + } - render() { - return ( - -