mirror of
https://github.com/wassname/talk.git
synced 2026-07-30 12:40:41 +08:00
Adding found
This commit is contained in:
@@ -2,36 +2,10 @@ import React, { StatelessComponent } from "react";
|
||||
import { HorizontalGutter } from "talk-ui/components";
|
||||
import NavigationContainer from "../containers/NavigationContainer";
|
||||
|
||||
export type View =
|
||||
| "MODERATE"
|
||||
| "COMMUNITY"
|
||||
| "STORIES"
|
||||
| "CONFIGURE"
|
||||
| "%future added value";
|
||||
|
||||
export interface AppProps {
|
||||
view: View;
|
||||
}
|
||||
|
||||
const renderView = (view: View) => {
|
||||
switch (view) {
|
||||
case "MODERATE":
|
||||
return <div>MODERATE</div>;
|
||||
case "COMMUNITY":
|
||||
return <div>COMMUNITY</div>;
|
||||
case "STORIES":
|
||||
return <div>STORIES</div>;
|
||||
case "CONFIGURE":
|
||||
return <div>CONFIGURE</div>;
|
||||
default:
|
||||
throw new Error(`Unknown view ${view}`);
|
||||
}
|
||||
};
|
||||
|
||||
const App: StatelessComponent<AppProps> = ({ view }) => (
|
||||
const App: StatelessComponent = ({ children }) => (
|
||||
<HorizontalGutter>
|
||||
<NavigationContainer />
|
||||
{renderView(view)}
|
||||
{children}
|
||||
</HorizontalGutter>
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user