Skip to content

Commit fc009a6

Browse files
authored
fix/categories card section and navigation fixed (#58)
1 parent 1090479 commit fc009a6

File tree

7 files changed

+81
-15
lines changed

7 files changed

+81
-15
lines changed

public/computer.jpg

150 KB
Loading

public/treatment.jpg

432 KB
Loading

src/app/components/HeroSection/HeroSection.tsx

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,16 @@ type HeroSectionProps = {
99

1010
const HeroSection = ({ selectedLang }: HeroSectionProps) => {
1111
return (
12-
<section className="bg-gradient-to-b from-blue-100 to-white py-16">
12+
<section
13+
id="home"
14+
className="bg-gradient-to-b from-blue-100 to-white py-16"
15+
>
1316
<div className="container mx-auto px-4 lg:px-16 flex flex-col-reverse lg:flex-row items-center gap-8">
1417
<div className="text-center lg:text-left flex-1 lg:pr-8">
1518
<h1
1619
className="text-3xl lg:text-5xl font-bold mb-6 leading-snug"
17-
style={{ color: "#484848" }}>
20+
style={{ color: "#484848" }}
21+
>
1822
{translations[selectedLang].title}
1923
</h1>
2024
<p className="text-lg mb-6" style={{ color: "#555555" }}>
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
import Image from "next/image";
2+
import Link from "next/link";
3+
import React from "react";
4+
import { ArrowTopRightOnSquareIcon } from "@heroicons/react/24/solid";
5+
6+
function InfoSection() {
7+
return (
8+
<section className="relative mx-auto py-1 px-[32px] lg:px-0 lg:py-4 gap-[10px] md:gap-0 bg-white md:mt-[50px]">
9+
<h2 className="mx-auto font-bold text-[32px] leading-[41.66px] text-[#484848] font-[DM Sans] text-center md:text-[32px] md:leading-[48px] md:text-[#484848]">
10+
What is Arthritis.lk?{" "}
11+
</h2>
12+
<div className="container md:pl-[67px] md:pr-[67px] mx-auto flex flex-col md:flex-row items-center gap-[67px] justify-between md:mt-[75px] md:mb-[130px] ">
13+
{/* Text container */}
14+
<div className="text flex flex-col gap-4 w-full md:w-3/5 min-h-[240px] order-1 md:order-2">
15+
<p className="text-center font-[DM Sans] font-normal text-[24px] leading-[32dpx] text-[#484848] md:text-left md:text-[24px] md:leading-[32px] md:text-[#9E9E9E]">
16+
Arthritis.lk is dedicated to educating and supporting individuals
17+
living with rheumatoid arthritis and other rheumatic conditions.
18+
Developed in collaboration with healthcare professionals, our
19+
platform provides reliable medical information, self-care tips, and
20+
the latest treatment options to help patients better manage their
21+
condition. Whether you're newly diagnosed or looking for ways to
22+
improve your quality of life, Arthritis.lk is here to guide you with
23+
expert insights and practical advice.
24+
</p>
25+
<Link
26+
href="/about"
27+
className="text-center font-[DM Sans] font-medium text-[22px] leading-[32dpx] text-[#484848] md:text-left md:text-[24px] md:leading-[32px] md:text-[#484848] hover:text-blue-500 flex items-center"
28+
>
29+
Learn More
30+
<ArrowTopRightOnSquareIcon width={24} className="ml-2" />{" "}
31+
</Link>
32+
</div>
33+
34+
{/* Image */}
35+
<div className="btns flex flex-col gap-6 order-2 md:order-1 md:gap-6">
36+
<Image
37+
src="/treatment.jpg"
38+
alt="Person looking at a computer"
39+
width={550}
40+
height={400}
41+
className="w-full lg:w-full lg:h-[320px] rounded-lg shadow-md object-cover"
42+
/>
43+
</div>
44+
</div>
45+
</section>
46+
);
47+
}
48+
49+
export default InfoSection;

src/app/components/MainCategorySection.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ export default async function MainCategorySection() {
1515
const categories = response.data;
1616

1717
return (
18-
<section className=" container bg-white py-12 mx-auto">
18+
<section id="categories" className="container bg-white py-12 mx-auto">
1919
<h2 className="text-[#484848] font-bold text-4xl text-center">
2020
Main Categories
2121
</h2>
@@ -27,7 +27,8 @@ export default async function MainCategorySection() {
2727
<Link key={category.id} href={`/${category.slug}`}>
2828
<div
2929
key={category.id}
30-
className="p-8 cursor-pointer border-2 border-transparent hover:border-[#DBEBFB] rounded-xl transition duration-500">
30+
className="p-8 cursor-pointer border-2 border-transparent hover:border-[#DBEBFB] rounded-xl transition duration-300 shadow-md"
31+
>
3132
<div className="relative max-w-[274px] max-h-[103px] mx-auto aspect-[274/103] mb-4">
3233
<Image
3334
src={

src/app/components/Navbar/Navbar.tsx

Lines changed: 20 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,8 @@ export default function Navbar({ data }: { data: NavbarType }) {
6161
<div className="container mx-auto px-4 flex items-center justify-between py-4">
6262
<Link
6363
href="/"
64-
className="text-2xl font-bold text-[#2F7CC4] flex-shrink-0">
64+
className="text-2xl font-bold text-[#2F7CC4] flex-shrink-0"
65+
>
6566
Rheuma<span className="text-gray-800">Connect</span>
6667
</Link>
6768

@@ -72,15 +73,17 @@ export default function Navbar({ data }: { data: NavbarType }) {
7273
href={linkUrl || "#"}
7374
className={`hover:text-blue-600 text-gray-800 font-medium ${
7475
pathname === linkUrl ? "text-blue-600" : ""
75-
}`}>
76+
}`}
77+
>
7678
{linkText}
7779
</Link>
7880
))}
7981

8082
<Link href={navbarButton?.buttonLink || "#"}>
8183
<button
8284
className="bg-[#2F7CC4] text-white rounded-[10px] text-[14px] font-medium hover:bg-[#276ca3] transition flex items-center justify-center"
83-
style={{ width: "98px", height: "38px", lineHeight: "18px" }}>
85+
style={{ width: "98px", height: "38px", lineHeight: "18px" }}
86+
>
8487
{navbarButton?.buttonText}
8588
</button>
8689
</Link>
@@ -126,15 +129,17 @@ export default function Navbar({ data }: { data: NavbarType }) {
126129
<button
127130
onClick={toggleMenu}
128131
className="md:hidden text-gray-800 focus:outline-none"
129-
aria-label="Toggle Menu">
132+
aria-label="Toggle Menu"
133+
>
130134
{isOpen ? (
131135
<svg
132136
className="w-6 h-6"
133137
fill="none"
134138
stroke="currentColor"
135139
strokeWidth="2"
136140
viewBox="0 0 24 24"
137-
xmlns="http://www.w3.org/2000/svg">
141+
xmlns="http://www.w3.org/2000/svg"
142+
>
138143
<path
139144
strokeLinecap="round"
140145
strokeLinejoin="round"
@@ -148,7 +153,8 @@ export default function Navbar({ data }: { data: NavbarType }) {
148153
stroke="currentColor"
149154
strokeWidth="2"
150155
viewBox="0 0 24 24"
151-
xmlns="http://www.w3.org/2000/svg">
156+
xmlns="http://www.w3.org/2000/svg"
157+
>
152158
<path
153159
strokeLinecap="round"
154160
strokeLinejoin="round"
@@ -162,10 +168,12 @@ export default function Navbar({ data }: { data: NavbarType }) {
162168
{isOpen && (
163169
<div
164170
className="fixed inset-0 bg-black bg-opacity-50 z-40 md:hidden"
165-
onClick={closeMenu}>
171+
onClick={closeMenu}
172+
>
166173
<div
167174
className="absolute top-0 left-0 w-64 bg-white shadow-lg h-full rounded-r-md"
168-
onClick={(e) => e.stopPropagation()}>
175+
onClick={(e) => e.stopPropagation()}
176+
>
169177
<div className="p-6 space-y-4">
170178
{link.map(({ linkText, linkUrl }) => (
171179
<Link
@@ -176,13 +184,15 @@ export default function Navbar({ data }: { data: NavbarType }) {
176184
pathname === linkUrl
177185
? "bg-gray-200 font-bold text-blue-600"
178186
: ""
179-
}`}>
187+
}`}
188+
>
180189
{linkText}
181190
</Link>
182191
))}
183192
<button
184193
className="px-6 py-2 bg-[#2F7CC4] text-white rounded-full text-sm hover:bg-[#276ca3] transition"
185-
style={{ width: "98px", height: "38px" }}>
194+
style={{ width: "98px", height: "38px" }}
195+
>
186196
Explore
187197
</button>
188198
<div className="mt-4">

src/app/page.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ import { Translations } from "@/app/types";
44
import ContactCard from "./components/ContactCard";
55
import MainCategorySection from "./components/MainCategorySection";
66
import HeroSection from "./components/HeroSection/HeroSection";
7+
import InfoSection from "./components/InfoSection/InfoSection";
78
const translationsData: Translations = translations;
89

910
// fetch data from API
@@ -13,9 +14,10 @@ export default async function Home() {
1314
<div>
1415
<HeroSection selectedLang="en" />
1516
{/* <ContactCard /> */}
17+
<InfoSection />
1618
<MainCategorySection />
1719
<ContactCard />
18-
<AZCards azCards={translationsData["en"]["az-cards"]} />
20+
{/* <AZCards azCards={translationsData["en"]["az-cards"]} /> */}
1921
</div>
2022
);
2123
}

0 commit comments

Comments
 (0)