Skip to content

Commit

Permalink
Fix Linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
ReehalS committed Nov 17, 2024
1 parent f697ec1 commit 4b66882
Show file tree
Hide file tree
Showing 14 changed files with 1,129 additions and 101 deletions.
2 changes: 1 addition & 1 deletion app/(api)/_actions/placeholder.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// empty file
// empty file
2 changes: 1 addition & 1 deletion app/(api)/_data/placeholder.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{}
{}
2 changes: 1 addition & 1 deletion app/(api)/_utils/placeholder.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// empty file
// empty file
2 changes: 1 addition & 1 deletion app/(api)/api/placeholder.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// empty file
// empty file
10 changes: 3 additions & 7 deletions app/(pages)/(about-us)/about-us/page.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,3 @@
export default function AboutUs(){
return(
<div>
Halo this is the about us page!
</div>
)
}
export default function AboutUs() {
return <div>Halo this is the about us page!</div>;
}
70 changes: 37 additions & 33 deletions app/(pages)/_components/Navbar/Navbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -28,12 +28,17 @@ export default function Navbar() {
const sectionEnd = offsetTop + offsetHeight;

// Check if scroll position is within this section's range
if (scrollPosition >= sectionStart - 100 && scrollPosition < sectionEnd - 100) {
if (
scrollPosition >= sectionStart - 100 &&
scrollPosition < sectionEnd - 100
) {
newActiveSection = section;
}

// Calculate distance to section if it's not the active section
const distance = Math.abs(scrollPosition - (sectionStart + sectionEnd) / 2);
const distance = Math.abs(
scrollPosition - (sectionStart + sectionEnd) / 2
);
if (distance < closestDistance) {
closestDistance = distance;
closestSection = section;
Expand Down Expand Up @@ -61,38 +66,37 @@ export default function Navbar() {

return (
<div className={styles.container}>
<div className={`${styles.content} ${isScrolled ? styles.scrolled : ''}`}>
<div className={styles.hdIcon}>
<Image src={WhiteLogo} alt="White HackDavis Logo" />
</div>
<div className={styles.navLinks}>
<p
onClick={() => scrollToSection('about')}
className={`${styles.navLink} ${
activeSection === 'about' ? styles.active : ''
}`}
>
ABOUT
</p>
<p
onClick={() => scrollToSection('faq')}
className={`${styles.navLink} ${
activeSection === 'faq' ? styles.active : ''
}`}
>
FAQ
</p>
<p
onClick={() => scrollToSection('sponsors')}
className={`${styles.navLink} ${
activeSection === 'sponsors' ? styles.active : ''
}`}
>
SPONSORS
</p>
</div>
<div className={`${styles.content} ${isScrolled ? styles.scrolled : ''}`}>
<div className={styles.hdIcon}>
<Image src={WhiteLogo} alt="White HackDavis Logo" />
</div>
<div className={styles.navLinks}>
<p
onClick={() => scrollToSection('about')}
className={`${styles.navLink} ${
activeSection === 'about' ? styles.active : ''
}`}
>
ABOUT
</p>
<p
onClick={() => scrollToSection('faq')}
className={`${styles.navLink} ${
activeSection === 'faq' ? styles.active : ''
}`}
>
FAQ
</p>
<p
onClick={() => scrollToSection('sponsors')}
className={`${styles.navLink} ${
activeSection === 'sponsors' ? styles.active : ''
}`}
>
SPONSORS
</p>
</div>
</div>
</div>

);
}
2 changes: 1 addition & 1 deletion app/(pages)/_contexts/placeholder.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// empty file
// empty file
2 changes: 1 addition & 1 deletion app/(pages)/_data/placeholder.tsx
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// empty file
// empty file
2 changes: 1 addition & 1 deletion app/(pages)/_globals/fonts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@ const fonts = [inter, montserrat];

const font_variables = fonts.map((font) => font.variable);
const font_string = font_variables.join(' ');
export default font_string;
export default font_string;
2 changes: 1 addition & 1 deletion app/(pages)/_hooks/empty.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
// empty file
// empty file
12 changes: 5 additions & 7 deletions app/(pages)/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import type { Metadata } from "next";
import type { Metadata } from 'next';
import '@globals/styles/globals.scss';
import metadataJSON from '@app/(pages)/_globals/metadata.json';
import fonts from "./_globals/fonts";
import Navbar from "@app/(pages)/_components/Navbar/Navbar";
import Footer from "@app/(pages)/_components/Footer/Footer";
import fonts from './_globals/fonts';
import Navbar from '@app/(pages)/_components/Navbar/Navbar';
import Footer from '@app/(pages)/_components/Footer/Footer';

export const metadata: Metadata = metadataJSON;

Expand All @@ -14,9 +14,7 @@ export default function RootLayout({
}>) {
return (
<html lang="en">
<body
className={`${fonts} antialiased`}
>
<body className={`${fonts} antialiased`}>
<Navbar />
{children}
<Footer />
Expand Down
15 changes: 12 additions & 3 deletions app/(pages)/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,24 @@ export default function Home() {
</p>

{/* Sections for Testing */}
<div id="about" className="h-[800px] w-full flex items-center justify-center bg-gray-100">
<div
id="about"
className="h-[800px] w-full flex items-center justify-center bg-gray-100"
>
<h2 className="text-3xl font-bold">About Section</h2>
</div>

<div id="faq" className="h-[800px] w-full flex items-center justify-center bg-gray-200">
<div
id="faq"
className="h-[800px] w-full flex items-center justify-center bg-gray-200"
>
<h2 className="text-3xl font-bold">FAQ Section</h2>
</div>

<div id="sponsors" className="h-[800px] w-full flex items-center justify-center bg-gray-300">
<div
id="sponsors"
className="h-[800px] w-full flex items-center justify-center bg-gray-300"
>
<h2 className="text-3xl font-bold">Sponsors Section</h2>
</div>
</div>
Expand Down
Loading

0 comments on commit 4b66882

Please sign in to comment.