install
npm i
dev
npm run start
build
npm run build
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>
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 belowtitle
(Optional) - Main title for itemproposition
- Smaller description of itemsubtitle
(Optional) - Additional subtitle for URL on specific instancesurl
- link for the itemactive
(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