Skip to content

Commit

Permalink
feat(core) add a help menu with links to docs and community (#4903)
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Bloch-Wehba-Seaward committed Feb 23, 2018
1 parent e8d3973 commit 4849bdf
Show file tree
Hide file tree
Showing 3 changed files with 76 additions and 0 deletions.
2 changes: 2 additions & 0 deletions app/scripts/modules/core/src/header/SpinnakerHeader.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import { UIRouterContext } from '@uirouter/react-hybrid';

import { NgReact } from 'core/reactShims';
import { GlobalSearch } from 'core/search/global/GlobalSearch';
import { HelpMenu } from 'core/help/HelpMenu';

import './SpinnakerHeader.css';

Expand Down Expand Up @@ -82,6 +83,7 @@ export class SpinnakerHeader extends React.Component<{}, ISpinnakerHeaderState>
<UserMenu />
<GlobalSearch />
<WhatsNew />
<HelpMenu />
</ul>
</div>
}
Expand Down
32 changes: 32 additions & 0 deletions app/scripts/modules/core/src/help/HelpMenu.less
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
.help-menu {
border: 0;

.dropdown-toggle,
.dropdown-toggle:active {
border: 0;
font-size: 14px;
font-weight: 200;
margin: 0;
border: 0;
background: transparent;
border-radius: 0;
color: var(--color-white);

.caret {
margin-left: 3px;
}
}

.dropdown.open {
.dropdown-toggle {
background-color: transparent;
text-decoration: none;
color: var(--color-white);
box-shadow: none;
}
}

.dropdown-menu {
border: 0;
}
}
42 changes: 42 additions & 0 deletions app/scripts/modules/core/src/help/HelpMenu.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
import * as React from 'react';
import { Dropdown, MenuItem, Glyphicon } from 'react-bootstrap';

import './HelpMenu.less';

const DOCS_URL = 'https://spinnaker.io/docs';
const COMMUNITY_URL = 'https://spinnaker.io/community';

export const HelpMenu = () => {
return (
<li className="help-menu">
<Dropdown id="help-menu-dropdown" pullRight={true}>
<Dropdown.Toggle className="hidden-lg" noCaret={true}>
<Glyphicon glyph="question-sign" />
</Dropdown.Toggle>
<Dropdown.Menu>
<MenuItem href={DOCS_URL} target="_blank">
Docs
</MenuItem>
<MenuItem divider={true} />
<MenuItem href={COMMUNITY_URL} target="_blank">
Community Resources
</MenuItem>
</Dropdown.Menu>
</Dropdown>

<Dropdown id="help-menu-dropdown-large" pullRight={true}>
<Dropdown.Toggle className="hidden-xs hidden-sm hidden-md">
Help
</Dropdown.Toggle>
<Dropdown.Menu>
<MenuItem href={DOCS_URL} target="_blank">
Docs
</MenuItem>
<MenuItem href={COMMUNITY_URL} target="_blank">
Community Resources
</MenuItem>
</Dropdown.Menu>
</Dropdown>
</li>
);
};

0 comments on commit 4849bdf

Please sign in to comment.