-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #41 from SSWConsulting/bundle-reduction-experiment
Reduce Package Size
- Loading branch information
Showing
9 changed files
with
167 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,61 +1,49 @@ | ||
import React from 'react'; | ||
import React from "react"; | ||
import styles from './index.module.css'; | ||
import cs from 'classnames'; | ||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; | ||
import { faAngleDown } from '@fortawesome/free-solid-svg-icons'; | ||
import MenuPanel from './menu-panel'; | ||
|
||
class DesktopMenu extends React.Component { | ||
// getRootUrl() { | ||
// if (this.props.prefix && typeof window !== 'undefined') { | ||
// return ( | ||
// window.location.origin | ||
// ? window.location.origin + '/' | ||
// : window.location.protocol + '/' + window.location.host + '/') + this.props.prefix + '/'; | ||
// } | ||
// return ''; | ||
// } | ||
|
||
render() { | ||
return ( | ||
<div className={cs(styles.menuDrop, styles.hiddenXs, styles.hiddenSm)}> | ||
<ul> | ||
{this.props.menuModel && | ||
this.props.menuModel.menuItems.map((item, index) => { | ||
return ( | ||
<li key={index}> | ||
{!item.children && ( | ||
<a | ||
href={item.navigateUrl ? item.navigateUrl : null} | ||
className={cs(styles.ignore, 'unstyled')} | ||
const DesktopMenu = (props) => { | ||
return ( | ||
<div className={cs(styles.menuDrop, styles.hiddenXs, styles.hiddenSm)}> | ||
<ul> | ||
{props.menuModel && | ||
props.menuModel.menuItems.map((item, index) => { | ||
return ( | ||
<li key={index}> | ||
{!item.children && ( | ||
<a | ||
href={item.navigateUrl ? item.navigateUrl : null} | ||
className={cs(styles.ignore, 'unstyled')} | ||
> | ||
{item.text} | ||
</a> | ||
)}{' '} | ||
{item.children && ( | ||
<> | ||
<div | ||
role="presentation" | ||
className={cs( | ||
styles.ignore, | ||
styles['cursor-pointer'], | ||
styles['inline-block'], | ||
'unstyled', | ||
)} | ||
> | ||
{item.text} | ||
</a> | ||
)}{' '} | ||
{item.children && ( | ||
<> | ||
<div | ||
role="presentation" | ||
className={cs( | ||
styles.ignore, | ||
styles['cursor-pointer'], | ||
styles['inline-block'], | ||
'unstyled', | ||
)} | ||
> | ||
{item.text} <FontAwesomeIcon icon={faAngleDown} /> | ||
</div> | ||
<div className={styles.Menu}> | ||
<MenuPanel item={item} prefix={this.props.prefix} /> | ||
</div> | ||
</> | ||
)} | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
</div> | ||
); | ||
} | ||
{item.text} <FontAwesomeIcon icon={faAngleDown} /> | ||
</div> | ||
<div className={styles.Menu}> | ||
<MenuPanel item={item} prefix={props.prefix} /> | ||
</div> | ||
</> | ||
)} | ||
</li> | ||
); | ||
})} | ||
</ul> | ||
</div> | ||
); | ||
} | ||
export default DesktopMenu; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.