-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(homepage-grid): Fixes issue with the homepage grid breaking on sm…
…aller browser window sizes. (#39) Closes #38 I rearranged the grid contents a little: ![1A90B946-6259-4DB3-B4B3-B48CF25C416C-28703-0000F825C533ED51](https://github.com/infinitered/ir-docs/assets/139261/455c8255-7463-46ae-a10a-54608f65d576)
- Loading branch information
1 parent
cc42a98
commit 0794de1
Showing
2 changed files
with
48 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,49 @@ | ||
import Link from '@docusaurus/Link'; | ||
import React from 'react'; | ||
import clsx from 'clsx'; | ||
import styles from './styles.module.css'; | ||
import useDocusaurusContext from '@docusaurus/useDocusaurusContext'; | ||
import Link from "@docusaurus/Link"; | ||
import React from "react"; | ||
import clsx from "clsx"; | ||
import styles from "./styles.module.css"; | ||
import useDocusaurusContext from "@docusaurus/useDocusaurusContext"; | ||
|
||
type FeatureItem = { | ||
title: string; Svg: React.ComponentType<React.ComponentProps<'svg'>>; description: JSX.Element; | ||
title: string; | ||
Svg: React.ComponentType<React.ComponentProps<"svg">>; | ||
description: JSX.Element; | ||
}; | ||
|
||
|
||
function Feature({title, description}: FeatureItem) { | ||
return (<div className={clsx('col col--4')}> | ||
<div className="text--center padding-horiz--md"> | ||
<h3>{title}</h3> | ||
<p>{description}</p> | ||
<p>Check it out</p> | ||
</div> | ||
</div>); | ||
function Feature({ title, description }: FeatureItem) { | ||
return ( | ||
<div className={clsx("col col--4")}> | ||
<div className="text--center padding-horiz--md"> | ||
<h3>{title}</h3> | ||
<p>{description}</p> | ||
<p>Check it out</p> | ||
</div> | ||
</div> | ||
); | ||
} | ||
|
||
export default function HomePageProjects() { | ||
const context = useDocusaurusContext(); | ||
const packages = context.globalData['custom-homepage-plugin'].default['packages']; | ||
console.log(packages.map(pkg => pkg.projectName)) | ||
const context = useDocusaurusContext(); | ||
const packages = context.globalData["custom-homepage-plugin"].default["packages"]; | ||
console.log(packages.map((pkg) => pkg.projectName)); | ||
|
||
return (<div className={"container"}><section className={styles.projects}> | ||
{packages.map((item: any) => (<Link to={`/${item.projectName}`} key={item.projectName}> | ||
return ( | ||
<div className={"container"}> | ||
<section className={styles.projects}> | ||
{packages.map((item: any) => ( | ||
<Link to={`/${item.projectName}`} key={item.projectName}> | ||
<div className={styles.project}> | ||
<div className={styles.projectHead}> | ||
<h2 className={styles.projectHeadText}>{item.label}</h2> | ||
</div> | ||
<div className={styles.projectBody}> | ||
<p className={styles.projectText}> | ||
{item.description} | ||
</p> | ||
<p className={styles.callToAction}>Check it out</p> | ||
</div> | ||
<div className={styles.projectHead}> | ||
<h2 className={styles.projectHeadText}>{item.label}</h2> | ||
</div> | ||
<div className={styles.projectBody}> | ||
<p className={styles.projectText}>{item.description}</p> | ||
</div> | ||
<p className={styles.callToAction}>Check it out</p> | ||
</div> | ||
</Link>))} | ||
</section></div>); | ||
</Link> | ||
))} | ||
</section> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters