Skip to content

Commit

Permalink
remove landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
lixiaoyan committed Sep 30, 2017
1 parent bd68e63 commit 5413c3c
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 108 deletions.
2 changes: 1 addition & 1 deletion entry/client.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const render = (hydrate = false) => {
<AppContainer>
<ApolloProvider client={client}>
<BrowserRouter>
<App context={{ hostname: location.hostname }} />
<App context={{}} />
</BrowserRouter>
</ApolloProvider>
</AppContainer>
Expand Down
2 changes: 1 addition & 1 deletion entry/server.js
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ export default options => (req, res) => {
<StyleSheetManager sheet={sheet.instance}>
<ApolloProvider client={client}>
<StaticRouter location={req.url} context={router}>
<App context={{ hostname: req.hostname }} />
<App context={{}} />
</StaticRouter>
</ApolloProvider>
</StyleSheetManager>
Expand Down
27 changes: 5 additions & 22 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import Helmet from "react-helmet";
import FocusEffect from "./ui/components/FocusEffect";

import AppHeader from "./components/AppHeader";
import Introduction from "./pages/Introduction";
import Home from "./pages/Home";
import TopicCreator from "./pages/TopicCreator";

Expand All @@ -28,33 +27,17 @@ class App extends React.Component {
context: PropTypes.object.isRequired,
};

isPreview() {
const hostname = this.props.context.hostname;
return (
process.env.NODE_ENV !== "production" ||
hostname === "preview.xn--omega.com"
);
}

render() {
return [
<Helmet key="helmet" defaultTitle="ω bbs" titleTemplate="%s - ω bbs" />,
<FocusEffect key="focus" />,
this.isPreview() && <AppHeader key="header" />,
<div key="root">
{this.isPreview() ? (
<Switch key={true}>
<Route exact path="/" component={Home} />
<Route path="/board/:board" component={Home} />
<Route path="/topic/new" component={TopicCreator} />
<Route path="/introduction" component={Introduction} />
</Switch>
) : (
<Switch key={false}>
<Route exact path="/" component={Introduction} />
<Route path="/introduction" component={Introduction} />
</Switch>
)}
<Switch key={true}>
<Route exact path="/" component={Home} />
<Route path="/board/:board" component={Home} />
<Route path="/topic/new" component={TopicCreator} />
</Switch>
</div>,
];
}
Expand Down
84 changes: 0 additions & 84 deletions src/pages/Introduction.js

This file was deleted.

0 comments on commit 5413c3c

Please sign in to comment.