npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

chronoscloud-navigation

v2.2.1

Published

### Installation

Downloads

65

Readme

React Chronos Navigation

Installation

npm i chronoscloud-navigation

How To Use

First import this component where you want to use it

import ChronosCloudNavigationBar from "chronoscloud-navigation"

Then just renders it

<ChronosCloudNavigationBar />

Props

| Prop | Description | Default value | | ------ | :-------------------: | :-------------: | | alias | Profile Alias | null | |application|Application Title| null | |appServices|Application Subscribed Services| null | |currentUser|User Profile| null | |hasCreateInvitePermission|Is invite permision link on profile menu visible| false | |hasMultiView|Is MultiView in App Switcher visible| false | |hasCoreAnalytics|Is Core Analytics in App Switcher visible| false | |hasSearch|Is Search bar visible| false | | host | ChronosCloud Host | null | |logo|Application Logo| null | |main|Main Title|null| |onLogout|On logout method| null | |returnToHome|Return To Homemethod| null | |protocol|ChronosCloud Protocol | null | |searchInput|Search Textbox area| null |

Example

import React, { Component } from "react";
import ChronosCloudNavigationBar from "chronoscloud-navigation";

import { userManager } from '../auth';
import { CHRONOSCLOUD_PROTOCOL, CHRONOSCLOUD_HOST, APP_ASSET_URL, APP_AUTH_IMAGE, APP_AUTH_URL, APP_CORE_IMAGE, APP_CORE_URL, APP_EDGE_IMAGE, APP_EDGE_URL, APP_TRACKER_IMAGE, APP_TRACKER_URL, APP_OV_URL, APP_ANALYTICS_IMAGE, APP_MULTIVIEW_IMAGE} from '../environment';

import SearchInput from '../components/Navigation/search';

class App extends Component {
  onLogoutButtonClick(event) { // Used to handle logout event
    event.preventDefault();
    userManager.signoutRedirect();
  }

  render() {
    const { profile } = this.props.subscription.data || {},
    alias = profile ? profile.account_alias || profile.account : '',
    currentPath = window.location.pathname,
    currentUser = this.props.currentUser ? this.props.currentUser.profile || {} : null,
    hasCreateInvitePermission = currentUser ? (currentUser.permissions.includes("AUTH.MANAGE_INVITATIONS")) : false,
    hasCoreAnalytics = currentUser ? (currentUser.permissions.includes("CORE.ANALYTICS")) : false;

    let services = {},
    APP_MULTIVIEW_URL;

    let services = {},
    APP_MULTIVIEW_URL;

    if(currentUser){
      const PUBLIC_URL =  `${CHRONOSCLOUD_PROTOCOL}//${currentUser.account_alias}.${CHRONOSCLOUD_HOST}`,
      APP_ANALYTICS_URL = `${PUBLIC_URL}/analytics`;
      APP_MULTIVIEW_URL = `${PUBLIC_URL}/multi_view`;

      services = {
        "AUTH": {
          name: "Accounts",
          icon: APP_AUTH_IMAGE,
          link: APP_AUTH_URL
        },
        "CORE": {
          name: "Enterprise",
          icon: APP_CORE_IMAGE,
          link: APP_CORE_URL
        },
        "EDGE": {
          name: "Edge",
          icon: APP_EDGE_IMAGE,
          link: APP_EDGE_URL
        },
        "TRACKER": {
          name: "Tracker",
          icon: APP_TRACKER_IMAGE,
          link: APP_TRACKER_URL
        },
        "VERIFIER": {
          name: "Order Verifier",
          icon: APP_CORE_IMAGE,
          link: APP_OV_URL
        },
        "CORE.ANALYTICS": {
          name: "Analytics",
          icon: APP_ANALYTICS_IMAGE,
          link: APP_ANALYTICS_URL
        },
        "MULTI.VIEW": {
          name: "Multi View",
          icon: APP_MULTIVIEW_IMAGE,
          link: APP_MULTIVIEW_URL
        }
      }
    }

    returnToHome(){
      this.props.history.push(`/`);
    }

    return (
        <ChronosCloudNavigationBar
          alias={alias} 
          protocol={CHRONOSCLOUD_PROTOCOL} 
          host={CHRONOSCLOUD_HOST} 
          currentUser={this.props.currentUser}
          onLogout={this.onLogoutButtonClick}true
          hasSearch={true}
          hasCreateInvitePermission={hasCreateInvitePermission}
          hasMultiView={true}
          hasCoreAnalytics={hasCoreAnalytics}
          main='ChronosCloud'
          application='Enterprise'
          appServices={services}
          logo={`${APP_ASSET_URL}/scm-logo.png`}
          returnToHome={returnToHome}
          searchInput={<SearchInput className="chronos-navbar-search" {...this.props} /> } 
        />
    );
  }
}

export default App;