File tree Expand file tree Collapse file tree 3 files changed +157
-176
lines changed
src/js/components/explorer Expand file tree Collapse file tree 3 files changed +157
-176
lines changed Original file line number Diff line number Diff line change @@ -18,16 +18,15 @@ const propTypes = {
1818 showShareIcon : PropTypes . bool
1919} ;
2020
21- const defaultProps = {
22- showShareIcon : false
23- } ;
24-
2521require ( 'pages/explorer/explorerPage.scss' ) ;
2622
2723const slug = 'explorer' ;
2824const emailSubject = 'USAspending.gov Federal Spending Explorer' ;
2925
30- const ExplorerWrapperPage = ( props ) => {
26+ const ExplorerWrapperPage = ( {
27+ showShareIcon = false ,
28+ children
29+ } ) => {
3130 const dispatch = useDispatch ( ) ;
3231 const handleShareDispatch = ( url ) => {
3332 dispatch ( showModal ( url ) ) ;
@@ -45,21 +44,20 @@ const ExplorerWrapperPage = (props) => {
4544 classNames = "usa-da-explorer-page"
4645 title = "Spending Explorer"
4746 metaTagProps = { explorerPageMetaTags }
48- toolBarComponents = { props . showShareIcon ? [
47+ toolBarComponents = { showShareIcon ? [
4948 < ShareIcon
5049 onShareOptionClick = { handleShare }
5150 url = { getBaseUrl ( slug ) } />
5251 ] : [ ] } >
5352 < main
5453 id = "main-content"
5554 className = "main-content" >
56- { props . children }
55+ { children }
5756 </ main >
5857 </ PageWrapper >
5958 ) ;
6059} ;
6160
6261ExplorerWrapperPage . propTypes = propTypes ;
63- ExplorerWrapperPage . defaultProps = defaultProps ;
6462
6563export default ExplorerWrapperPage ;
Original file line number Diff line number Diff line change 33 * Created by Kevin Li 8/16/17
44 */
55
6- import React , { useState } from 'react' ;
6+ import React , { useCallback , useState } from 'react' ;
77import DetailContentContainer from 'containers/explorer/detail/DetailContentContainer' ;
88import ExplorerWrapperPage from '../ExplorerWrapperPage' ;
99import ExplorerTooltip from './visualization/ExplorerTooltip' ;
@@ -22,14 +22,14 @@ const ExplorerDetailPage = () => {
2222 isAward : false
2323 } ) ;
2424
25- const showTooltipFn = ( position , data ) => {
25+ const showTooltipFn = useCallback ( ( position , data ) => {
2626 setShowTooltip ( true ) ;
2727 setTooltip ( Object . assign ( { } , position , data ) ) ;
28- } ;
28+ } , [ ] ) ;
2929
30- const hideTooltipFn = ( ) => {
30+ const hideTooltipFn = useCallback ( ( ) => {
3131 setShowTooltip ( false ) ;
32- } ;
32+ } , [ ] ) ;
3333
3434 let tooltipUi = null ;
3535
You can’t perform that action at this time.
0 commit comments