diff --git a/js/src/components/ui/footer/Footer.module.css b/js/src/components/ui/footer/Footer.module.css index a18d98dc2..ffd524d95 100644 --- a/js/src/components/ui/footer/Footer.module.css +++ b/js/src/components/ui/footer/Footer.module.css @@ -16,22 +16,36 @@ .footerContents { max-width: 1200px; + min-height: 150px; margin: 0 auto; + padding: var(--mantine-spacing-xs) var(--mantine-spacing-xl); display: grid; - grid-template-columns: 1fr auto 1fr; + grid-template-columns: 1fr 1fr; width: 100%; background-color: var(--mantine-color-dark-6); align-items: center; - @mixin smaller-than $mantine-breakpoint-md { - padding: var(--mantine-spacing-xs) var(--mantine-spacing-xl); + @mixin smaller-than $mantine-breakpoint-sm { + display: flex; + flex-direction: column; + padding: var(--mantine-spacing-lg); + } +} + +.footerRight { + display: flex; + justify-content: flex-end; + gap: calc(var(--spacing) * 20); + + @mixin smaller-than $mantine-breakpoint-sm { + flex-direction: column; + gap: calc(var(--spacing) * 2); } } .footerLeft { display: flex; - align-items: center; - gap: 12px; + flex-direction: column; } .logo { diff --git a/js/src/components/ui/footer/Footer.test.tsx b/js/src/components/ui/footer/Footer.test.tsx new file mode 100644 index 000000000..2b0085f14 --- /dev/null +++ b/js/src/components/ui/footer/Footer.test.tsx @@ -0,0 +1,40 @@ +import { Footer } from "@/components/ui/footer/Footer"; +import { TestUtils, TestUtilTypes } from "@/lib/test"; +import { screen } from "@testing-library/react"; + +describe("Footer rendered successfully", () => { + let renderProviderFn: TestUtilTypes.RenderWithAllProvidersFn | null = null; + beforeEach(() => { + renderProviderFn = TestUtils.getRenderWithAllProvidersFn(); + }); + + it("should render mission text", () => { + renderProviderFn?.(); + const elements = screen.getAllByText( + "LeetCode motivation site for Patina Network", + ); + expect(elements).toHaveLength(2); + for (const element of elements) { + expect(element).toBeInTheDocument(); + expect(element).toBeVisible(); + } + }); + + it("should render links section", () => { + renderProviderFn?.(); + const element = screen.getByTestId("footer-links-section"); + expect(element).toBeInTheDocument(); + expect(element).toBeVisible(); + }); + + it("should have correct github link", () => { + renderProviderFn?.(); + const element = screen.getByLabelText("CodeBloom GitHub"); + expect(element).toBeInTheDocument(); + expect(element).toBeVisible(); + expect(element).toHaveAttribute( + "href", + "https://github.com/tahminator/codebloom", + ); + }); +}); diff --git a/js/src/components/ui/footer/Footer.tsx b/js/src/components/ui/footer/Footer.tsx index a5120f12e..e55398ced 100644 --- a/js/src/components/ui/footer/Footer.tsx +++ b/js/src/components/ui/footer/Footer.tsx @@ -1,9 +1,9 @@ import { GotoAdminPageButton } from "@/components/ui/admin-button/AdminButton"; import styles from "@/components/ui/footer/Footer.module.css"; -import { ActionIcon, Text, Anchor } from "@mantine/core"; +import { Text, Anchor, Flex, Box, Stack } from "@mantine/core"; import { motion, useScroll, useTransform } from "motion/react"; import { ReactNode, useRef } from "react"; -import { FaInstagram, FaLinkedin, FaGithub } from "react-icons/fa"; +import { FaInstagram, FaDiscord, FaGithub } from "react-icons/fa"; import Logo from "/logo.png"; @@ -13,57 +13,95 @@ export function Footer() { target: containerRef, offset: ["start end", "end end"], }); + const missionText = "LeetCode motivation site for Patina Network"; const y = useTransform(scrollYProgress, [0, 1], ["-100%", "0%"]); return ( -