Skip to content

Commit

Permalink
Merge branch 'main' into 20-prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
john1xi committed Jun 18, 2024
2 parents 4dbcf1b + 9656ecf commit 7d8f9fb
Show file tree
Hide file tree
Showing 8 changed files with 76 additions and 13 deletions.
Binary file added public/images/football.jpeg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
8 changes: 4 additions & 4 deletions src/components/Footer.astro
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
---
import IconTwitter from "../assets/icons/IconTwitter.astro";
import IconYoutube from "../assets/icons/IconYoutube.astro";
import IconInstagram from "../assets/icons/IconInstagram.astro";
import HashtagWhyULoveFootball from "./HashtagWhyULoveFootball.astro";
import IconTwitter from "@icons/IconTwitter.astro";
import IconYoutube from "@icons/IconYoutube.astro";
import IconInstagram from "@icons/IconInstagram.astro";
import HashtagWhyULoveFootball from "@components/HashtagWhyULoveFootball.astro";
---

<footer class="bg-black text-white">
Expand Down
2 changes: 1 addition & 1 deletion src/components/NavigationBar.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import HashtagWhyULoveFootball from "./HashtagWhyULoveFootball.astro";
import HashtagWhyULoveFootball from "@components/HashtagWhyULoveFootball.astro";
---

<nav class="bg-transparent">
Expand Down
2 changes: 1 addition & 1 deletion src/components/PlayVideoButton.astro
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
import IconPlayVideo from "../assets/icons/IconPlayVideo.astro";
import IconPlayVideo from "@icons/IconPlayVideo.astro";
---

<button
Expand Down
41 changes: 41 additions & 0 deletions src/components/Section.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
import PrimaryLink from "./PrimaryLink.astro";
interface Props {
backgroundColor: "blue" | "green";
backgroundImage?: string;
eyebrow?: string;
heading?: string;
links?: {
href: string;
text: string;
}[];
}
const { backgroundColor, backgroundImage, eyebrow, heading, links } =
Astro.props;
---

<section
class={backgroundImage
? `bg-cover p-6 sm:p-12 h-full`
: `bg-${backgroundColor} p-6 sm:p-12`}
style=`background-image: url('${backgroundImage}')`
>
<div
class={`container flex flex-col gap-6 sm:gap-12 items-center justify-center mx-auto ${backgroundImage ? "text-light-lilac" : backgroundColor === "green" ? "text-blue" : "text-green"}`}
>
<div class="uppercase font-bold text-sm tracking-[3px]">{eyebrow}</div>
<div class="text-3xl sm:text-5xl text-center">{heading}</div>
<slot />
{
links && (
<div class="flex gap-6">
{links?.map((link) => (
<PrimaryLink href={link.href} text={link.text} />
))}
</div>
)
}
</div>
</section>
18 changes: 15 additions & 3 deletions src/layouts/Layout.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
---
import Footer from "../components/Footer.astro";
import NavigationBar from "../components/NavigationBar.astro";
import Footer from "@components/Footer.astro";
import NavigationBar from "@components/NavigationBar.astro";
import Section from "@components/Section.astro";
interface Props {
title: string;
Expand All @@ -22,7 +23,18 @@ const { title } = Astro.props;
<body>
<main>
<NavigationBar />

<Section
backgroundColor="green"
backgroundImage="../images/football.jpeg"
eyebrow="Our goal"
heading="Our goal is to donate 10 million balls to children around the world."
links={[
{ href: "https://example.com", text: "Link" },
{ href: "https://example.com", text: "Link" },
]}
>
Slot content
</Section>
<slot />
<Footer />
</main>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/index.astro
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
import Layout from "../layouts/Layout.astro";
import "../styles/global.css";
import Layout from "@layouts/Layout.astro";
import "@styles/global.css";
---

<Layout title="Welcome to Whyuluvfootball" />
14 changes: 12 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,13 @@
{
"extends": "astro/tsconfigs/strict"
}
"extends": "astro/tsconfigs/strict",
"compilerOptions": {
"baseUrl": ".",
"paths": {
"@icons/*": ["src/assets/icons/*"],
"@components/*": ["src/components/*"],
"@layouts/*": ["src/layouts/*"],
"@pages/*": ["src/pages/*"],
"@styles/*": ["src/styles/*"]
}
}
}

0 comments on commit 7d8f9fb

Please sign in to comment.