@kiwicom/smart-faq
Version:
Smart FAQ
180 lines (162 loc) • 5.08 kB
JavaScript
/**
* Copyright (c) 2017-present, Facebook, Inc.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/
const React = require('react');
const CompLibrary = require('../../core/CompLibrary.js');
const Container = CompLibrary.Container;
const GridBlock = CompLibrary.GridBlock;
class HomeSplash extends React.Component {
render() {
const { siteConfig } = this.props;
const { baseUrl } = siteConfig;
const SplashContainer = props => (
<div className="homeContainer">
<div className="homeSplashFade">
<div className="wrapper homeWrapper">{props.children}</div>
</div>
</div>
);
const ProjectTitle = () => (
<h2 className="projectTitle">{siteConfig.title}</h2>
);
const PromoSection = props => (
<div className="section promoSection">
<div className="promoRow">
<div className="pluginRowBlock">{props.children}</div>
</div>
</div>
);
const Button = props => (
<div className="pluginWrapper buttonWrapper">
<a
className="button"
href={props.href}
target={props.target}
title={props.title || ''}
>
{props.children}
</a>
</div>
);
return (
<SplashContainer>
<ProjectTitle siteConfig={siteConfig} />
<div className="inner">
<p>Slack channels:</p>
<PromoSection>
<Button
href="https://skypicker.slack.com/messages/CAZ5BCEE8"
title="Project related request"
>
#plz-smart-faq
</Button>
<Button
href="https://skypicker.slack.com/messages/CB4JPTBCZ"
title="Request updates in FAQ articles"
>
#smart-faq-content-req
</Button>
<Button
href="https://skypicker.slack.com/messages/C9K6Z0GSC"
title="Daily standups"
>
#smart-faq-standup
</Button>
<Button
href="https://skypicker.slack.com/messages/C8S3RQGQ6"
title="News"
>
#news-smart-faq
</Button>
</PromoSection>
<p>See the list of latest project updates:</p>
<Button href={`${baseUrl}blog`} title="Daily standups">
Project updates
</Button>
<p style={{ marginTop: '15px' }}>Test latest SmartFAQ version + FE booking master:</p>
<Button href="https://master.fe.staging.kiwi.com/en/account?SmartFAQAppBranch=branch-master&ContactFormChatAppBranch=branch-master" title="Demo">
Live demo
</Button>
</div>
</SplashContainer>
);
}
}
class Index extends React.Component {
render() {
const { config: siteConfig, language = '' } = this.props;
const { baseUrl, docsUrl } = siteConfig;
const docsPart = `${docsUrl ? `${docsUrl}/` : ''}`;
const langPart = `${language ? `${language}/` : ''}`;
const docUrl = doc => `${baseUrl}${docsPart}${langPart}${doc}`;
const Block = props => (
<Container
padding={['bottom']}
id={props.id}
background={props.background}
>
<GridBlock
align="center"
contents={props.children}
layout={props.layout}
/>
</Container>
);
const Features = () => (
<Block layout="fourColumn">
{[
{
content: `[Kiwi.com guarantee](${docUrl(
"guarantee-chat",
)}), [CS Phones](${docUrl("cs-phones")}), Contact form, Booking info`,
image: `${baseUrl}img/blonde_woman.png`,
imageAlign: "top",
imageLink: docUrl("guarantee-chat"),
title: "Business DOCs",
},
{
content: `[How to create link to FAQ etc.](${docUrl("link-to-faqs")})`,
image: `${baseUrl}img/docusaurus.svg`,
imageAlign: "top",
imageLink: docUrl("link-to-faqs"),
title: "Dev HOWTOs",
},
]}
</Block>
);
const Showcase = () => {
if ((siteConfig.users || []).length === 0) {
return null;
}
const showcase = siteConfig.users
.map(user => (
<a href={user.infoLink} key={user.infoLink}>
<img
src={`${siteConfig.baseUrl}${user.image}`}
alt={user.caption}
title={user.caption}
style={{ height: '100px', width: 'auto' }}
/>
<p>{user.description}</p>
</a>
));
return (
<div className="productShowcaseSection">
<h2>Who is behind This?</h2>
<div className="logos">{showcase}</div>
</div>
);
};
return (
<div>
<HomeSplash siteConfig={siteConfig} language={language} />
<Features />
<Showcase />
</div>
);
}
}
module.exports = Index;