Skip to content

Commit 839fb5b

Browse files
committed
feat: update event names for explorer page navigation
1 parent b5b6d2e commit 839fb5b

File tree

3 files changed

+10
-9
lines changed

3 files changed

+10
-9
lines changed

src/common/utils/call-event.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,8 +31,8 @@ export interface EventName {
3131
name: string
3232
template: string
3333
}
34-
openJumpPage: null
35-
closeJumpPage: null
34+
openExplorerPage: null
35+
closeExplorerPage: null
3636

3737
// setting keys
3838
wigiPadDateSettingsChanged: WigiPadDateSetting

src/layouts/navbar/navbar.layout.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,8 +35,9 @@ export function NavbarTabs() {
3535

3636
const handleTabClick = (tab: string) => {
3737
setActiveTab(tab)
38-
if (tab === 'home') callEvent('closeJumpPage')
39-
else callEvent('openJumpPage')
38+
if (tab === 'home') callEvent('closeExplorerPage')
39+
else callEvent('openExplorerPage')
40+
Analytics.event(`navbar_tab_${tab}_click`)
4041
}
4142

4243
return (

src/pages/home.tsx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -162,11 +162,11 @@ export function HomePage() {
162162
}
163163
)
164164

165-
const openJumpPageEvent = listenEvent('openJumpPage', () => {
166-
setCurrentView('catalog')
165+
const openExplorerPageEvent = listenEvent('openExplorerPage', () => {
166+
setCurrentView('explore')
167167
})
168168

169-
const closeJumpPageEvent = listenEvent('closeJumpPage', () => {
169+
const closeExplorerPageEvent = listenEvent('closeExplorerPage', () => {
170170
setCurrentView('home')
171171
})
172172

@@ -175,8 +175,8 @@ export function HomePage() {
175175
return () => {
176176
wallpaperChangedEvent()
177177
openWidgetsSettingsEvent()
178-
openJumpPageEvent()
179-
closeJumpPageEvent()
178+
openExplorerPageEvent()
179+
closeExplorerPageEvent()
180180
}
181181
}, [])
182182

0 commit comments

Comments
 (0)