How to use the hig-vanilla.GlobalNav function in hig-vanilla

To help you get started, we’ve selected a few hig-vanilla examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Autodesk / hig / src / implementations / react / src / adapters / GlobalNav / SideNav / SectionCollapseAdapter.js View on Github external
import * as PropTypes from 'prop-types';
import createComponent from '../../createComponent';
import HIGElement from '../../../elements/HIGElement';
import * as HIG from 'hig-vanilla';

const HIGSectionCollapse = HIG.GlobalNav._partials.SideNav._partials.Section._partials.Collapse;

export class SectionCollapseAdapter extends HIGElement {
  constructor(props) {
    super(HIGSectionCollapse, props);
  }

  componentDidMount() {
    this.commitUpdate(['minimized', this.initialProps.minimized]);
  }

  commitUpdate(updatePayload, oldProps, newProp) {
    for (let i = 0; i < updatePayload.length; i += 2) {
      const propKey = updatePayload[i];
      const propValue = updatePayload[i + 1];

      switch (propKey) {
github Autodesk / hig / src / implementations / react / src / adapters / GlobalNav / SideNav / ModuleCollapseAdapter.js View on Github external
import * as PropTypes from 'prop-types';
import createComponent from '../../createComponent';
import HIGElement from '../../../elements/HIGElement';
import * as HIG from 'hig-vanilla';

const HIGModuleCollapse = HIG.GlobalNav._partials.SideNav._partials.Section._partials.Group._partials.Module._partials.Collapse;

export class ModuleCollapseAdapter extends HIGElement {
  constructor(props) {
    super(HIGModuleCollapse, props);
  }

  componentDidMount() {
    if (this.props.minimized) {
      this.commitUpdate(['minimized', this.props.minimized]);
    }
    if (this.props.onClick) {
      this.commitUpdate(['onClick', this.props.onClick]);
    }
  }

  commitUpdate(updatePayload, oldProps, newProp) {