Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/menubar constants #440

Closed
wants to merge 3 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 13 additions & 14 deletions website/components/menubar.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,9 @@ const MenuBar = props => {
const [showMenuDropdown, setShowMenuDropdown] = useState(false);
const documentationMenu = useRef(null);
const [closeMenu, setCloseMenu] = useState(true);
const megadraftUrl = "https://draftjs.slack.com/messages/megadraft/";
const githubUrl = "https://github.com/globocom/megadraft";
const targetBlank = "_blank";

const handleTouchTap = event => {
// This prevents ghost click.
Expand Down Expand Up @@ -73,16 +76,10 @@ const MenuBar = props => {
Documentation
</Button>
<MenuDropDown {...dropDownData} />
<Button
href="https://draftjs.slack.com/messages/megadraft/"
target="_blank"
>
<Button href={megadraftUrl} target={targetBlank}>
Slack channel
</Button>
<Button
href="https://github.com/globocom/megadraft"
target="_blank"
>
<Button href={githubUrl} target={targetBlank}>
Repository
</Button>
</Grid>
Expand Down Expand Up @@ -122,15 +119,15 @@ const MenuBar = props => {
</Button>
<MenuDropDown {...dropDownData} />
<Button
href="https://draftjs.slack.com/messages/megadraft/"
target="_blank"
href={megadraftUrl}
target={targetBlank}
onClick={handleRequestClose}
>
Slack channel
</Button>
<Button
href="https://github.com/globocom/megadraft"
target="_blank"
href={githubUrl}
target={targetBlank}
onClick={handleRequestClose}
>
Repository
Expand All @@ -148,6 +145,8 @@ const MenuBar = props => {

const MenuDropDown = props => {
const { documentationMenu, handleRequestClose, showMenuDropdown } = props;
const targetBlank = "_blank";

return (
<Menu
id="simple-menu"
Expand Down Expand Up @@ -195,15 +194,15 @@ const MenuDropDown = props => {
component={"a"}
onClick={handleRequestClose}
href="http://draftjs.org"
target="_blank"
target={targetBlank}
>
Draft.js
</MenuItem>
<MenuItem
component={"a"}
onClick={handleRequestClose}
href="https://facebook.github.io/react/"
target="_blank"
target={targetBlank}
>
React
</MenuItem>
Expand Down
Loading