Skip to content

Commit 400264e

Browse files
committed
Refactor HomepageFeatures component: improve feature descriptions and enhance layout styling
1 parent e756455 commit 400264e

File tree

1 file changed

+26
-39
lines changed
  • frontend/src/components/HomepageFeatures

1 file changed

+26
-39
lines changed

frontend/src/components/HomepageFeatures/index.tsx

Lines changed: 26 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ const FeatureList: FeatureItem[] = [
2121
<>
2222
Got an old AMX lying about? Load it up on the open.mp server straight
2323
out of the box and join your friends playing on the SA:MP client. Then
24-
when you want to enhance your code try our...
24+
when you want to enhance your code look in our docs.
2525
</>
2626
),
2727
link: "/docs",
@@ -34,7 +34,7 @@ const FeatureList: FeatureItem[] = [
3434
<>
3535
We've stuck with pawn, but with a new compiler engineered to make your
3636
code more robust, and more functions to manipulate the server and
37-
client. If that's still not enough there's an...
37+
client.
3838
</>
3939
),
4040
link: "https://github.com/openmultiplayer/omp-stdlib/#openmp-includes",
@@ -47,7 +47,7 @@ const FeatureList: FeatureItem[] = [
4747
<>
4848
The server is fully open source, and we welcome all contributions big or
4949
small. Help write the next version, or just post about any problems you
50-
find; despite our attempts to have...
50+
find, despite our attempts to have perfect code, bugs happen and your feedback is valuable.
5151
</>
5252
),
5353
link: "https://github.com/openmultiplayer",
@@ -60,65 +60,52 @@ const FeatureList: FeatureItem[] = [
6060
<>
6161
Get access to all the server features available in pawn, plus the
6262
universe of C++ libraries and frameworks. Once you've mastered this why
63-
not help improve the server via our...
63+
not help improve the server via our open contribution process on GitHub.
6464
</>
6565
),
6666
link: "https://github.com/openmultiplayer/open.mp-sdk",
6767
linkText: "Check out SDK repository",
6868
},
6969
];
7070

71-
function Feature({ title, Img, description, link, linkText }: FeatureItem) {
71+
const Feature = ({ title, Img, description, link, linkText }: FeatureItem) => {
7272
return (
73-
<div
74-
style={{
75-
display: "flex",
76-
flexDirection: "column",
77-
alignItems: "center",
78-
maxWidth: 500,
79-
flexGrow: 1,
80-
}}
81-
>
82-
<div className="text--center">
73+
<div className={styles.featureItem}>
74+
<div className={styles.featureImageContainer}>
8375
<Image
84-
className={styles.featureSvg}
76+
className={styles.featureImage}
8577
sources={{ light: Img, dark: Img }}
78+
alt={`${title} illustration`}
8679
/>
8780
</div>
88-
<div className="text--center padding-horiz--md">
81+
<div className={styles.featureContent}>
8982
<Heading as="h3">{title}</Heading>
9083
<p>{description}</p>
9184
</div>
92-
<div style={{ display: "flex", flexDirection: "column", flex: 1 }} />
93-
<Link
94-
style={{ alignSelf: "center" }}
95-
className={clsx("button button--primary button--md", styles.button)}
96-
to={link}
97-
>
98-
{linkText}
99-
</Link>
85+
<div className={styles.featureFooter}>
86+
<Link
87+
className={clsx("button button--primary button--md", styles.button)}
88+
to={link}
89+
>
90+
{linkText}
91+
</Link>
92+
</div>
10093
</div>
10194
);
102-
}
95+
};
10396

104-
export default function HomepageFeatures(): ReactNode {
97+
const HomepageFeatures = (): JSX.Element => {
10598
return (
106-
<section className={styles.features}>
99+
<section className={styles.featuresSection}>
107100
<div className="container">
108-
<div className="row" style={{ justifyContent: "space-around" }}>
109-
{FeatureList.filter((_, index) => index < 2).map((props, idx) => (
110-
<Feature key={idx} {...props} />
111-
))}
112-
</div>
113-
<div
114-
className="row margin-top--lg"
115-
style={{ justifyContent: "space-around" }}
116-
>
117-
{FeatureList.filter((_, index) => index >= 2).map((props, idx) => (
101+
<div className={styles.featuresRow}>
102+
{FeatureList.map((props, idx) => (
118103
<Feature key={idx} {...props} />
119104
))}
120105
</div>
121106
</div>
122107
</section>
123108
);
124-
}
109+
};
110+
111+
export default HomepageFeatures;

0 commit comments

Comments
 (0)