Skip to content

Commit

Permalink
Merge pull request #121 from HackDavis/fix/SamCommentsPart2
Browse files Browse the repository at this point in the history
feat: removed some navbar elements, added button to go to teams descr…
  • Loading branch information
Sauvikesh authored May 7, 2024
2 parents afa91f5 + e007f6d commit 714cad6
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import styles from './Form.module.scss';
// import { CiCalendar } from 'react-icons/ci';
import WordCycle from './_components/WordCycle';
import Link from 'next/link';
import { usePathname } from 'next/navigation'; // Import useRouter
// import Image from 'next/image';
// import intelLogoCoHost from 'public/index/Sponsors/intel.png';

Expand All @@ -20,7 +21,7 @@ const FormLinks: { [key: string]: FormLink } = {
url: 'https://form.typeform.com/to/MY8EI47D',
},
Mentor: { title: 'Mentor', url: 'https://form.typeform.com/to/cvy9LlyR' },
Sponsor: { title: 'Sponsor', url: 'mailto:team@hackdavis.io' },
Teams: { title: 'Team Descriptions', url: 'https://hackdavis.io/#teams' },
Calendar: {
title: 'HackDavis 2024 Calendar',
url: 'https://drive.google.com/file/d/1AGBLnS55qNEuGNXh9VLSdx2PaHsGVgE7/view?usp=drive_link',
Expand All @@ -36,6 +37,15 @@ const FormLinks: { [key: string]: FormLink } = {
};

export default function Form() {
/*
* takes the current url and assigns it to the teams section of the page
* enables the "Team Descriptions" button to scroll to teams on click, similar to navbar
*/
const pathname = usePathname();
const teamsUrl =
pathname.substring(0, pathname.lastIndexOf('/') + 1) + '#teams';
FormLinks.Teams.url = teamsUrl;

return (
<div className={styles.background}>
<div className={styles.container}>
Expand Down Expand Up @@ -87,8 +97,8 @@ export default function Form() {
>
<p>{FormLinks.Register.title}</p>
</Link>
<a href={FormLinks.Sponsor.url} className={styles.buttons_sponsor}>
<p>{FormLinks.Sponsor.title}</p>
<a href={FormLinks.Teams.url} className={styles.buttons_sponsor}>
<p>{FormLinks.Teams.title}</p>
</a>
</div>
{/* <div className={styles.links}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ export default function Sponsor() {
))}
</div>
<a href="mailto:[email protected]" className={styles.button}>
<span className={styles['button-words']}>Sponsor 2024</span>
<span className={styles['button-words']}>Sponsor 2025</span>
</a>
</div>
<div className={styles.cow_duck}>
Expand Down
6 changes: 3 additions & 3 deletions app/(pages)/_data/navLinks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ interface NavLink {
slug: string;
}
const navLinks: NavLink[] = [
{ name: 'Impact', slug: '/#whatishackdavis' },
// { name: 'Impact', slug: '/#whatishackdavis' },
// { name: 'Prizes', slug: '/#prizes' },
{ name: 'Inclusion', slug: '/#everyone' },
// { name: 'Inclusion', slug: '/#everyone' },
{ name: 'Teams', slug: '/#teams' },
{ name: 'FAQ', slug: '/#faq' },
{ name: 'Sponsors', slug: '/#sponsors' },
// { name: 'Sponsors', slug: '/#sponsors' },
{ name: 'About', slug: '/about-us' },
];

Expand Down

0 comments on commit 714cad6

Please sign in to comment.