Skip to content

Commit 216cd8f

Browse files
committed
remove currentPage State
1 parent f211802 commit 216cd8f

2 files changed

Lines changed: 7 additions & 4 deletions

File tree

src/App.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,11 @@ function App() {
1515
const { marketingBannerConfig = {}, feedbackWidget } = useContext(ConfigurationContext)
1616
const [showSideBar, setShowSideBar] = useState(false)
1717
const [showSettings, setShowSettings] = useState(false)
18-
const [currentPage, setCurrentPage] = useState('home')
1918
const { dispatcher, ...state } = useContext(PreferencesContext)
2019

2120
useEffect(() => {
22-
trackPageView(currentPage)
23-
}, [currentPage])
21+
trackPageView('home')
22+
}, [])
2423

2524
return (
2625
<div className="App">
@@ -37,7 +36,7 @@ function App() {
3736
<AppContentLayout setShowSettings={setShowSettings} />
3837
<BookmarksSidebar showSidebar={showSideBar} onClose={() => setShowSideBar(false)} />
3938

40-
<Footer setCurrentPage={setCurrentPage} feedbackWidget={feedbackWidget} />
39+
<Footer feedbackWidget={feedbackWidget} />
4140
</div>
4241
)
4342
}

src/components/Footer.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,20 @@ function Footer({ feedbackWidget }) {
1313
}
1414

1515
const onNewFeatureRequest = () => {
16+
trackPageView('feature request')
1617
window.open(APP.supportLink)
1718
}
1819

1920
const onPrivacyPolicyClick = () => {
21+
trackPageView('privacy policy')
2022
window.open(APP.privacyPolicyLink)
2123
}
2224
const onTermsClick = () => {
25+
trackPageView('terms and conditions')
2326
window.open(APP.termsAndConditionsLink)
2427
}
2528
const onDataSourcesClick = () => {
29+
trackPageView('data sources')
2630
window.open(APP.dataSourcesLink)
2731
}
2832

0 commit comments

Comments
 (0)