0.2.5 • Published 5 years ago

non-functionals-react v0.2.5

Weekly downloads
3
License
ISC
Repository
github
Last release
5 years ago

Non Functionals React

A set of simple React components for non functional pages that are easy to implement within any React project. Just pass in the props needed to suit your project and even access the css classes for more advanced customisation.

Installation:

npm i non-functionals-react --save

Available Components:

  • Not Found
  • Rotate Device
  • Unsupported
  • WebGL Not Enabled
  • Window Too Small
  • Build Version

Usage:

Simply import the components you need:

import { NotFound, RotateDevice } from 'non-functionals-react';

and add them to your render method:

<NotFound
  title="OOPS!"
  subtitle="Sorry, something has gone wrong."
  description="We can't find what you're looking for."
  cta="Back to Home"
  onContinue={() => console.log('continue')}
/>

Components:

Not Found:

Props:
proptyperequired
iconstringno
titlestringyes
subtitlestringyes
descriptionstringyes
ctastringyes
onContinuefunctionyes
HTML structure:
<div class="NotFound NonFunctionals">
  <img class="NotFound-Icon" />
  <h1 class="NotFound-Title" />
  <h2 class="NotFound-Subtitle" />
  <p class="NotFound-Description" />
  <button class="NotFound-Cta" />
</div>

Rotate Device:

Props:
proptyperequired
mobileOrientationstringyes
mobileIconstringno
mobileTitlestringyes
tabletOrientationstringyes
tabletIconstringno
tabletTitlestringyes
HTML structure:
<div class="RotateDevice NonFunctionals">
  <img class="RotateDevice-Icon" />
  <h1 class="RotateDevice-Title" />
</div>

Unsupported:

Props:
proptyperequired
supportedobjectyes
iconstringno
unsupportedIconsarrayyes
unsupportedIconsMobilearrayyes
titlestringyes
mobileTitlestringyes
descriptionstringyes
mobileDescriptionstringyes
socialInstructionsstringyes
ctastringyes
Note:

The supported prop must follow this pattern:

{
  desktop: [
    { browser: 'chrome', minVersion: 2 },
    { browser: 'safari', minVersion: 9 },
    { browser: 'firefox', minVersion: 56 },
    { browser: 'ie', minVersion: 11 },
    { browser: 'edge', minVersion: 14 },
  ],
  tablet: [
    { os: 'ios', browser: 'mobile safari' },
    { os: 'android', browser: 'chrome' },
  ],
  mobile: [
    { os: 'ios', browser: 'mobile safari' },
    { os: 'android', browser: 'chrome' },
  ],
}

The unsupportedIcons and unsupportedIconsMobile props must follow this pattern:

  { image: 'url', label: 'Optional label' },

Please adjust ONLY the following properties to fit your specific project:

  • Desktop: browser, minVersion
  • Tablet: os, browser
  • Mobile: os, browser
HTML structure:
<div class="Unsupported NonFunctionals">
  <img class="Unsupported-Icon" />
  <h1 class="Unsupported-Title" />
  <div class="Unsupported-UnsupportedIcons">
    <div>
      <img />
      <span>{Label}</span>
    </div>
  </div>
  <p class="Unsupported-Description" />
  <p class="Unsupported-SocialInstructions" />
  <button class="Unsupported-Cta" />
</div>

WebGL Not Enabled:

Props:
proptyperequired
iconstringno
titlestringyes
descriptionstringyes
HTML structure:
<div class="WebGLNotEnabled NonFunctionals">
  <img class="WebGLNotEnabled-Icon" />
  <h1 class="WebGLNotEnabled-Title" />
  <p class="WebGLNotEnabled-Description" />
</div>

Window Too Small:

Props:
proptyperequired
minWidthnumberyes
minHeightnumberyes
iconstringno
titlestringyes
descriptionstringyes
HTML structure:
<div class="WindowTooSmall NonFunctionals">
  <img class="WindowTooSmall-Icon" />
  <h1 class="WindowTooSmall-Title" />
  <p class="WindowTooSmall-Description" />
</div>

Build Version:

proptyperequireddescription
versionstringyes
liveboolyesif true then component will be hidden
Note:

The version prop should follow this format:

v {build number} built on {new Date().toGMTString()}

Running locally:

Simply run npm i followed by npm start

0.2.5

5 years ago

0.2.4

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.15

6 years ago

0.1.14

6 years ago

0.1.13

6 years ago

0.1.12

6 years ago

0.1.11

6 years ago

0.1.10

6 years ago

0.1.9

6 years ago

0.1.8

6 years ago

0.1.7

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago