Skip to content

Commit

Permalink
chore: change function declarations and move components outside the m…
Browse files Browse the repository at this point in the history
…ain component
  • Loading branch information
jedryczkatymon committed Dec 14, 2024
1 parent 2e220bc commit 2aae8db
Showing 1 changed file with 34 additions and 60 deletions.
94 changes: 34 additions & 60 deletions src/components/Footer.tsx
Original file line number Diff line number Diff line change
@@ -1,40 +1,34 @@
import Image from "next/image";
import Link from "next/link";

const Footer = () => {
const List = ({
text,
children,
}: {
text: string;
children: React.ReactNode;
}) => {
return (
<div>
<h2 className="mb-5 text-base font-medium">{text}</h2>
<ul>{children}</ul>
</div>
);
};
const ListItem = ({
url,
target,
text,
}: {
url: string;
target: string;
text: string;
}) => {
return (
<>
<li className="mb-2 text-sm">
<Link href={url} target={target}>
{text}
</Link>
</li>
</>
);
};
function List({ text, children }: { text: string; children: React.ReactNode }) {
return (
<div>
<h2 className="mb-5 text-base font-medium">{text}</h2>
<ul>{children}</ul>
</div>
);
}

function ListItem({
url,
target = "_blank",
text,
}: {
url: string;
target?: string;
text: string;
}) {
return (
<li className="mb-2 text-sm">
<Link href={url} target={target}>
{text}
</Link>
</li>
);
}

function Footer() {
return (
<>
<div className="grid place-items-center md:mb-16 md:mt-24">
Expand All @@ -47,33 +41,13 @@ const Footer = () => {
/>
<div className="grid grid-cols-2 gap-x-5 sm:grid-cols-4 sm:justify-around md:flex md:w-11/12 md:flex-row md:justify-around">
<List text="KONTAKT">
<ListItem
url="mailto:[email protected]"
text="Adres e-mail"
target="_blank"
/>
<ListItem
url="mailto:[email protected]"
text="Adres e-mail"
target="_blank"
/>
<ListItem url="mailto:[email protected]" text="Adres e-mail" />
<ListItem url="mailto:[email protected]" text="Adres e-mail" />
</List>
<List text="SOCIAL MEDIA">
<ListItem
url="https://instagram.com/"
text="Instagram"
target="_blank"
/>
<ListItem
url="https://facebook.com/"
text="Facebook"
target="_blank"
/>
<ListItem
url="https://tiktok.com/"
text="Instagram"
target="_blank"
/>
<ListItem url="https://instagram.com/" text="Instagram" />
<ListItem url="https://facebook.com/" text="Facebook" />
<ListItem url="https://tiktok.com/" text="Instagram" />
</List>
<Image
src="/Juwe2025.png"
Expand Down Expand Up @@ -105,6 +79,6 @@ const Footer = () => {
</div>
</>
);
};
}

export { Footer };

0 comments on commit 2aae8db

Please sign in to comment.