Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- onPageLoad(sink => {
- let isUserLoggedInServerCheck = false;
- if (sink.request.cookies.sssr) {
- isUserLoggedInServerCheck = true;
- }
- sink.renderIntoElementById(
- 'react-target',
- renderToString(
- <AppServer
- location={sink.request.url}
- isUserLoggedInServerCheck={isUserLoggedInServerCheck}
- />
- )
- );
- });
- const AppServer = props => {
- const context = {};
- const { location, isUserLoggedInServerCheck } = props;
- return (
- <StaticRouter context={context} location={location}>
- <div className="application">
- <Switch isUserLoggedInServerCheck={isUserLoggedInServerCheck}>
- <Route path="/" exact component={CandidateLanding} />
- </Switch>
- </div>
- </StaticRouter>
- );
- };
- function CandidateLanding(props) {
- const { location, isUserLoggedInServerCheck } = props;
- return (
- <div>
- <Navbar location={location.path} isUserLoggedInServerCheck={isUserLoggedInServerCheck} />
- </div>
- );
- }
- const CandidateLandingContainer = withTracker(props => {
- const { isUserLoggedInServerCheck } = props;
- if (Meteor.isServer) {
- return {
- isUserLoggedInServerCheck
- };
- }
- if (Meteor.isClient) {
- return {
- isUserLoggedInServerCheck
- };
- }
- })(CandidateLanding);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement