Code Documentation

class Authentication(props)

This is the main entry screen to the app The user is able to sign in or signup for a new account

The constructor listens for orientation changes

Authentication.changeIPHandler

Handles changing ip of background

Authentication.onButtonPress

Performs signup or login option based on loginMode state

Authentication.render()

Renders form for login/ signup based on the mode

Authentication.switchAuthModeHandler

checks for mode change between login and signup

Authentication.updateInputState

updates the password and confirm password states after validation

Authentication.updateStyles

Updates style based on the window height(landscape or portrait)

AddScreen()

The AddScreen presents a form to add new items to the inventory

Arguments
  • items (items) – It uses items state from items reducer which gives an array of items with title, quantity, price and so on

  • navigation (navigation) – Provides navigation options

card(props)
Arguments
  • props (props) –

  • props.children (children) – any children component usually Text, Views to be wrapped as card

Returns

card – returns a component with styling

customButton(props)
Arguments
  • props (props) – overriding style, title, color, pressHandler

Returns

button – returns a button with custom styling

defaultInput(style)
Arguments
  • style (props) – for overriding style, valid to check input validity

Returns

TextInput – returns an input component with custom styling

DefaultText(style)
Arguments
  • style (props) – for overriding default style

  • props.children (children) – any children component usually Text, Views to be wrapped within text component

Returns

Text – returns text component with custom styling

CustomHeaderButton(props)
Arguments
  • props (props) – for react navigation header button

Returns

HeaderButton – returns a header button component with custom styling

headingText(style)
Arguments
  • style (props) – for overriding style

  • props.children (children) – any children component usually Text to be wrapped within text component

Returns

Text – returns a text Component with heading styling

iconButton(color)
Arguments
  • color, (props) – iconValue ionicons name, iconColor, onPressHandler action to be taken on press

Returns

View – returns a View- touchable view component with custom styling to work as an icon button

MainButton(onPress)
Arguments
  • onPress (props) – for handling press

  • props.children (children) – any children component usually Text to be wrapped within touchable view component

Returns

View – returns a touchable View Component with custom styling

mainText()
Arguments
  • props.children (children) – any children component usually Text to be wrapped within text component

Returns

Text – returns a text Component with custom styling

ManageItem(onSelectItem)
Arguments
  • onSelectItem, (props) – title, quantity, company,price

Returns

View – returns a touchable View Component styled to reflect an inventory item with its description

ModalComponent(isModalVisibile-)
Arguments
  • isModalVisibile- (props) – controls the visibility of the modal

  • props.children (children) – any children component usually Text, View to be wrapped within modal component

Returns

Modal – returns a modal Component for ordering, adding new item, editing