Basic empty window.

pull/24/head
Sander Vocke 5 years ago
parent 04e47349dd
commit b4635b2e4a
  1. 10
      client/src/components/MainWindow.tsx
  2. 26
      client/src/components/windows/ManageTagsWindow.tsx
  3. 9
      client/src/components/windows/Windows.tsx

@ -9,6 +9,7 @@ import ArtistWindow from './windows/ArtistWindow';
import AlbumWindow from './windows/AlbumWindow';
import TagWindow from './windows/TagWindow';
import SongWindow from './windows/SongWindow';
import ManageTagsWindow from './windows/ManageTagsWindow';
var _ = require('lodash');
const darkTheme = createMuiTheme({
@ -76,6 +77,7 @@ export default function MainWindow(props: any) {
newWindowState[WindowType.Album](),
newWindowState[WindowType.Artist](),
newWindowState[WindowType.Tag](),
newWindowState[WindowType.ManageTags](),
],
tabReducers: [
newWindowReducer[WindowType.Query],
@ -83,6 +85,7 @@ export default function MainWindow(props: any) {
newWindowReducer[WindowType.Album],
newWindowReducer[WindowType.Artist],
newWindowReducer[WindowType.Tag],
newWindowReducer[WindowType.ManageTags],
],
tabTypes: [
WindowType.Query,
@ -90,6 +93,7 @@ export default function MainWindow(props: any) {
WindowType.Album,
WindowType.Artist,
WindowType.Tag,
WindowType.ManageTags,
],
activeTab: 0
})
@ -134,6 +138,12 @@ export default function MainWindow(props: any) {
dispatch={tabDispatch}
mainDispatch={dispatch}
/>
case WindowType.ManageTags:
return <ManageTagsWindow
state={tabState}
dispatch={tabDispatch}
mainDispatch={dispatch}
/>
default:
throw new Error("Unimplemented window type");
}

@ -0,0 +1,26 @@
import React from 'react';
import { WindowState } from './Windows';
var _ = require('lodash');
export interface ManageTagsWindowState extends WindowState {
}
export enum ManageTagsWindowActions {
}
export function ManageTagsWindowReducer(state: ManageTagsWindowState, action: any) {
switch (action.type) {
default:
throw new Error("Unimplemented ManageTagsWindow state update.")
}
}
export interface IProps {
state: ManageTagsWindowState,
dispatch: (action: any) => void,
mainDispatch: (action: any) => void,
}
export default function ManageTagsWindow(props: IProps) {
return <>Hi!</>
}

@ -6,10 +6,12 @@ import PersonIcon from '@material-ui/icons/Person';
import AlbumIcon from '@material-ui/icons/Album';
import LocalOfferIcon from '@material-ui/icons/LocalOffer';
import AudiotrackIcon from '@material-ui/icons/Audiotrack';
import LoyaltyIcon from '@material-ui/icons/Loyalty';
import { SongWindowReducer } from './SongWindow';
import { AlbumWindowReducer } from './AlbumWindow';
import { TagWindowReducer } from './TagWindow';
import { songGetters } from '../../lib/songGetters';
import { ManageTagsWindowReducer } from './ManageTagsWindow';
export enum WindowType {
Query = "Query",
@ -17,6 +19,7 @@ export enum WindowType {
Album = "Album",
Tag = "Tag",
Song = "Song",
ManageTags = "ManageTags",
}
export interface WindowState {
@ -29,6 +32,7 @@ export const newWindowReducer = {
[WindowType.Album]: AlbumWindowReducer,
[WindowType.Song]: SongWindowReducer,
[WindowType.Tag]: TagWindowReducer,
[WindowType.ManageTags]: ManageTagsWindowReducer,
}
export const newWindowState = {
@ -78,4 +82,9 @@ export const newWindowState = {
songsWithTag: null,
}
},
[WindowType.ManageTags]: () => {
return {
tabLabel: <><LoyaltyIcon/>Manage Tags</>,
}
}
}
Loading…
Cancel
Save