Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: externalize layout paddings #71

Merged
merged 1 commit into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion src/app/[lang]/about/departments/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import DepartmentCard from "@/components/department-card";
import AppLink from "@/components/link";
import PromotionalCard from "@/components/promotional-card";
import { useDictionary } from "@/contexts/dictionary-provider";
import { horizontalPadding, verticalPadding } from "@/lib/styling";
import { CardType, type TeamData } from "@/lib/types";
import { fetchTeamData } from "@/lib/utils";
import { useState, useEffect } from "react";
Expand Down Expand Up @@ -67,7 +68,9 @@ export default function Departments() {
];

return (
<main className="flex flex-col gap-8 sm:gap-12">
<main
className={`flex flex-col gap-8 sm:gap-12 ${horizontalPadding + verticalPadding}`}
>
<div className="flex flex-col gap-4 px-2 md:px-5">
<AppLink arrow="back" title={dict.button.back} href={"/about"} />
<h1 className="font-title text-3xl font-medium">
Expand Down
5 changes: 4 additions & 1 deletion src/app/[lang]/about/team/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ import Avatar from "@/components/avatar";
import { useDictionary } from "@/contexts/dictionary-provider";
import PromotionalCard from "@/components/promotional-card";
import AppLink from "@/components/link";
import { horizontalPadding, verticalPadding } from "@/lib/styling";

export default function Team() {
const [fromDefaultOpen, isFromDefaultOpen] = useState(true);
Expand Down Expand Up @@ -59,7 +60,9 @@ export default function Team() {
};

return (
<main className="space-y-8 sm:space-y-12">
<main
className={`space-y-8 sm:space-y-12 ${horizontalPadding + verticalPadding}`}
>
<div className="flex flex-col gap-4 px-2 md:px-5">
<AppLink arrow="back" title={dict.button.back} href="/about" />
<div className="flex items-center justify-between gap-5 sm:justify-normal">
Expand Down
2 changes: 1 addition & 1 deletion src/app/[lang]/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export default function RootLayout({
>
<DictionaryProvider lang={lang}>
<Navbar />
<div className="h-full px-5 py-5 md:px-7 md:py-12">{children}</div>
<div className="h-full">{children}</div>
<Footer />
</DictionaryProvider>
</body>
Expand Down
7 changes: 6 additions & 1 deletion src/components/footer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,12 @@ const Footer = () => {
<footer className=" flex flex-col place-items-center bg-[#EBEBEB] px-5 pb-16 pt-8 sm:flex-row sm:place-items-end sm:px-7 md:px-20">
<div className="flex w-full max-w-[500px] flex-col place-items-center justify-center space-y-5 sm:w-1/2 sm:max-w-max sm:flex-col-reverse md:place-items-start">
<div className="w-full space-y-6 pb-2.5 sm:mt-[50px] sm:w-80 sm:pb-0">
<Image src="/logo/cesium.svg" alt="CeSIUM Logo Icon" width={32} height={37} />
<Image
src="/logo/cesium.svg"
alt="CeSIUM Logo Icon"
width={32}
height={37}
/>
<p className="text-sm leading-[17px] text-[#94959C]">{dict.cesium}</p>
<div className="justify-left flex h-[30px] space-x-5">
{dict.socials.map((social) => {
Expand Down
2 changes: 2 additions & 0 deletions src/lib/styling.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export const horizontalPadding = "px-5 md:px-7";
export const verticalPadding = "py-5 md:py-12";
4 changes: 4 additions & 0 deletions tailwind.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,10 @@ const config: Config = {
"to-[#ED7950]/20",
"from-[#03A300]/10",
"to-[#82E700]/10",
"px-5",
"py-5",
"md:px-7",
"md:py-12",
],
};
export default config;