Skip to content

Commit 28b2d54

Browse files
authored
Merge pull request #53 from Lekipising/feat-add-pages
Add pages, convert files to jsx and create global routes file [Fixes #52]
2 parents 58a4cc5 + df2f326 commit 28b2d54

11 files changed

Lines changed: 118 additions & 10 deletions

File tree

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,44 +1,55 @@
11
import Link from "next/link";
22
import React from "react";
3+
import {
4+
ABOUT,
5+
CONTACT,
6+
EVENTS,
7+
FORUM,
8+
HOME,
9+
MEMBERS,
10+
NEWS,
11+
} from "../util/routeConstants";
312

413
const Navbar = () => {
514
return (
615
<>
716
<header className="px-[181px] w-full shadow-md bg-white">
817
<nav className="nav py-4 flex justify-between items-center">
918
<div>
10-
<Link href={"/"}>
11-
<div className="bg-gray-400 w-[137px] h-[61px]"></div>
19+
<Link href={HOME}>
20+
<a>
21+
<div className="bg-gray-400 w-[137px] h-[61px]"></div>
22+
</a>
1223
</Link>
1324
</div>
1425
<div className="">
1526
<ul className="flex items-center space-x-[37px]">
16-
<Link href={"/#about"}>
27+
<Link href={ABOUT}>
1728
<a>
1829
<li>About us</li>
1930
</a>
2031
</Link>
21-
<Link href={"/#members"}>
32+
<Link href={MEMBERS}>
2233
<a>
2334
<li>Members</li>
2435
</a>
2536
</Link>
26-
<Link href={"/#events"}>
37+
<Link href={EVENTS}>
2738
<a>
2839
<li>Events</li>
2940
</a>
3041
</Link>
31-
<Link href={"/#news"}>
42+
<Link href={NEWS}>
3243
<a>
3344
<li>News</li>
3445
</a>
3546
</Link>
36-
<Link href={"/#forum"}>
47+
<Link href={FORUM}>
3748
<a>
3849
<li>Forum</li>
3950
</a>
4051
</Link>
41-
<Link href={"/#contact"}>
52+
<Link href={CONTACT}>
4253
<a>
4354
<li>Contact</li>
4455
</a>

pages/_app.js renamed to pages/_app.jsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
1-
import Navbar from "../components/Navbar";
1+
import Navbar from "../components/Navbar.jsx";
22
import "../styles/globals.css";
33

44
function MyApp({ Component, pageProps }) {
55
return (
66
<>
7-
<Navbar/>
7+
<Navbar />
88
<Component {...pageProps} />
99
</>
1010
);
File renamed without changes.

pages/about.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import Head from "next/head";
2+
import React from "react";
3+
4+
export default function AboutPage() {
5+
return (
6+
<>
7+
<Head>
8+
<title>React Devs Kenya - About</title>
9+
</Head>
10+
<main className="flex justify-center items-center min-h-screen">
11+
<h1 className="text-white">About page will be here</h1>
12+
</main>
13+
</>
14+
);
15+
}

pages/contact.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
import Head from "next/head";
3+
4+
export default function ContactPage() {
5+
return (
6+
<>
7+
<Head>
8+
<title>React Devs Kenya - Contact</title>
9+
</Head>
10+
<main className="flex justify-center items-center min-h-screen">
11+
<h1 className="text-white">Contact page will be here</h1>
12+
</main>
13+
</>
14+
);
15+
}

pages/events.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
import Head from "next/head";
3+
4+
export default function EventsPage() {
5+
return (
6+
<>
7+
<Head>
8+
<title>React Devs Kenya - Events</title>
9+
</Head>
10+
<main className="flex justify-center items-center min-h-screen">
11+
<h1 className="text-white">Events page will be here</h1>
12+
</main>
13+
</>
14+
);
15+
}

pages/forum.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
import Head from "next/head";
3+
4+
export default function ForumPage() {
5+
return (
6+
<>
7+
<Head>
8+
<title>React Devs Kenya - Forum</title>
9+
</Head>
10+
<main className="flex justify-center items-center min-h-screen">
11+
<h1 className="text-white">Forum page will be here</h1>
12+
</main>
13+
</>
14+
);
15+
}
File renamed without changes.

pages/members.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
import Head from "next/head";
3+
4+
export default function MembersPage() {
5+
return (
6+
<>
7+
<Head>
8+
<title>React Devs Kenya - About</title>
9+
</Head>
10+
<main className="flex justify-center items-center min-h-screen">
11+
<h1 className="text-white">Members page will be here</h1>
12+
</main>
13+
</>
14+
);
15+
}

pages/news.jsx

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import React from "react";
2+
import Head from "next/head";
3+
4+
export default function NewsPage() {
5+
return (
6+
<>
7+
<Head>
8+
<title>React Devs Kenya - News</title>
9+
</Head>
10+
<main className="flex justify-center items-center min-h-screen">
11+
<h1 className="text-white">News page will be here</h1>
12+
</main>
13+
</>
14+
);
15+
}

0 commit comments

Comments
 (0)