|
| 1 | +importReactfrom'react' |
| 2 | +importclassnamesfrom'classnames' |
| 3 | +importLayoutfrom'@theme/Layout' |
| 4 | +importLinkfrom'@docusaurus/Link' |
| 5 | +importuseDocusaurusContextfrom'@docusaurus/useDocusaurusContext' |
| 6 | +importuseBaseUrlfrom'@docusaurus/useBaseUrl' |
| 7 | +importstylesfrom'./styles.module.css' |
| 8 | + |
| 9 | +constfeatures=[ |
| 10 | +{ |
| 11 | +title:<>Your Editor</>, |
| 12 | +imageUrl:'img/undraw_docusaurus_mountain.svg', |
| 13 | +description:<>Playing tutorials in a real-world setting: within your coding editor.</>, |
| 14 | +}, |
| 15 | +{ |
| 16 | +title:<>Your Code</>, |
| 17 | +imageUrl:'img/undraw_docusaurus_tree.svg', |
| 18 | +description:<>You own your progress. Save with Git to build your timeline. Deploy to build your portfolio.</>, |
| 19 | +}, |
| 20 | +{ |
| 21 | +title:<>Open</>, |
| 22 | +imageUrl:'img/undraw_docusaurus_react.svg', |
| 23 | +description:<>CodeRoad is open-source. Build your own tutorials. Contribute to the tooling.</>, |
| 24 | +}, |
| 25 | +] |
| 26 | + |
| 27 | +functionFeature({ imageUrl, title, description}){ |
| 28 | +constimgUrl=useBaseUrl(imageUrl) |
| 29 | +return( |
| 30 | +<divclassName={classnames('col col--4',styles.feature)}> |
| 31 | +{imgUrl&&( |
| 32 | +<divclassName="text--center"> |
| 33 | +<imgclassName={styles.featureImage}src={imgUrl}alt={title}/> |
| 34 | +</div> |
| 35 | +)} |
| 36 | +<h3>{title}</h3> |
| 37 | +<p>{description}</p> |
| 38 | +</div> |
| 39 | +) |
| 40 | +} |
| 41 | + |
| 42 | +functionHome(){ |
| 43 | +constcontext=useDocusaurusContext() |
| 44 | +const{ siteConfig={}}=context |
| 45 | +return( |
| 46 | +<Layouttitle={`Hello from${siteConfig.title}`}description="Description will go into a meta tag in <head />"> |
| 47 | +<headerclassName={classnames('hero hero--primary',styles.heroBanner)}> |
| 48 | +<divclassName="container"> |
| 49 | +<h1className="hero__title">{siteConfig.title}</h1> |
| 50 | +<pclassName="hero__subtitle">{siteConfig.tagline}</p> |
| 51 | +<divclassName={styles.buttons}> |
| 52 | +<Link |
| 53 | +className={classnames('button button--outline button--secondary button--lg',styles.getStarted)} |
| 54 | +to={useBaseUrl('docs/overview')} |
| 55 | +> |
| 56 | + Get Started |
| 57 | +</Link> |
| 58 | +</div> |
| 59 | +</div> |
| 60 | +</header> |
| 61 | +<main> |
| 62 | +{features&&features.length&&( |
| 63 | +<sectionclassName={styles.features}> |
| 64 | +<divclassName="container"> |
| 65 | +<divclassName="row"> |
| 66 | +{features.map((props,idx)=>( |
| 67 | +<Featurekey={idx}{...props}/> |
| 68 | +))} |
| 69 | +</div> |
| 70 | +</div> |
| 71 | +</section> |
| 72 | +)} |
| 73 | +</main> |
| 74 | +</Layout> |
| 75 | +) |
| 76 | +} |
| 77 | + |
| 78 | +exportdefaultHome |