Skip to content

Commit

Permalink
Error fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
TyHil committed May 4, 2024
1 parent 832d114 commit 7275fd0
Show file tree
Hide file tree
Showing 9 changed files with 13 additions and 31 deletions.
2 changes: 0 additions & 2 deletions src/components/CTA.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import Circles from '@/../public/circles.svg';
import Image from 'next/image';
import Blob from '@/components/Blob';
import Link from 'next/link';

const CTA = () => {
Expand Down
12 changes: 8 additions & 4 deletions src/components/Carousel.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { useCallback, forwardRef } from 'react';
import { useCallback, forwardRef, ForwardedRef, ReactElement } from 'react';

type CarouselProps<T extends any[]> = {
type CarouselProps<T extends unknown[]> = {
data: T;
keyBase: string;
children: (
Expand All @@ -12,7 +12,7 @@ type CarouselProps<T extends any[]> = {
) => JSX.Element;
};

function Carousel<T extends any[]>(
function CarouselInner<T extends unknown[]>(
{ data, keyBase, children }: CarouselProps<T>,
ref: React.Ref<HTMLDivElement>,
) {
Expand Down Expand Up @@ -60,4 +60,8 @@ function Carousel<T extends any[]>(
);
}

export default forwardRef(Carousel);
const Carousel = forwardRef(CarouselInner) as <T extends unknown[]>(
props: CarouselProps<T> & { ref?: ForwardedRef<HTMLDivElement> },
) => ReactElement;

export default Carousel;
2 changes: 1 addition & 1 deletion src/components/Governance.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { useState } from 'react';
import Header from '@/components/Header';
import Footer from '@/components/Footer';
import PeriodLinks from '@/components/PeriodLinks';
import Image, { StaticImageData } from 'next/image';
import Image from 'next/image';
import { PopulatedGoveranceGroup } from '@/lib/period-populator';
import { Person } from '@/data/person-dictionary';

Expand Down
6 changes: 3 additions & 3 deletions src/components/Navbar.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import clsx from 'clsx';
import Image from 'next/image';
import Image, { StaticImageData } from 'next/image';
import Link from 'next/link';
import { Disclosure, Transition, TransitionRootProps } from '@headlessui/react';
import { Fragment, useCallback, useEffect, useRef, useState } from 'react';
Expand All @@ -25,7 +25,7 @@ interface ParentItem extends BaseItem {
children: {
name: string;
link: string;
iconSrc?: any;
iconSrc?: StaticImageData;
description: string;
}[];
}
Expand Down Expand Up @@ -208,7 +208,7 @@ const Navbar = (props: Props) => {
buttonRefs.current[outerIndex]?.focus();
}
}}
onMouseLeave={(e) => {
onMouseLeave={() => {
if (!shouldDisplayDesktopMenu) return;
setTimeout(() => {
const li = buttonRefs.current[outerIndex]?.parentElement;
Expand Down
3 changes: 1 addition & 2 deletions src/components/Projects.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import { createRef, useEffect, useState } from 'react';
import Image, { StaticImageData } from 'next/image';
import Carousel from './Carousel';
import Planner from '@/../public/projects/planner.png';
import API from '@/../public/projects/skedge.png';
import Skedge from '@/../public/projects/skedge.png';
import Jupiter from '@/../public/projects/jupiter.png';
import FilledChevronUp from '@/../public/filled-chevron-up-white.svg';
Expand Down Expand Up @@ -121,7 +120,7 @@ export default function Projects() {
))}
</div>
<div className="pt-6">
<Carousel data={PROJECTS_INFO} keyBase={carouselKeyBase} ref={carouselRef}>
<Carousel<Project[]> data={PROJECTS_INFO} keyBase={carouselKeyBase} ref={carouselRef}>
{(project, index, valueCount, prev, next) => (
<ProjectCard
valueCount={valueCount}
Expand Down
6 changes: 0 additions & 6 deletions src/pages/about/governance/[period].tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,10 @@
import Header from '@/components/Header';
import Footer from '@/components/Footer';
import Head from 'next/head';
import PeriodLinks from '@/components/PeriodLinks';
import Image, { StaticImageData } from 'next/image';
import { useRouter } from 'next/router';

import {
getPopulatedPeriod,
nonCurrentPeriods,
PopulatedGoveranceGroup,
} from '@/lib/period-populator';
import { netIdToPersonMap } from '@/data/person-dictionary';
import { periodToLeadershipMap } from '@/data/period-dictionary';

import Governance from '@/components/Governance';
Expand Down
10 changes: 0 additions & 10 deletions src/pages/about/governance/index.tsx
Original file line number Diff line number Diff line change
@@ -1,19 +1,9 @@
import Header from '@/components/Header';
import Footer from '@/components/Footer';
import Head from 'next/head';
import PeriodLinks from '@/components/PeriodLinks';
import Image, { StaticImageData } from 'next/image';
import { useRouter } from 'next/router';

import { getPopulatedPeriod, currentPeriod, nonCurrentPeriods } from '@/lib/period-populator';
import { netIdToPersonMap } from '@/data/person-dictionary';
import { periodToLeadershipMap } from '@/data/period-dictionary';

import Governance from '@/components/Governance';

import fs from 'fs';
import path from 'path';

const Page = () => {
const period = currentPeriod();
const data = getPopulatedPeriod(period);
Expand Down
1 change: 0 additions & 1 deletion src/pages/contact.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import Header from '@/components/Header';
import Footer from '@/components/Footer';
import Head from 'next/head';
import Image from 'next/image';
import Link from 'next/link';

const linkClasses = 'text-2xl underline decoration-transparent hover:decoration-inherit transition';

Expand Down
2 changes: 0 additions & 2 deletions src/pages/projects/index.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import Header from '@/components/Header';
import Footer from '@/components/Footer';
import Head from 'next/head';
import Image from 'next/image';
import Arrow from '@/../public/arrow-white.svg';

const headerStyle =
'text-3xl md:text-5xl font-bold pb-4 text-left hover:text-royal w-fit underline decoration-transparent hover:decoration-inherit transition';
Expand Down

0 comments on commit 7275fd0

Please sign in to comment.