2.0.0-0 • Published 6 years ago

@vivintsolar-oss/native-vs-modal v2.0.0-0

Weekly downloads
-
License
MIT
Repository
github
Last release
6 years ago

@vivintsolar-oss/native-vs-modal

yarn add @vivintsolar-oss/native-vs-modal
// or
// npm install @vivintsolar-oss/native-vs-modal

VSModal

A flexible modal component built to our design standards.

Demo

import { ModalBase } from '@vivintsolar-oss/native-vs-modal';

  const nestProps = {
    visible,
    animationType: 'none',
    transparent: true,
    hardwareAccelerated: true,
    actionIcon,
    closeAction,
    mainAction,
    mainActionText: 'Do Stuff',
    secondaryActionText: 'Close',
  };

  <ModalBase { ...nestProps }>
    <View style={ styles.centerPadding }>
      <Image style={ styles.retry } source={ warningIcon } />
      <VSFont.Default style={ styles.normalFont }>Uh oh, looks like there were no thermostats detected.</VSFont.Default>
      <VSFont.Default style={ styles.smallFont }>Add a thermostat device in your Nest account and try again.</VSFont.Default>
      <SubmitButton
        onPress={ this.refetch }
        text={ 'TRY AGAIN' }
      />
    </View>
  </ModalBase>
import { ModaPlain } from '@vivintsolar-oss/native-vs-modal';

  const nestProps = {
    visible,
    animationType: 'none',
    transparent: true,
    hardwareAccelerated: true,
  };

  <ModaPlain { ...nestProps }>
    <View style={ styles.centerPadding }>
      <Image style={ styles.retry } source={ warningIcon } />
      <VSFont.Default style={ styles.normalFont }>Uh oh, looks like there were no thermostats detected.</VSFont.Default>
      <VSFont.Default style={ styles.smallFont }>Add a thermostat device in your Nest account and try again.</VSFont.Default>
      <SubmitButton
        onPress={ this.refetch }
        text={ 'TRY AGAIN' }
      />
    </View>
  </ModaPlain>

Props

NameDefaultTypeDescription
visiblefalsebooleanControls visible state of the modal component
childrenanyChildren to be rendered in the body of the modal
actionIconfuncRender prop used to display the icon on the bottom left of the footer
mainActionfuncMain action that's used in the footer on the left side
closeActionfuncAction used in the footer on the right side
mainActionTextSettingsstringText displayed in the footer on the left side
secondaryActionTextClosestringText displayed in the footer on the right side
headerobjectCan use to render a header for the modal
footerobjectProps passed down to the footer component
2.0.0-0

6 years ago

1.2.6

6 years ago

1.2.4

6 years ago

1.2.3

6 years ago

1.2.2

6 years ago

1.2.1

6 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago