Skip to content

Commit 81580d6

Browse files
authored
Merge pull request #3 from CS3219-AY2324S1/FE-landing
Add landing Page (WIP)
2 parents 7c0f7c3 + c7a1689 commit 81580d6

File tree

12 files changed

+793
-82
lines changed

12 files changed

+793
-82
lines changed

frontend/.eslintignore

Lines changed: 0 additions & 9 deletions
This file was deleted.

frontend/.eslintrc.json

Lines changed: 0 additions & 16 deletions
This file was deleted.

frontend/.prettierrc

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
11
{
22
"semi": true,
3-
"trailingComma": "all",
4-
"singleQuote": true,
5-
"printWidth": 120,
3+
"printWidth": 140,
64
"tabWidth": 2,
7-
"endOfLine": "lf"
8-
}
5+
"singleQuote": true,
6+
"bracketSpacing": true,
7+
"useTabs": false,
8+
"arrowParens": "avoid",
9+
"jsxSingleQuote": true,
10+
"trailingComma": "all",
11+
"endOfLine": "auto"
12+
}

frontend/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,20 @@
1919
"daisyui": "^3.7.3",
2020
"eslint": "8.49.0",
2121
"eslint-config-next": "13.4.19",
22+
"firebase": "^10.3.1",
2223
"next": "13.4.19",
2324
"postcss": "8.4.29",
25+
"prettier-plugin-tailwindcss": "^0.5.4",
2426
"react": "18.2.0",
2527
"react-dom": "18.2.0",
28+
"react-icons": "^4.11.0",
2629
"tailwindcss": "3.3.3",
2730
"typescript": "5.2.2"
2831
},
2932
"devDependencies": {
3033
"@typescript-eslint/eslint-plugin": "^5.43.0",
3134
"@typescript-eslint/parser": "^5.43.0",
32-
"eslint-config-prettier": "^8.5.0",
33-
"eslint-plugin-prettier": "^4.2.1",
34-
"prettier": "^2.7.1",
35+
"prettier": "^3.0.3",
3536
"typescript": "5.2.2"
3637
}
3738
}

frontend/prettier.config.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
module.exports = {
2+
plugins: [require('prettier-plugin-tailwindcss')],
3+
}

frontend/public/backdrop.jpg

341 KB
Loading
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import React, { ReactNode } from "react";
2+
3+
type ButtonVariant = "primary";
4+
interface ButtonProps extends React.ButtonHTMLAttributes<HTMLButtonElement> {
5+
className?: string;
6+
isDisabled?: boolean;
7+
isLoading?: boolean;
8+
children?: ReactNode;
9+
variant?: ButtonVariant;
10+
}
11+
12+
const Button = ({
13+
className = "",
14+
isDisabled = false,
15+
children,
16+
...props
17+
}: ButtonProps) => {
18+
return (
19+
<button
20+
className={`btn outline-1 text-white shadow-sm ${className}`}
21+
disabled={isDisabled}
22+
{...props}
23+
>
24+
{children}
25+
</button>
26+
);
27+
};
28+
29+
export default Button;
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { IoPeopleCircleSharp } from "react-icons/io5";
2+
import Button from "../button/Button";
3+
import Link from "next/link";
4+
5+
const Navbar = () => {
6+
return (
7+
<nav>
8+
<div className="flex justify-between bg-neutral p-2 px-12 items-center">
9+
<div className="text-3xl text-white font-bold flex items-center">
10+
<Link href="/">
11+
<IoPeopleCircleSharp className="text-base-100 text-5xl cursor-pointer" />
12+
</Link>
13+
PeerPrep
14+
</div>
15+
<Button
16+
className="btn-accent rounded-full btn-sm px-4"
17+
children={<span>Login</span>}
18+
/>
19+
</div>
20+
</nav>
21+
);
22+
};
23+
24+
export default Navbar;

frontend/src/app/layout.tsx

Lines changed: 33 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,43 @@
1-
import './globals.css';
2-
import type { Metadata } from 'next';
3-
import { Montserrat } from 'next/font/google';
1+
import "./globals.css";
2+
import type { Metadata } from "next";
3+
import { Montserrat } from "next/font/google";
4+
import Navbar from "./components/navbar/Navbar";
5+
import { initializeApp } from "firebase/app";
6+
import { getAnalytics } from "firebase/analytics";
47

58
const montserrat = Montserrat({ subsets: ['latin'] });
69

710
export const metadata: Metadata = {
8-
title: 'Peerprep',
9-
description: 'Practise!',
11+
title: "PeerPrep | Streamlining Technical Interview Preparation",
12+
description: "Practise!",
1013
};
1114

12-
export default function RootLayout({ children }: { children: React.ReactNode }) {
15+
const firebaseConfig = {
16+
apiKey: process.env.NEXT_PUBLIC_FIREBASE_API_KEY,
17+
authDomain: process.env.NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN,
18+
projectId: process.env.NEXT_PUBLIC_FIREBASE_PROJECT_ID,
19+
storageBucket: process.env.NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET,
20+
messagingSenderId: process.env.NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID,
21+
appId: process.env.NEXT_PUBLIC_FIREBASE_APP_ID,
22+
measurementId: process.env.NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID,
23+
};
24+
25+
export default function RootLayout({
26+
children,
27+
}: {
28+
children: React.ReactNode;
29+
}) {
30+
const app = initializeApp(firebaseConfig);
31+
if (typeof window !== "undefined") {
32+
const analytics = getAnalytics(app);
33+
}
34+
1335
return (
1436
<html lang="en" data-theme="myTheme">
15-
<body className={montserrat.className}>{children}</body>
37+
<body className={montserrat.className}>
38+
<Navbar />
39+
{children}
40+
</body>
1641
</html>
1742
);
18-
}
43+
};

frontend/src/app/page.tsx

Lines changed: 26 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,28 @@
1+
import Image from "next/image";
2+
import Button from "./components/button/Button";
3+
14
export default function Home() {
2-
return <main className="flex min-h-screen flex-col items-center justify-between p-24"></main>;
5+
return (
6+
<main>
7+
<Image
8+
src="/backdrop.jpg"
9+
alt="backdrop"
10+
className="-z-10 opacity-50"
11+
layout="fill"
12+
/>
13+
<section className="flex flex-col items-center py-24 lg:py-36 px-24 gap-4 z-20">
14+
<h1 className="text-5xl text-white font-bold text-center m-5 lg:text-7xl">
15+
Streamlining Technical Interview Preparation.
16+
</h1>
17+
<h2 className="text-xl text-center text-white font-medium">
18+
Collaborative mock interviews to boost your confidence and nail your
19+
dream job interviews.
20+
</h2>
21+
<Button
22+
className="btn-accent w-36 m-2"
23+
children={<span>Get Started!</span>}
24+
/>
25+
</section>
26+
</main>
27+
);
328
}

0 commit comments

Comments
 (0)