render() { return ( <HighlightContainer> <ServerlessHighlight /> <PayasyougoHighlight /> <ClickHighlight /> <UnlimitedHighlight /> </HighlightContainer> ) }
const Layout = ({children, path}) => { const showSidebar = IS_STATIC || path.match(/cli-commands|configuring-npm|using-npm/) return ( <ThemeProvider theme={theme}> <Navbar /> <Flex w={1}> {showSidebar && <Sidebar />} <Box width={1}>{children}</Box> </Flex> </ThemeProvider> ) }
render() { return( <section> <Container fixed={this.props.fixed}> <Navigation light /> </Container> </section> ) }
render() { return ( <TableOfContentsContainer> <ul> {this.nodeListItems()} </ul> </TableOfContentsContainer> ) }
render() { return ( <Button href='/get-started'>Get Started</Button> ); }
static async getInitialProps({ renderPage }) { const sheet = new ServerStyleSheet(); const page = renderPage(App => props => sheet.collectStyles(<App {...props} />) ); const styleTags = sheet.getStyleElement(); // see https://github.com/nfl/react-helmet#server-usage for more information // 'head' was occupied by 'renderPage().head', we cannot use it return { ...page, styleTags, helmet: Helmet.rewind() }; }
const AvatarPure = (props: Object): React$Element<any> => ( <StyledAvatarContainer {...props}> <StyledAvatar {...props} /> </StyledAvatarContainer> )
render() { const { children, config } = this.props; return ( <div> <Helmet> <meta name="description" content={config.siteDescription} /> <html lang="en" /> </Helmet> <Global /> {children} </div> ); }
render() { return ( <Item> <Title>{this.props.title}</Title> <Description>{this.props.description}</Description> </Item> ) }
render() { return ( <Router history={history}> <Body> <Route component={Navbar} /> <Route component={ModalRoot} /> <Route component={Toasts} /> <Switch> <PrivateRoute exact path="/" component={Dashboard} /> <PrivateRoute path="/users/:username" component={Users} /> <PrivateRoute path="/users" component={Users} /> <PrivateRoute path="/communities/:slug" component={Communities} /> <PrivateRoute path="/communities" component={Communities} /> <PrivateRoute path="/threads" component={Threads} /> </Switch> </Body> </Router> ); }
render() { if (this.props.location.pathname === "apidocs") { // The other app manages apidocs this.props.location.reload(); } const { children } = this.props; return ( <div> <Helmet> <title>{`${config.siteTitle} | ${this.getLocalTitle()}`}</title> <meta name="description" content={config.siteDescription} /> </Helmet> <ThemeProvider theme={theme}> {children()} </ThemeProvider> </div> ); }