Skip to content

React component to let our users switch between the products on our platform.

Notifications You must be signed in to change notification settings

firmhouse/firmhouse-platform-switcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

firmhouse-platform-switcher

Local Usage

install

npm i

dev

npm run start

build

npm run build

Usage through NPM/Yarn in other projects

Yarn install

yarn add ssh://[email protected]:firmhouse/firmhouse-platform-switcher.git

NPM install

npm i [email protected]:firmhouse/firmhouse-platform-switcher.git

Using in JS code

import React from "react";
import PlatformSwitcher from "firmhouse-platform-switcher";

const ProductSwitcher = props => <PlatformSwitcher {...props} />;

export default ProductSwitcher;

After that you can include this to the Rails with react_component method by react-rails.

react_component "ProductSwitcher", root_url: <Root URL>, items: <Switcher Items>, product: <Product Name>

Properties

Switcher required properties for proper work

  • root_url (String) is a path which will be used for main link on Firmhouse Icon.

Examples: /my-relative-path or https://my-absolute-path.com/index.html

  • items (Array) is array of objects for items which will be used for dropdown list items. Available options for objects below
    • title (Optional) - Main title for item
    • proposition - Smaller description of item
    • subtitle (Optional) - Additional subtitle for URL on specific instances
    • url - link for the item
    • active (Optional) - if item is active it will be marked by check icon

Examples:

[
    { title: "GoMonthly", proposition: "Subscription management", url: ENV["GOMONTHLY_URL"] },
    { title: "Dispatch", proposition: "Track your business's progress", url: "/", active: true },
    { proposition: "Dispatch is part of the Firmhouse platform", url: "https://firmhouse.com/" }
]
  • product (String) is string with lowercase name of current product. Use for correct product icon.

Examples: dispatch or gomonthly

About

React component to let our users switch between the products on our platform.

Resources

Stars

Watchers

Forks

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •