0.3.3 • Published 4 months ago

@mediahackza/outlier-components v0.3.3

Weekly downloads
-
License
-
Repository
-
Last release
4 months ago

Outlier Components

A package of elements used across multiple Outlier websites.

Version notes

0.1.20 - Adds OutlierMenu component. Based on the mobile menu it is positioned along the bottom of the screen.

  • Set the OutlierHeader showTopMenu prop to false by default. This hides the top menu bar in preparation for the OutlierMenu inclusion listed above.

  • 0.1.22 - Adds default menu items list, removes menuItems as a required prop

  • 0.1.23 - Adding three columns to drop-down top menu

  • 0.1.3 - Switching to Wordpress menu system

  • 0.2.0 - New OutlierNav component, a simplified navigation system for all Outlier and MHC sites.

  • 0.2.3 - Adding options for light or dark theme, and option to switch logo on or off

  • 0.2.4 - Linked "Outlier Navigation" in The Outlier Wordpress to navigation.

  • 0.3.0 - Switched to Sanity.io menu system

  • 0.3.3 - Added Fathom track events to main nav called "main-nav-menuitem"

Installation

npm install @mediahackza/outlier-components

Usage

Notes: Added OutlierMenu component which is mobile-style menu at the base of the page. It only positioned on the bottom of the page for now. In future versions there will be a desktop (top of the page) and a mobile (bottom of the page) style, which will be automatic.

import { OutlierHeader } from '@mediahackza/outlier-components'
import { OutlierFooter } from '@mediahackza/outlier-components'
import { OutlierMobileMenu } from '@mediahackza/outlier-components'
import { OutlierMenu } from '@mediahackza/outlier-components'

Components

OutlierNav

OutlierNav is a simple navigation component for all sites.

Props

background Default is 'blue' Options: 'red', 'blue', 'black' Not required

logo Show or hide the Outlier logo Default is true (show logo) Options: true, false Not required

theme Change the displayed logo from white on black to black on white Default is 'light' Options: 'light', 'dark' Not required

OutlierHeader

OutlierHeader is a simple header component that includes core navigation, logo and optional log-in button.

Props

  • showTopMenu Default is false. To add the top menu set to true. Note: This also requires that a menuItems prop is passed to the header. Default is false Not required

  • headerWidth Default is 90%, you can pass most values here eg. 100px, 100vw, 100% Not required

  • loginRequired Login button: requires a 'user' data object if set to true Default is false Not required

  • showSubs Shows subscription for for The Outlier if true Default is false

Data

  • user Not required if member is false This is the user login status Data object needs at least a "loggedin" property = true/false

  • menuItems Not required A default menu items list is included. Set menuItem={obj} to override the default menuItems is an object with a Primary and Secondary set of menu items Example menuItems object:

    {
     "Primary": [
        {
           "name": "Charts",
           "link": "https://charts.theoutlier.co.za"
        },
        {
           "name": "Tools",
           "link": "https://tools.theoutlier.co.za"
        },
          {
               "name": "Games",
               "link": "https://games.theoutlier.co.za"
          },
          {
               "name": "Newsletters",
               "link": "https://newsletters.theoutlier.co.za"
          }
     ],
     "Secondary": [
        {
           "name": "Local Government",
           "link": "/section/local-government"
        },
        {
           "name": "Sports",
           "link": "/section/sports"
        },
    
     ]
    }

OutlierFooter

Currently no props

OutlierMobileMenu

Currently no props

OutlierMenu

No props. Based on mobile menu above, with the intention of becoming the primary navigation. For now it is always positioned along the bottom of the screen but uin future versions will alternate between top (desktop) and bottom (mobile).

Breakpoints

  • < 800px Mobile view which
    • Drops too-left menu dropdown
    • Drop subscription form in header
0.3.3

4 months ago

0.0.84

10 months ago

0.1.31

8 months ago

0.0.85

9 months ago

0.1.10

9 months ago

0.0.86

9 months ago

0.0.82

10 months ago

0.0.83

10 months ago

0.1.20

8 months ago

0.1.21

8 months ago

0.1.22

8 months ago

0.1.23

8 months ago

0.1.24

8 months ago

0.1.25

8 months ago

0.0.79

10 months ago

0.1.0

9 months ago

0.3.0

5 months ago

0.2.1

6 months ago

0.2.0

6 months ago

0.0.8

10 months ago

0.3.2

5 months ago

0.2.3

6 months ago

0.3.1

5 months ago

0.2.2

6 months ago

0.1.3

8 months ago

0.2.4

6 months ago

0.0.78

11 months ago

0.0.77

11 months ago

0.0.76

11 months ago

0.0.75

11 months ago

0.0.74

11 months ago

0.0.73

11 months ago

0.0.72

11 months ago

0.0.71

11 months ago

0.0.7

11 months ago

0.0.69

11 months ago

0.0.68

11 months ago

0.0.67

11 months ago

0.0.66

11 months ago

0.0.65

11 months ago

0.0.64

11 months ago

0.0.63

11 months ago

0.0.53

11 months ago