Initial work on Shares

This commit is contained in:
Deluan
2023-01-19 22:52:55 -05:00
parent 5331de17c2
commit ab04e33da6
36 changed files with 841 additions and 84 deletions
+14 -6
View File
@@ -15,6 +15,7 @@ import album from './album'
import artist from './artist'
import playlist from './playlist'
import radio from './radio'
import share from './share'
import { Player } from './audioplayer'
import customRoutes from './routes'
import {
@@ -31,10 +32,11 @@ import {
} from './reducers'
import createAdminStore from './store/createAdminStore'
import { i18nProvider } from './i18n'
import config from './config'
import config, { shareInfo } from './config'
import { setDispatch, startEventStream, stopEventStream } from './eventStream'
import { keyMap } from './hotkeys'
import useChangeThemeColor from './useChangeThemeColor'
import ShareApp from './ShareApp'
const history = createHashHistory()
@@ -106,6 +108,7 @@ const Admin = (props) => {
name="radio"
{...(permissions === 'admin' ? radio.admin : radio.all)}
/>,
config.devEnableShare && <Resource name="share" {...share} />,
<Resource
name="playlist"
{...playlist}
@@ -136,10 +139,15 @@ const Admin = (props) => {
)
}
const AppWithHotkeys = () => (
<HotKeys keyMap={keyMap}>
<App />
</HotKeys>
)
const AppWithHotkeys = () => {
if (config.devEnableShare && shareInfo) {
return <ShareApp />
}
return (
<HotKeys keyMap={keyMap}>
<App />
</HotKeys>
)
}
export default AppWithHotkeys