Skip to content

Commit

Permalink
Merge pull request #9 from JVPH/WEB-10
Browse files Browse the repository at this point in the history
chore: Hero text for the hero section (WEB-10)
  • Loading branch information
TheDThompsonDev authored Mar 8, 2024
2 parents cc81d63 + e315f54 commit a177315
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 16 deletions.
7 changes: 7 additions & 0 deletions src/app/components/heroSection/heroSection.module.css
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,10 @@
align-items: center;
justify-content: center;
}

.intro {
font-size: 100px;
font-family: "Raleway", sans-serif;
font-weight: 900;
color: #3c3db9;
}
21 changes: 21 additions & 0 deletions src/app/components/heroSection/heroSection.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from "react"; // Import React
import { render, screen } from "@testing-library/react";
import HeroSection from "./heroSection";

describe("HeroSection component", () => {
const labelMap = {
lblHero: "You don't have to code alone.",
};
test("renders the component", () => {
render(<HeroSection label={labelMap.lblHero} />);
const heroElement = screen.getByTestId("hero");
expect(heroElement).toBeInTheDocument();
});

test("renders the correct text", () => {
render(<HeroSection label={labelMap.lblHero} />);

const heroElement = screen.getByTestId("hero");
expect(heroElement).toHaveTextContent(labelMap.lblHero);
});
});
18 changes: 3 additions & 15 deletions src/app/components/heroSection/heroSection.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,10 @@
import React from "react";
import styles from "./heroSection.module.css";

interface HeroSection {
label: {
lblHome: string;
lblCommunity: string;
lblContact: string;
lblMeetup: string;
lblBanner: string;
lblWorkshops: string;
lblSupport: string;
lblCohorts: string;
};
}

export default function HeroSection({ label }: HeroSection) {
export default function HeroSection({ label }: { label: string }) {
return (
<div className={styles.heroSection}>
<div className={styles.heroSection} data-testid="hero">
<p className={styles.intro}>{label}</p>
<div className={styles.videoPlaceholder}>Video playing here</div>
</div>
);
Expand Down
3 changes: 2 additions & 1 deletion src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ export default function Home() {
lblCommunity: "Community Impact",
lblContact: "Contact Us",
lblMeetup: "Meetups",
lblHero: "You don't have to code alone.",
lblBanner: "This website is made BY the community FOR the community",
lblWorkshopsTitle: "Technical Workshops",
lblSupportTitle: "Community Support",
Expand All @@ -25,7 +26,7 @@ export default function Home() {
return (
<main className={styles.main}>
<Navbar label={labelMap} />
<HeroSection label={labelMap} />
<HeroSection label={labelMap.lblHero} />
<BannerSection label={labelMap} />
<CardsSection label={labelMap} />
</main>
Expand Down

0 comments on commit a177315

Please sign in to comment.