2019-05-13 17:55:32 +04:00
/ * *
* 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 MarkdownBlock = CompLibrary . MarkdownBlock ; /* Used to read markdown */
const Container = CompLibrary . Container ;
const GridBlock = CompLibrary . GridBlock ;
class HomeSplash extends React . Component {
render ( ) {
const { siteConfig , language = '' } = this . props ;
const { baseUrl , docsUrl } = siteConfig ;
const docsPart = ` ${ docsUrl ? ` ${ docsUrl } / ` : '' } ` ;
const langPart = ` ${ language ? ` ${ language } / ` : '' } ` ;
const docUrl = doc => ` ${ baseUrl } ${ docsPart } ${ langPart } ${ doc } ` ;
const SplashContainer = props => (
< div className = "homeContainer" >
< div className = "homeSplashFade" >
2019-06-03 20:16:05 +04:00
< div className = "wrapper homeWrapper" >
2019-06-06 18:59:05 +04:00
< div className = "tabs" >
< div className = "nav-tabs" >
< div id = "tab-group-3-tab-4" className = "nav-link active" data - group = "group_3"
2019-06-11 05:37:12 +04:00
data - tab = "tab-group-3-content-4" > PascaLIGO < / d i v >
2019-06-10 22:15:14 +04:00
< div className = "nav-link" data - group = "group_3"
2019-06-11 05:37:12 +04:00
data - tab = "tab-group-3-content-5" > CameLIGO < / d i v >
2019-06-13 13:59:02 +04:00
< div className = "nav-link" > ReasonLIGO ( coming soon ) < / d i v >
2019-06-06 18:59:05 +04:00
{ / * < d i v i d = " t a b - g r o u p - 3 - t a b - 5 " c l a s s N a m e = " n a v - l i n k " d a t a - g r o u p = " g r o u p _ 3 "
2019-06-03 20:16:05 +04:00
data - tab = "tab-group-3-content-5" > Camligo < /div> */ }
< / d i v >
2019-06-06 18:59:05 +04:00
< div className = "tab-content" >
< div id = "tab-group-3-content-4" className = "tab-pane active" data - group = "group_3" tabIndex = "-1" >
2019-06-03 20:16:05 +04:00
< div >
< span >
2019-06-24 19:31:55 +04:00
< pre > < code className = "hljs css language-Pascal" > // variant defining pseudo multi-entrypoint actions<br />type action is<br />| Increment of int<br />| Decrement of int<br /><br />function add (const a : int ; const b : int) : int is<br /> block {'{ skip }'} with a + b<br /><br />function subtract (const a : int ; const b : int) : int is<br /> block {'{ skip }'} with a - b<br /><br />// real entrypoint that re-routes the flow based on the action provided<br />function main (const p : action ; const s : int) : (list(operation) * int) is<br /> block {'{ skip }'} with ((nil : list(operation)),<br /> case p of<br /> | Increment(n) -> add(s, n)<br /> | Decrement(n) -> subtract(s, n)<br /> end)<br /></code></pre>
2019-06-03 20:16:05 +04:00
< / s p a n >
< / d i v >
< / d i v >
2019-06-06 18:59:05 +04:00
< div id = "tab-group-3-content-5" className = "tab-pane" data - group = "group_3" tabIndex = "-1" >
2019-06-03 20:16:05 +04:00
< div >
2019-06-10 22:15:14 +04:00
< pre >
< code className = "hljs css language-Pascal" >
type storage = int < br / > < br / > ( * variant defining pseudo multi - entrypoint actions * ) < br / > < br / > type action = < br / > | Increment of int < br / > | Decrement of int < br / > < br / > let add ( a : int ) ( b : int ) : int = a + b < br / > < br / > let subtract ( a : int ) ( b : int ) : int = a - b < br / > < br / > ( * real entrypoint that re - routes the flow based on the action provided * ) < br / > < br / > let % entry main ( p : action ) storage = < br / > let storage = < br / > match p with < br / > | Increment n - > add storage n < br / > | Decrement n - > subtract storage n < br / > in ( ( [ ] : operation list ) , storage ) < br / >
< / c o d e >
< / p r e >
2019-06-03 20:16:05 +04:00
< / d i v >
< / d i v >
< / d i v >
< / d i v >
{ props . children }
< / d i v >
2019-05-13 17:55:32 +04:00
< / d i v >
< / d i v >
) ;
const Logo = props => (
< div className = "projectLogo" >
< img src = { props . img _src } alt = "Project Logo" / >
< / d i v >
) ;
const ProjectTitle = ( ) => (
< h2 className = "projectTitle" >
< small > { siteConfig . tagline } < / s m a l l >
< / h 2 >
) ;
const PromoSection = props => (
< div className = "section promoSection" >
< div className = "promoRow" >
< div className = "pluginRowBlock" > { props . children } < / d i v >
< / d i v >
< / d i v >
) ;
const Button = props => (
< div className = "pluginWrapper buttonWrapper" >
< a className = "button" href = { props . href } target = { props . target } >
{ props . children }
< / a >
< / d i v >
) ;
return (
< SplashContainer >
< div className = "inner" >
< ProjectTitle siteConfig = { siteConfig } / >
< PromoSection >
2019-06-13 13:59:02 +04:00
< Button href = { docUrl ( 'setup/installation.html' ) } > Get Started < / B u t t o n >
2019-07-10 06:27:01 +04:00
< Button href = { docUrl ( 'tutorials/get-started/tezos-taco-shop-smart-contract' ) } > Tutorials < / B u t t o n >
2019-06-06 19:59:03 +04:00
< Button href = { docUrl ( 'contributors/origin.html' ) } > Contribute < / B u t t o n >
2019-05-13 17:55:32 +04:00
< / P r o m o S e c t i o n >
< / d i v >
< / S p l a s h C o n t a i n e r >
) ;
}
}
class Index extends React . Component {
render ( ) {
const { config : siteConfig , language = '' } = this . props ;
const { baseUrl } = siteConfig ;
const Block = props => (
< Container
padding = { [ 'bottom' , 'top' ] }
id = { props . id }
background = { props . background } >
< GridBlock
align = "center"
contents = { props . children }
layout = { props . layout }
/ >
< / C o n t a i n e r >
) ;
const FeatureCallout = ( ) => (
< div
className = "productShowcaseSection paddingBottom"
style = { { textAlign : 'center' } } >
< h2 > Feature Callout < / h 2 >
< MarkdownBlock > These are features of this project < / M a r k d o w n B l o c k >
< / d i v >
) ;
const TryOut = ( ) => (
< Block id = "try" >
{ [
{
content :
'To make your landing page more attractive, use illustrations! Check out ' +
'[**unDraw**](https://undraw.co/) which provides you with customizable illustrations which are free to use. ' +
'The illustrations you see on this page are from unDraw.' ,
image : ` ${ baseUrl } img/undraw_code_review.svg ` ,
imageAlign : 'left' ,
title : 'Wonderful SVG Illustrations' ,
} ,
] }
< / B l o c k >
) ;
const Description = ( ) => (
< Block background = "dark" >
{ [
{
content :
'This is another description of how this project is useful' ,
image : ` ${ baseUrl } img/undraw_note_list.svg ` ,
imageAlign : 'right' ,
title : 'Description' ,
} ,
] }
< / B l o c k >
) ;
const LearnHow = ( ) => (
< Block background = "light" >
{ [
{
content :
'Each new Docusaurus project has **randomly-generated** theme colors.' ,
image : ` ${ baseUrl } img/undraw_youtube_tutorial.svg ` ,
imageAlign : 'right' ,
title : 'Randomly Generated Theme Colors' ,
} ,
] }
< / B l o c k >
) ;
const Features = ( ) => (
2019-06-03 20:16:05 +04:00
< div className = "features" >
< h1 className = "sectionTitle blockTitle" > Features < / h 1 >
< Block layout = "fourColumn" >
{ [
{
content : 'Write in PascaLIGO (pascal-like syntax) or CameLIGO (caml-like syntax). If you know OCaml, you can also add your own syntax.' ,
image : ` ${ baseUrl } img/edit.svg ` ,
imageAlign : 'top' ,
title : 'Syntax Agnostic' ,
} ,
{
content : 'Write types, then code, and benefit from the safety coming from type systems.' ,
image : ` ${ baseUrl } img/lightning.svg ` ,
imageAlign : 'top' ,
title : 'Strong Type System' ,
} ,
{
content : 'With Granary, you can use LIGO as a lib from NodeJS.' ,
image : ` ${ baseUrl } img/puzzle.svg ` ,
imageAlign : 'top' ,
title : 'Easy Integration' ,
}
] }
< / B l o c k >
< / d i v >
2019-05-13 17:55:32 +04:00
) ;
2019-05-24 17:16:38 +04:00
const Roadmap = ( ) => (
< div className = "roadmap" >
< Block background = "light" >
{ [
{
content :
"<h4>June 2019</h4>" +
"<em><ul>" +
"<li>First public release</li>" +
"<li>PascaLIGO and CameLIGO syntaxes</li>" +
"<li>Docs and Tutorials</li>" +
"<li>Integration testing in ReasonML/JS with Granary</li>" +
"</ul></em>" +
"<h4>July 2019</h4>" +
"<em><ul>" +
"<li>Try LIGO online editor</li>" +
"<li>Unit testing toolkit</li>" +
"<li>ReasonLIGO syntax support</li>" +
"<li>Repository with best practices & patterns for LIGO</li>" +
"</ul></em>" +
"<h4>August 2019</h4>" +
"<em>" +
"Long term plans will be announced soon" +
"</em>" ,
image : ` ` ,
imageAlign : 'right' ,
title : 'Roadmap' ,
} ,
] }
< / B l o c k >
< / d i v >
) ;
2019-06-03 20:16:05 +04:00
const Partners = ( ) => {
if ( ( siteConfig . partners || [ ] ) . length === 0 ) {
2019-05-13 17:55:32 +04:00
return null ;
}
2019-06-03 20:16:05 +04:00
const showcase = siteConfig . partners
2019-05-13 17:55:32 +04:00
. filter ( user => user . pinned )
. map ( user => (
< a href = { user . infoLink } key = { user . infoLink } >
< img src = { user . image } alt = { user . caption } title = { user . caption } / >
< / a >
) ) ;
const pageUrl = page => baseUrl + ( language ? ` ${ language } / ` : '' ) + page ;
return (
< div className = "productShowcaseSection paddingBottom" >
2019-06-03 20:16:05 +04:00
< h1 className = "sectionTitle" > Partners < / h 1 >
< div className = "logos" > { showcase } < / d i v >
{ / * < d i v c l a s s N a m e = " m o r e - u s e r s " >
< a className = "button" href = { pageUrl ( 'users.html' ) } >
More { siteConfig . title } Users
< / a >
< /div> */ }
< / d i v >
) ;
} ;
const Team = ( ) => {
if ( ( siteConfig . team || [ ] ) . length === 0 ) {
return null ;
}
const showcase = siteConfig . team
. filter ( user => user . pinned )
. map ( user => (
< a href = { user . infoLink } key = { user . infoLink } >
< img src = { user . image } alt = { user . caption } title = { user . caption } / >
< p > { user . caption } < / p >
< / a >
) ) ;
const pageUrl = page => baseUrl + ( language ? ` ${ language } / ` : '' ) + page ;
return (
< div className = "productShowcaseSection paddingBottom team" >
< h1 className = "sectionTitle" > Team < / h 1 >
2019-05-13 17:55:32 +04:00
< div className = "logos" > { showcase } < / d i v >
2019-05-24 17:16:38 +04:00
{ / * < d i v c l a s s N a m e = " m o r e - u s e r s " >
2019-05-13 17:55:32 +04:00
< a className = "button" href = { pageUrl ( 'users.html' ) } >
More { siteConfig . title } Users
< / a >
2019-05-24 17:16:38 +04:00
< /div> */ }
2019-05-13 17:55:32 +04:00
< / d i v >
) ;
} ;
return (
< div >
< HomeSplash siteConfig = { siteConfig } language = { language } / >
< div className = "mainContainer" >
2019-06-03 20:16:05 +04:00
2019-05-13 17:55:32 +04:00
< Features / >
2019-06-03 20:16:05 +04:00
{ /* <Roadmap /> */ }
2019-05-24 17:16:38 +04:00
{ /* <FeatureCallout /> */ }
{ /* {/* <LearnHow /> */ }
{ /* <TryOut /> */ }
{ /* <Description /> */ }
2019-06-03 20:16:05 +04:00
< Team / >
< Partners / >
2019-05-13 17:55:32 +04:00
< / d i v >
< / d i v >
) ;
}
}
module . exports = Index ;