diff --git a/client/components/App.tsx b/client/App.tsx similarity index 98% rename from client/components/App.tsx rename to client/App.tsx index 2d8a52a..a41b8be 100644 --- a/client/components/App.tsx +++ b/client/App.tsx @@ -19,7 +19,7 @@ function NavContainer() { - + diff --git a/client/components/index.ts b/client/components/index.ts index 151c136..77c3cf6 100644 --- a/client/components/index.ts +++ b/client/components/index.ts @@ -1,5 +1,3 @@ -export { default as App } from "./App"; -export { default as DevicesView } from "./DevicesView"; export { default as DeviceView } from "./DeviceView"; export { default as DurationView } from "./DurationView"; export { default as MessagesView } from "./MessagesView"; @@ -9,6 +7,5 @@ export { default as ScheduleView } from "./ScheduleView"; export { default as SectionRunnerView } from "./SectionRunnerView"; export { default as SectionTable } from "./SectionTable"; export { default as NavBar } from "./NavBar"; -export { default as MessageTest } from "./MessageTest"; export { default as ProgramSequenceView } from "./ProgramSequenceView"; export { default as SectionChooser } from "./SectionChooser"; diff --git a/client/index.tsx b/client/index.tsx index 9fb14cd..693b2a8 100644 --- a/client/index.tsx +++ b/client/index.tsx @@ -3,7 +3,7 @@ import * as ReactDOM from "react-dom"; import { AppContainer } from "react-hot-loader"; import { Router } from "react-router-dom"; -import App from "@client/components/App"; +import App from "@client/App"; import { AppState, ProvideState } from "@client/state"; import logger from "@common/logger"; @@ -30,8 +30,8 @@ const doRender = (Component: React.ComponentType) => { doRender(App); if (module.hot) { - module.hot.accept("@client/components/App", () => { - const NextApp = require("@client/components/App").default as typeof App; + module.hot.accept("@client/App", () => { + const NextApp = require("@client/App").default as typeof App; doRender(NextApp); }); } diff --git a/client/components/DevicesView.tsx b/client/pages/DevicePage.tsx similarity index 58% rename from client/components/DevicesView.tsx rename to client/pages/DevicePage.tsx index 01d277c..06417df 100644 --- a/client/components/DevicesView.tsx +++ b/client/pages/DevicePage.tsx @@ -5,14 +5,15 @@ import { Item } from "semantic-ui-react"; import DeviceView from "@client/components/DeviceView"; import { RouteComponentProps, withRouter } from "react-router"; -class DevicesView extends React.Component<{deviceId: string} & RouteComponentProps> { +class DevicePage extends React.Component> { render() { + const { match: { params: { deviceId } } } = this.props; return ( - + ); } } -export default withRouter(observer(DevicesView)); +export default withRouter(observer(DevicePage)); diff --git a/client/pages/LoginPage.tsx b/client/pages/LoginPage.tsx index 800631d..f80b93f 100644 --- a/client/pages/LoginPage.tsx +++ b/client/pages/LoginPage.tsx @@ -78,5 +78,4 @@ class LoginPage extends React.Component<{ appState: AppState }> { } } -const DecoratedLoginPage = injectState(observer(LoginPage)); -export { DecoratedLoginPage as LoginPage }; +export default injectState(observer(LoginPage)); diff --git a/client/pages/LogoutPage.tsx b/client/pages/LogoutPage.tsx index 13702d9..32d0f05 100644 --- a/client/pages/LogoutPage.tsx +++ b/client/pages/LogoutPage.tsx @@ -3,7 +3,7 @@ import { Redirect } from "react-router"; import { AppState, ConsumeState } from "@client/state"; -export function LogoutPage() { +export default function LogoutPage() { function consumeState(appState: AppState) { appState.tokenStore.clear(); return ( diff --git a/client/components/MessageTest.tsx b/client/pages/MessageTest.tsx similarity index 100% rename from client/components/MessageTest.tsx rename to client/pages/MessageTest.tsx diff --git a/client/pages/index.tsx b/client/pages/index.tsx index 1455e7a..b4fffd0 100644 --- a/client/pages/index.tsx +++ b/client/pages/index.tsx @@ -1,20 +1,5 @@ -import * as React from "react"; -import { RouteComponentProps } from "react-router"; - -import { DevicesView, MessageTest} from "@client/components"; - -export { LoginPage } from "./LoginPage"; -export { LogoutPage } from "./LogoutPage"; +export { default as DevicePage } from "./DevicePage"; +export { default as LoginPage } from "./LoginPage"; +export { default as LogoutPage } from "./LogoutPage"; +export { default as MessageTest } from "./MessageTest"; export { default as ProgramPage } from "./ProgramPage"; - -export function DevicePage({ match }: RouteComponentProps<{ deviceId: string }>) { - return ( - - ); -} - -export function MessagesTestPage() { - return ( - - ); -}