contact-join-poc-address

npm install --save contact-join-poc-address

Usage no npm install needed!

<script type="module">
  import contactJoinPocAddress from 'https://cdn.skypack.dev/contact-join-poc-address';
</script>

README

contact-join-poc-address

NPM JavaScript Style Guide

Install

npm install --save contact-join-poc-address

Usage

import React, { useState } from 'react';
import MainPage from 'contact-join-poc-address';

function Example() {

  //Prop and function to update it
  const [stateText, setStateText] = useState('Test');

  //style that will override the default (not mandatory)
  const style = {
    input: {backgroundColor: 'red', },
    label: {marginRight: "10px" },
    div: {padding: "10px"}
  }

  const getLoginUsername = () => {
    //code that gets the username from session
    const loginUsername = "Andre";
    return loginUsername;
  }

  const goToHomePageHandler = () => {
    //code that redirects to home page
    console.log("goToHomePage");
  }

  return (
    <MainPage 
      stateText={stateText}
      handleStateTextChange={setText}
      style={style}
      username={getLoginUsername()} 
      goToHomePage={goToHomePageHandler} />
  );
}

License

MIT ©