diff --git a/packages/app/app/components/PlayQueue/QueuePopup/index.tsx b/packages/app/app/components/PlayQueue/QueuePopup/index.tsx index bb0f2474f3..f07569c2f6 100644 --- a/packages/app/app/components/PlayQueue/QueuePopup/index.tsx +++ b/packages/app/app/components/PlayQueue/QueuePopup/index.tsx @@ -12,7 +12,7 @@ import * as QueueActions from '../../../actions/queue'; import styles from './styles.scss'; import { PluginsState } from '../../../reducers/plugins'; -type QueuePopupProps = { +export type QueuePopupProps = { trigger: React.ReactNode; isQueueItemCompact: boolean; diff --git a/packages/app/app/containers/PlayQueueContainer/PlayQueueContainer.test.tsx b/packages/app/app/containers/PlayQueueContainer/PlayQueueContainer.test.tsx index 306a779798..8577beb15b 100644 --- a/packages/app/app/containers/PlayQueueContainer/PlayQueueContainer.test.tsx +++ b/packages/app/app/containers/PlayQueueContainer/PlayQueueContainer.test.tsx @@ -17,9 +17,8 @@ describe('Play Queue container', () => { setupI18Next(); }); - beforeEach(() => { - // eslint-disable-next-line @typescript-eslint/no-var-requires - const { store } = require('@nuclear/core'); + beforeEach(async () => { + const { store } = await import('@nuclear/core'); store.clear(); }); diff --git a/packages/app/app/containers/QueuePopupContainer/index.js b/packages/app/app/containers/QueuePopupContainer/index.js deleted file mode 100644 index 6d9bb4ed06..0000000000 --- a/packages/app/app/containers/QueuePopupContainer/index.js +++ /dev/null @@ -1,26 +0,0 @@ -import { connect } from 'react-redux'; -import { bindActionCreators } from 'redux'; -import { clipboard } from 'electron'; -import { compose, withHandlers } from 'recompose'; -import * as QueueActions from '../../actions/queue'; - -import QueuePopup from '../../components/PlayQueue/QueuePopup'; - -const mapStateToProps = state => ({ - plugins: state.plugin -}); - -const mapDispatchToProps = dispatch => ({ - actions: bindActionCreators(Object.assign({}, QueueActions), dispatch) -}); - -export default compose( - connect(mapStateToProps, mapDispatchToProps), - withHandlers({ - copyToClipboard: () => (text) => { - if (text?.length) { - clipboard.writeText(text); - } - } - }) -)(QueuePopup); diff --git a/packages/app/app/containers/QueuePopupContainer/index.tsx b/packages/app/app/containers/QueuePopupContainer/index.tsx new file mode 100644 index 0000000000..cdf714444a --- /dev/null +++ b/packages/app/app/containers/QueuePopupContainer/index.tsx @@ -0,0 +1,26 @@ +import React from 'react'; +import { useDispatch, useSelector } from 'react-redux'; +import { clipboard } from 'electron'; +import * as QueueActions from '../../actions/queue'; +import QueuePopup, { QueuePopupProps } from '../../components/PlayQueue/QueuePopup'; +import { RootState } from '../../reducers'; +import { bindActionCreators } from 'redux'; + +type QueuePopupContainerProps = Omit; + +const QueuePopupContainer: React.FC = (props) => { + const dispatch = useDispatch(); + const plugins = useSelector((state: RootState) => state.plugin); + + const copyToClipboard = (text: string) => { + if (text?.length) { + clipboard.writeText(text); + } + }; + + const actions = React.useMemo(() => bindActionCreators(QueueActions, dispatch), [dispatch]); + + return ; +}; + +export default QueuePopupContainer;