Skip to content

Commit

Permalink
Remove unneeded dashboard->in-page-ui dep
Browse files Browse the repository at this point in the history
- Looks like we set this up but have never used this
  • Loading branch information
poltak committed Feb 26, 2024
1 parent d0a6085 commit 2522d9d
Showing 1 changed file with 1 addition and 41 deletions.
42 changes: 1 addition & 41 deletions src/overview/components/DashboardResultsContainer/logic.ts
Original file line number Diff line number Diff line change
@@ -1,28 +1,14 @@
import { UILogic } from 'ui-logic-core'
import {
import type {
DashboardResultsDependencies,
DashboardResultsEvent,
DashboardResultsState,
} from 'src/overview/components/DashboardResultsContainer/types'
import { EventEmitter } from 'events'
import TypedEventEmitter from 'typed-emitter'
import { SharedInPageUIEvents } from 'src/in-page-ui/shared-state/types'
import { SharedInPageUIState } from 'src/in-page-ui/shared-state/shared-in-page-ui-state'

export default class DashboardResultsLogic extends UILogic<
DashboardResultsState,
DashboardResultsEvent
> {
overviewUIEvents = new EventEmitter() as TypedEventEmitter<
SharedInPageUIEvents
>

dashboardUI = new SharedInPageUIState({
loadComponent: (c) => null,
unloadComponent: (c) => null,
getNormalizedPageUrl: () => '',
})

constructor(private dependencies: DashboardResultsDependencies) {
super()
}
Expand All @@ -33,30 +19,4 @@ export default class DashboardResultsLogic extends UILogic<
readerUrl: null,
}
}

getDashboardUILogic = () => {}

handleReaderViewClick = ({ event }) => {
this.emitMutation({
readerShow: { $set: true },
readerUrl: { $set: event },
})
// testing
this.overviewUIEvents.emit('stateChanged', {
changes: { sidebar: true },
newState: null,
})
}
handleToggleAnnotationsSidebar = ({
event: { pageUrl, pageTitle },
prevState,
}) => {
this.dashboardUI.showSidebar()
}

handleReaderClose = ({ event }) =>
this.emitMutation({
readerShow: { $set: false },
readerUrl: { $set: null },
})
}

0 comments on commit 2522d9d

Please sign in to comment.