Skip to content

Commit

Permalink
Modify home page FeatureItem component
Browse files Browse the repository at this point in the history
  • Loading branch information
MikelElizondo committed Mar 14, 2024
1 parent bf89843 commit 9aaa3d7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 11 deletions.
16 changes: 6 additions & 10 deletions src/components/HomepageFeatures/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import styles from './styles.module.css';

type FeatureItem = {
title: string;
Svg: React.ComponentType<React.ComponentProps<'svg'>>;
imageSrc: string;
description: JSX.Element;
};

const FeatureList: FeatureItem[] = [
{
title: 'Scalability',
Svg: require('@site/static/img/scalability-2.png').default,
imageSrc: require('@site/static/img/scalability-2.png').default,
description: (
<>
Connect, manage and scale unlimited devices.
Expand All @@ -20,7 +20,7 @@ const FeatureList: FeatureItem[] = [
},
{
title: 'Plug & Play',
Svg: require('@site/static/img/plugplay.png').default,
imageSrc: require('@site/static/img/plugplay.png').default,
description: (
<>
Simple configuration, without the need for internal developers.
Expand All @@ -29,7 +29,7 @@ const FeatureList: FeatureItem[] = [
},
{
title: 'Flexibility',
Svg: require('@site/static/img/flexibility.png').default,
imageSrc: require('@site/static/img/flexibility.png').default,
description: (
<>
A solution that adapts to the needs of your company.
Expand All @@ -38,15 +38,11 @@ const FeatureList: FeatureItem[] = [
},
];

function Feature({title, Svg, description}: FeatureItem) {
function Feature({title, imageSrc, description}: FeatureItem) {
return (
<div className={clsx('col col--4')}>
<div className="text--center">
{typeof Svg === 'string' ? (
<img src={Svg} alt={title} className={styles.featureImage} />
) : (
<Svg className={styles.featureSvg} role="img" />
)}
<img src={imageSrc} alt={title} className={styles.featureImage} />
</div>
<div className="text--center padding-horiz--md">
<Heading as="h3">{title}</Heading>
Expand Down
2 changes: 1 addition & 1 deletion src/components/HomepageFeatures/styles.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
width: 100%;
}

.featureSvg {
.featureImage {
height: 200px;
width: 200px;
}

0 comments on commit 9aaa3d7

Please sign in to comment.