diff --git a/src/components/ArtistLookUp/ArtistLookUp.tsx b/src/components/ArtistLookUp/ArtistLookUp.tsx index 4a2a1b0e..a428e619 100644 --- a/src/components/ArtistLookUp/ArtistLookUp.tsx +++ b/src/components/ArtistLookUp/ArtistLookUp.tsx @@ -1,12 +1,13 @@ import { useState } from "react"; import { guestList, headliners } from "arrays/previous-guests"; -import { defaultGuest, GuestSlug, PreviousGuestType } from "components/PreviousGuest/types"; +import { defaultGuest, PreviousGuestType } from "components/PreviousGuest/types"; import { PreviousGuest } from "components/PreviousGuest"; +import { PostProps } from "types/frontmatter"; import { ArtistModal } from "./ArtistModal"; interface LookUpProps { anames: string[]; - gigs: GuestSlug[]; + gigs: PostProps[]; current: string; } @@ -22,16 +23,16 @@ export const ArtistLookUp = ({ anames, gigs, current }: LookUpProps) => { {anames.map((name) => { const dj = djs.find((dj) => name.toLowerCase() === dj.name.toLowerCase()); - if (!dj) return <>; - - return ( - - ); + if (dj) { + return ( + + ); + } })} diff --git a/src/components/ArtistLookUp/ArtistModal.tsx b/src/components/ArtistLookUp/ArtistModal.tsx index 89f2f033..c1957853 100644 --- a/src/components/ArtistLookUp/ArtistModal.tsx +++ b/src/components/ArtistLookUp/ArtistModal.tsx @@ -1,14 +1,15 @@ import Link from "next/link"; import { Modal } from "components/Modal"; -import { GuestSlug, PreviousGuestType } from "components/PreviousGuest/types"; +import { PreviousGuestType } from "components/PreviousGuest/types"; import { Picture } from "components/Picture"; +import { PostProps } from "types/frontmatter"; import styles from "./ArtistLookUp.module.scss"; interface ArtistModalProps { data: PreviousGuestType; show: boolean; setShow: (show: boolean) => void; - gigs: GuestSlug[]; + gigs: PostProps[]; current?: string; } @@ -16,7 +17,7 @@ export const ArtistModal = ({ data, show, setShow, gigs, current }: ArtistModalP const previousGigs = data.gig.filter((gig) => gig !== current); const getArtistGigs = (url: string) => { - const gig: GuestSlug = gigs.find((gig: GuestSlug) => gig.frontmatter.tickets === url); + const gig = gigs.find(({ frontmatter }) => frontmatter.tickets === url); if (gig && "frontmatter" in gig && "slug" in gig) { const { frontmatter, slug } = gig; diff --git a/src/components/Button/Button.module.scss b/src/components/Button/Button.module.scss index b5c0a499..509da5ce 100644 --- a/src/components/Button/Button.module.scss +++ b/src/components/Button/Button.module.scss @@ -59,3 +59,9 @@ .wide { padding: 0.375rem 1rem; } + +.showbox { + display: flex; + margin-top: 2rem; + gap: 0.25rem; +} diff --git a/src/components/Button/Showbox.tsx b/src/components/Button/Showbox.tsx new file mode 100644 index 00000000..d6777d1b --- /dev/null +++ b/src/components/Button/Showbox.tsx @@ -0,0 +1,19 @@ +import styles from "./Button.module.scss"; + +interface ShowboxProps { + handleLoadMore: () => void; + handleLoadAll: () => void; +} + +export const Showbox = ({ handleLoadMore, handleLoadAll }: ShowboxProps) => { + return ( +
+ + +
+ ); +}; diff --git a/src/components/Button/index.ts b/src/components/Button/index.ts index 3301cc6a..3c183a61 100644 --- a/src/components/Button/index.ts +++ b/src/components/Button/index.ts @@ -1 +1,2 @@ +export { Showbox } from "./Showbox"; export { Button } from "./Button"; diff --git a/src/components/Card/StickyCard.tsx b/src/components/Card/StickyCard.tsx index 44870f0a..1e146923 100644 --- a/src/components/Card/StickyCard.tsx +++ b/src/components/Card/StickyCard.tsx @@ -22,9 +22,11 @@ export const StickyCard = (props: CardProps) => {
-
-
+ {page && ( +
+
+ )}
diff --git a/src/components/Card/TextCard.tsx b/src/components/Card/TextCard.tsx index 054fd33e..6d88fbd2 100644 --- a/src/components/Card/TextCard.tsx +++ b/src/components/Card/TextCard.tsx @@ -1,32 +1,32 @@ import Link from "next/link"; -import { CardProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { Picture } from "components/Picture"; import styles from "./Card.module.scss"; interface Props { link: string; - post: CardProps; + post: PostProps; columns?: string; } -export const TextCard = (props: Props) => { - const { post, link, columns = "col-6 col-sm-6 col-md-6 col-lg-3" } = props; +export const TextCard = ({ post, link, columns = "col-6 col-sm-6 col-md-6 col-lg-3" }: Props) => { + const { title, pic, bio, date } = post.frontmatter; return (
-

{post.frontmatter.bio}

-

{post.frontmatter.date}

+

{bio}

+

{date}

diff --git a/src/components/Icon/Icon.tsx b/src/components/Icon/Icon.tsx index a18b37ae..a8fe40d1 100644 --- a/src/components/Icon/Icon.tsx +++ b/src/components/Icon/Icon.tsx @@ -52,5 +52,5 @@ export interface SocialIconProps { } export const Icon = ({ name }: SocialIconProps) => { - return IconMap[name.toLowerCase()]; + return IconMap[name.toLowerCase() as IconType]; }; diff --git a/src/components/Icon/SocialGroup.tsx b/src/components/Icon/SocialGroup.tsx index 362d564b..7f1b35e9 100644 --- a/src/components/Icon/SocialGroup.tsx +++ b/src/components/Icon/SocialGroup.tsx @@ -1,8 +1,8 @@ import { SocialIcon } from "components/Icon"; -import { IconType } from "./types"; +import { SocialIconType } from "./types"; interface SocialGroupI { - icons: IconType[]; + icons: SocialIconType[]; } export const SocialGroup = ({ icons }: SocialGroupI) => { diff --git a/src/components/Icon/SocialIcon/SocialIcon.tsx b/src/components/Icon/SocialIcon/SocialIcon.tsx index 0de5baf3..3ecb1b5d 100644 --- a/src/components/Icon/SocialIcon/SocialIcon.tsx +++ b/src/components/Icon/SocialIcon/SocialIcon.tsx @@ -2,11 +2,7 @@ import Link from "next/link"; import { plantbassdInstagram } from "utils/constants"; import styles from "./SocialIcon.module.scss"; import { Icon } from "../Icon"; -import { IconType } from "../types"; - -interface SocialIconI { - text: IconType; -} +import { SocialIconType } from "../types"; const link = { instagram: plantbassdInstagram, @@ -17,7 +13,7 @@ const link = { spotify: "https://open.spotify.com/playlist/5skAgzUfGmZLwrOPNLnGVf?si=c5affedbcbc74e76", }; -export const SocialIcon = ({ text }: SocialIconI) => { +export const SocialIcon = ({ text }: { text: SocialIconType }) => { return ( { +export const FreshJuice = ({ freshjuice }: { freshjuice: PostProps[] }) => { return (
diff --git a/src/components/Main/Gigs/Gigs.tsx b/src/components/Main/Gigs/Gigs.tsx index 2e9c67f8..131a2bfe 100644 --- a/src/components/Main/Gigs/Gigs.tsx +++ b/src/components/Main/Gigs/Gigs.tsx @@ -2,15 +2,11 @@ import Link from "next/link"; import { Picture } from "components/Picture"; import { Header } from "components/Header"; import { Button } from "components/Button"; -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import card from "components/Card/Card.module.scss"; import styles from "./Gigs.module.scss"; -interface Props { - gigs: AllPostProps[]; -} - -export const Gigs = ({ gigs }: Props) => { +export const Gigs = ({ gigs }: { gigs: PostProps[] }) => { return (
diff --git a/src/components/Main/News.tsx b/src/components/Main/News.tsx index dfaacc9f..cf2a4edd 100644 --- a/src/components/Main/News.tsx +++ b/src/components/Main/News.tsx @@ -1,15 +1,11 @@ -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { Header } from "components/Header"; import { HoverLink } from "components/HoverLink"; import { plantbassdInstagram } from "utils/constants"; import { Button } from "components/Button"; import { TextCard } from "components/Card"; -interface Props { - news: AllPostProps[]; -} - -export const News = ({ news }: Props) => { +export const News = ({ news }: { news: PostProps[] }) => { return (
diff --git a/src/components/Main/Radar.tsx b/src/components/Main/Radar.tsx index e9c3fde8..764f75b4 100644 --- a/src/components/Main/Radar.tsx +++ b/src/components/Main/Radar.tsx @@ -1,13 +1,9 @@ import { SimpleCard } from "components/Card"; -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { Button } from "components/Button"; import { Header } from "components/Header"; -interface Props { - radar: AllPostProps[]; -} - -export const Radar = ({ radar }: Props) => { +export const Radar = ({ radar }: { radar: PostProps[] }) => { return (
diff --git a/src/components/Main/TopTen.tsx b/src/components/Main/TopTen.tsx index bf1e538b..2630fd47 100644 --- a/src/components/Main/TopTen.tsx +++ b/src/components/Main/TopTen.tsx @@ -1,13 +1,9 @@ import { SimpleCard } from "components/Card"; -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { Button } from "components/Button"; import { Header } from "components/Header"; -interface Props { - topTen: AllPostProps[]; -} - -export const TopTen = ({ topTen }: Props) => { +export const TopTen = ({ topTen }: { topTen: PostProps[] }) => { return (
diff --git a/src/components/Modal/Modal.tsx b/src/components/Modal/Modal.tsx index 60d4e910..06b01710 100644 --- a/src/components/Modal/Modal.tsx +++ b/src/components/Modal/Modal.tsx @@ -17,7 +17,7 @@ export const Modal = (props: ModalProps) => { const selector = "#modal"; const [mounted, setMounted] = useState(false); - const ref = useRef(null); + const ref = useRef(null); const backdrop = useRef(null); const container = useRef(null); const backdropMouseDown = useRef(false); @@ -87,7 +87,7 @@ export const Modal = (props: ModalProps) => {
, - ref.current + ref.current as HTMLElement ) : null; }; diff --git a/src/components/PageMetaData.tsx b/src/components/PageMetaData.tsx index b17a38f1..48180892 100644 --- a/src/components/PageMetaData.tsx +++ b/src/components/PageMetaData.tsx @@ -9,7 +9,7 @@ interface TitleProps { } export default function PageMetaData({ title, description, imageUrl, url }: TitleProps) { - let cloudImage: string; + let cloudImage: string = ""; if (imageUrl) { cloudImage = getCldImageUrl({ diff --git a/src/components/Players/SoundCloud.tsx b/src/components/Players/SoundCloud.tsx index 9a98502b..95f2e3d1 100644 --- a/src/components/Players/SoundCloud.tsx +++ b/src/components/Players/SoundCloud.tsx @@ -1,14 +1,14 @@ import dynamic from "next/dynamic"; import { HoverLink } from "components/HoverLink"; -const ReactPlayer = dynamic(() => import("react-player/lazy"), { ssr: false }); - interface Props { url: string; name?: string; height?: string; } +const ReactPlayer = dynamic(() => import("react-player/lazy"), { ssr: false }); + /** * * @param url = soundcloud url diff --git a/src/components/Players/YouTube.tsx b/src/components/Players/YouTube.tsx index 8578d081..58c66299 100644 --- a/src/components/Players/YouTube.tsx +++ b/src/components/Players/YouTube.tsx @@ -1,12 +1,12 @@ import dynamic from "next/dynamic"; -const ReactPlayer = dynamic(() => import("react-player/lazy"), { ssr: false }); - interface Props { url: string; height?: string; } +const ReactPlayer = dynamic(() => import("react-player/lazy"), { ssr: false }); + /** * * @param url = soundcloud url diff --git a/src/components/PreviousGuest/types.ts b/src/components/PreviousGuest/types.ts index ce98905d..d9abda57 100644 --- a/src/components/PreviousGuest/types.ts +++ b/src/components/PreviousGuest/types.ts @@ -1,5 +1,3 @@ -import { IGigs } from "types/frontmatter"; - export interface PreviousGuestType { img: string; link: string; @@ -19,8 +17,3 @@ export interface PreviousGuestProps { setModalData: (val: PreviousGuestType) => void; setShow: (val: boolean) => void; } - -export interface GuestSlug { - slug: string; - frontmatter: IGigs; -} diff --git a/src/hooks/useBatch.hook.ts b/src/hooks/useBatch.hook.ts new file mode 100644 index 00000000..a2ed6246 --- /dev/null +++ b/src/hooks/useBatch.hook.ts @@ -0,0 +1,20 @@ +import { useMemo, useState } from "react"; +import { PostProps } from "types/frontmatter"; + +export const useBatch = (files: PostProps[]) => { + const [amount, setAmount] = useState(1); + + const filesToShow = useMemo(() => { + return files.slice(0, amount * 20); + }, [files, amount]); + + const handleLoadMore = () => { + setAmount((prev) => prev + 1); + }; + + const handleLoadAll = () => { + setAmount(files.length); + }; + + return { filesToShow, handleLoadMore, handleLoadAll }; +}; diff --git a/src/hooks/useRellax.hook.ts b/src/hooks/useRellax.hook.ts index 43b6b667..02f6887e 100644 --- a/src/hooks/useRellax.hook.ts +++ b/src/hooks/useRellax.hook.ts @@ -9,7 +9,6 @@ export const useRellax = () => { round: true, speed: -7.5, vertical: true, - wrapper: null, }); }, []); }; diff --git a/src/hooks/useSearchFilter.hook.ts b/src/hooks/useSearchFilter.hook.ts index 267d3c4c..25998863 100644 --- a/src/hooks/useSearchFilter.hook.ts +++ b/src/hooks/useSearchFilter.hook.ts @@ -6,7 +6,7 @@ const fuseOptions = { keys: ["name", "frontmatter.name", "frontmatter.bio"], }; -export const useSearchFilter = (posts = [], type?: "array") => { +export const useSearchFilter = (posts = [] as T[], type?: "array") => { const [searchHasErrored, setSearchHasErrored] = useState(false); const [searchError, setSearchError] = useState(""); const [postCards, setPostCards] = useState(posts); @@ -31,7 +31,7 @@ export const useSearchFilter = (posts = [], type?: "array") => { } } catch (err) { setSearchHasErrored(true); - setSearchError(err); + setSearchError(err as string); } }, [filter, posts, type]); diff --git a/src/hooks/useTagsFilter.hook.ts b/src/hooks/useTagsFilter.hook.ts index 9b550926..4eba37d9 100644 --- a/src/hooks/useTagsFilter.hook.ts +++ b/src/hooks/useTagsFilter.hook.ts @@ -1,29 +1,31 @@ import { useEffect, useState } from "react"; -import { FilterProps } from "types/frontmatter"; +import { Frontmatter } from "types/frontmatter"; interface TagProps { name: string; value: boolean; } -type FilterTypeProps = "tags" | "city"; +interface Optionals { + name?: string; + frontmatter?: Frontmatter; +} /** * Filter a list using predefined tags * * @param initTagList - array of name and value * @param files = array of incoming data - * @param filterType - String of either city (gigs) or tags (news) for frontmatter or leave blank for links + * @param filterType - String of either city (gigs), tags (news) for frontmatter or links for linkList */ -export const useTagsFilter = ( +export const useTagsFilter = ( initTagList: TagProps[], - files = [], - filterType?: FilterTypeProps + files: T[], + filterType: "city" | "tags" | "links" ) => { - const [tagsHasErrored, setTagsHasErrored] = useState(false); const [tagsError, setTagsError] = useState(""); - const [tags, setTags] = useState([]); - const [filteredPosts, setFilteredPosts] = useState(files); + const [tags, setTags] = useState([]); + const [filteredPosts, setFilteredPosts] = useState([]); const [tagList, setTagList] = useState(initTagList); const addTag = (tag: TagProps) => { @@ -55,23 +57,20 @@ export const useTagsFilter = ( useEffect(() => { try { let filtered = []; - if (!filterType) { - filtered = - tags.length === 0 - ? files - : files.filter(({ name }: { name: string }) => tags.includes(name)); + if (tags.length === 0) { + filtered = files; + } else if (filterType === "links") { + filtered = files.filter(({ name }) => name && tags.includes(name)); } else { - filtered = - tags.length === 0 - ? files - : files.filter((item: FilterProps) => tags.includes(item.frontmatter[filterType])); + filtered = files.filter( + ({ frontmatter }) => frontmatter && tags.includes(frontmatter[filterType] ?? "") + ); } setFilteredPosts(filtered); } catch (event) { - setTagsHasErrored(true); - setTagsError(event); + setTagsError(event as string); } - }, [tags, files, filterType]); + }, [files, filterType, tags]); - return { tagsError, tagsHasErrored, filteredPosts, tagList, handleTags }; + return { tagsError, filteredPosts, tagList, handleTags }; }; diff --git a/src/pages/api/newsletter.ts b/src/pages/api/newsletter.ts index 7c814382..94582387 100644 --- a/src/pages/api/newsletter.ts +++ b/src/pages/api/newsletter.ts @@ -2,8 +2,8 @@ import type { NextApiRequest, NextApiResponse } from "next"; import { GoogleSpreadsheet } from "google-spreadsheet"; const SPREADSHEET_ID = process.env.SPREADSHEET_ID; -const CLIENT_EMAIL = process.env.CLIENT_EMAIL; -const PRIVATE_KEY = process.env.PRIVATE_KEY; +const CLIENT_EMAIL = process.env.CLIENT_EMAIL ?? ""; +const PRIVATE_KEY = process.env.PRIVATE_KEY ?? ""; const doc = new GoogleSpreadsheet(SPREADSHEET_ID); diff --git a/src/pages/archive/index.tsx b/src/pages/archive/index.tsx index e03f0c8e..83110105 100644 --- a/src/pages/archive/index.tsx +++ b/src/pages/archive/index.tsx @@ -1,20 +1,23 @@ -import { InferGetStaticPropsType } from "next"; import { GetStaticProps } from "next/types"; import Error from "components/Error"; import { useSearchFilter } from "hooks/useSearchFilter.hook"; import { TextCard } from "components/Card"; import styles from "styles/page.module.scss"; -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { SearchBox } from "components/SearchBox"; import { getAllPosts } from "utils/getAllPosts"; import PageMetaData from "components/PageMetaData"; import { sortByMostRecentDate } from "utils"; import { SocialGroup } from "components/Icon"; import { Loading } from "components/Loading"; +import { Showbox } from "components/Button"; +import { useBatch } from "hooks/useBatch.hook"; + +export default function ArchivePage({ files }: { files: PostProps[] }) { + const { filesToShow, handleLoadMore, handleLoadAll } = useBatch(files); -export default function ArchivePage({ files }: InferGetStaticPropsType) { const { searchError, filter, searchHasErrored, postCards, handleSearchChange } = - useSearchFilter(files); + useSearchFilter(filesToShow); if (searchHasErrored) return ; @@ -33,7 +36,7 @@ export default function ArchivePage({ files }: InferGetStaticPropsType
- {postCards.map((story: AllPostProps) => ( + {postCards.map((story) => ( ))}
+
); diff --git a/src/pages/fresh-juice/[slug].tsx b/src/pages/fresh-juice/[slug].tsx index 21b03179..eb60aed8 100644 --- a/src/pages/fresh-juice/[slug].tsx +++ b/src/pages/fresh-juice/[slug].tsx @@ -1,19 +1,24 @@ -import { InferGetStaticPropsType } from "next"; import dynamic from "next/dynamic"; import { StickyCard } from "components/Card"; import { Slug } from "components/Slug"; -import { StaticProps } from "types/frontmatter"; +import { SlugProp, StaticProps } from "types/frontmatter"; import { getSlugContent, getSlugPath } from "utils/getSlug"; import PageMetaData from "components/PageMetaData"; import { Shell } from "components/Slug/Shell"; +interface FreshJuiceProps { + frontmatter: { + bandcamp: string; + }; +} + const ReactPlayer = dynamic(() => import("react-player/lazy"), { ssr: false }); export default function FreshJuiceSlug({ frontmatter, mdxSource, slug, -}: InferGetStaticPropsType) { +}: SlugProp & FreshJuiceProps) { const { artist = "Bandcamp", youtube, diff --git a/src/pages/fresh-juice/index.tsx b/src/pages/fresh-juice/index.tsx index e25df617..77bf8452 100644 --- a/src/pages/fresh-juice/index.tsx +++ b/src/pages/fresh-juice/index.tsx @@ -1,11 +1,9 @@ -import { InferGetStaticPropsType } from "next"; -import { GetStaticProps } from "next/types"; - +import { GetStaticProps } from "next"; import Error from "components/Error"; import { useSearchFilter } from "hooks/useSearchFilter.hook"; import { TextCard } from "components/Card"; import styles from "styles/page.module.scss"; -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { SearchBox } from "components/SearchBox"; import { getPosts } from "utils/getPosts"; import PageMetaData from "components/PageMetaData"; @@ -14,11 +12,9 @@ import { SocialGroup } from "components/Icon"; import { Loading } from "components/Loading"; -export default function FreshJuicePage({ - freshjuice, -}: InferGetStaticPropsType) { +export default function FreshJuicePage({ freshjuice }: { freshjuice: PostProps[] }) { const { searchError, filter, searchHasErrored, postCards, handleSearchChange } = - useSearchFilter(freshjuice); + useSearchFilter(freshjuice); if (searchHasErrored) return ; @@ -43,7 +39,7 @@ export default function FreshJuicePage({
- {postCards.map((juice: AllPostProps) => ( + {postCards.map((juice) => ( ) { +export default function GallerySlug({ mdxSource, slug, frontmatter }: SlugProp) { const { title, date, path, gallery, gallerySize, pic, bio } = frontmatter; return ( diff --git a/src/pages/gallery/index.tsx b/src/pages/gallery/index.tsx index d03c47f3..c76a1040 100644 --- a/src/pages/gallery/index.tsx +++ b/src/pages/gallery/index.tsx @@ -1,4 +1,3 @@ -import { InferGetStaticPropsType } from "next"; import { GetStaticProps } from "next/types"; import { useTagsFilter } from "hooks"; @@ -6,7 +5,7 @@ import Error from "components/Error"; import { FilterTags } from "components/FilterTags"; import { TextCard } from "components/Card"; import styles from "styles/page.module.scss"; -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { getPosts } from "utils/getPosts"; import PageMetaData from "components/PageMetaData"; import { sortByMostRecentDate } from "utils"; @@ -21,14 +20,14 @@ const gigsTags = [ { name: "galway", value: false }, ]; -export default function GalleryPage({ gigs }: InferGetStaticPropsType) { - const { tagsError, tagsHasErrored, filteredPosts, tagList, handleTags } = useTagsFilter( +export default function GalleryPage({ gigs }: { gigs: PostProps[] }) { + const { tagsError, filteredPosts, tagList, handleTags } = useTagsFilter( gigsTags, gigs, "city" ); - if (tagsHasErrored) return ; + if (tagsError) return ; return (
@@ -48,7 +47,7 @@ export default function GalleryPage({ gigs }: InferGetStaticPropsType
- {filteredPosts.map((gig: AllPostProps) => ( + {filteredPosts.map((gig) => ( ) { +interface GigProps { + frontmatter: { + anames: string[]; + tickets: string; + }; + gigs: PostProps[]; +} + +export default function GigsSlug({ mdxSource, frontmatter, gigs, slug }: SlugProp & GigProps) { const { title, date, pic, tickets, seeMore, postLink, path, anames, bio } = frontmatter; - const buyLink = tickets ? tickets : seeMore; + const buyLink = tickets ? tickets : seeMore || ""; const buyText = tickets ? "Tickets" : "See More"; return ( diff --git a/src/pages/gigs/index.tsx b/src/pages/gigs/index.tsx index d230bf9b..6cb1ecff 100644 --- a/src/pages/gigs/index.tsx +++ b/src/pages/gigs/index.tsx @@ -1,16 +1,15 @@ -import { InferGetStaticPropsType } from "next"; import { GetStaticProps } from "next/types"; import { useTagsFilter } from "hooks"; import Error from "components/Error"; import { FilterTags } from "components/FilterTags"; import { TextCard } from "components/Card"; import styles from "styles/page.module.scss"; -import { AllPostProps } from "types/frontmatter"; import { getPosts } from "utils/getPosts"; import PageMetaData from "components/PageMetaData"; import { sortByMostRecentDate } from "utils"; import { SocialGroup } from "components/Icon"; import { Loading } from "components/Loading"; +import { PostProps } from "types/frontmatter"; const gigsTags = [ { name: "edinburgh", value: false }, @@ -19,14 +18,14 @@ const gigsTags = [ { name: "galway", value: false }, ]; -export default function GigsPage({ gigs }: InferGetStaticPropsType) { - const { tagsError, tagsHasErrored, filteredPosts, tagList, handleTags } = useTagsFilter( +export default function GigsPage({ gigs }: { gigs: PostProps[] }) { + const { tagsError, filteredPosts, tagList, handleTags } = useTagsFilter( gigsTags, gigs, "city" ); - if (tagsHasErrored) return ; + if (tagsError) return ; return (
@@ -47,7 +46,7 @@ export default function GigsPage({ gigs }: InferGetStaticPropsType
- {filteredPosts.map((gig: AllPostProps) => ( + {filteredPosts.map((gig) => ( ) { +export default function Guides({ frontmatter, slug, mdxSource }: SlugProp) { const { title, date, path, pic, bio } = frontmatter; return (
diff --git a/src/pages/guides/index.tsx b/src/pages/guides/index.tsx index 66cd81bd..58325ec3 100644 --- a/src/pages/guides/index.tsx +++ b/src/pages/guides/index.tsx @@ -1,10 +1,9 @@ -import { InferGetStaticPropsType } from "next"; import { GetStaticProps } from "next/types"; import Error from "components/Error"; import { useSearchFilter } from "hooks/useSearchFilter.hook"; import { TextCard } from "components/Card"; import styles from "styles/page.module.scss"; -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { SearchBox } from "components/SearchBox"; import { getPosts } from "utils/getPosts"; import PageMetaData from "components/PageMetaData"; @@ -12,9 +11,9 @@ import { sortByMostRecentDate } from "utils"; import { SocialGroup } from "components/Icon"; import { Loading } from "components/Loading"; -export default function GuidesPage({ guides }: InferGetStaticPropsType) { +export default function GuidesPage({ guides }: { guides: PostProps[] }) { const { searchError, filter, searchHasErrored, postCards, handleSearchChange } = - useSearchFilter(guides); + useSearchFilter(guides); if (searchHasErrored) return ; @@ -33,7 +32,7 @@ export default function GuidesPage({ guides }: InferGetStaticPropsType
- {postCards.map((guide: AllPostProps) => ( + {postCards.map((guide) => ( ))}
diff --git a/src/pages/index.tsx b/src/pages/index.tsx index eb386487..676bec4f 100644 --- a/src/pages/index.tsx +++ b/src/pages/index.tsx @@ -1,6 +1,6 @@ import { FreshJuice, Gigs, News, Premiere, Radar, TopTen } from "components/Main"; import { Banner } from "components/Banner"; -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { getPosts } from "utils/getPosts"; import PageMetaData from "components/PageMetaData"; import { sortByMostRecentDate } from "utils"; @@ -8,11 +8,11 @@ import { sortByMostRecentDate } from "utils"; import { Loading } from "components/Loading"; interface HomeProps { - allPosts: AllPostProps[]; - topTen: AllPostProps[]; - radar: AllPostProps[]; - freshjuice: AllPostProps[]; - gigs: AllPostProps[]; + allPosts: PostProps[]; + topTen: PostProps[]; + radar: PostProps[]; + freshjuice: PostProps[]; + gigs: PostProps[]; } export default function Home({ allPosts, topTen, radar, freshjuice, gigs }: HomeProps) { @@ -54,7 +54,7 @@ const folders = [ ]; export async function getStaticProps() { - const files = {}; + const files: { [key: string]: PostProps[] } = {}; for (const folder of folders) { const posts = await getPosts(folder); files[folder] = posts.sort(sortByMostRecentDate).slice(0, 4); diff --git a/src/pages/links/index.tsx b/src/pages/links/index.tsx index 0ab502c5..68d0b366 100644 --- a/src/pages/links/index.tsx +++ b/src/pages/links/index.tsx @@ -1,6 +1,6 @@ import Link from "next/link"; -import { linkList } from "arrays/linktree"; +import { linkList, LinkProps } from "arrays/linktree"; import { socialIcons } from "arrays/social-icons"; import { Header } from "components/Header"; import Error from "components/Error"; @@ -20,12 +20,13 @@ const linkTags = [ ]; export default function Links() { - const { tagsError, tagsHasErrored, filteredPosts, tagList, handleTags } = useTagsFilter( + const { tagsError, filteredPosts, tagList, handleTags } = useTagsFilter( linkTags, - linkList + linkList, + "links" ); - if (tagsHasErrored) return ; + if (tagsError) return ; return (
diff --git a/src/pages/news/[slug].tsx b/src/pages/news/[slug].tsx index 22424951..f419e3a6 100644 --- a/src/pages/news/[slug].tsx +++ b/src/pages/news/[slug].tsx @@ -1,19 +1,14 @@ -import { InferGetStaticPropsType } from "next"; import { StickyCard } from "components/Card"; import { Slug } from "components/Slug"; -import { StaticProps } from "types/frontmatter"; +import { SlugProp, StaticProps } from "types/frontmatter"; import { getSlugContent, getSlugPath } from "utils/getSlug"; import PageMetaData from "components/PageMetaData"; import { Shell } from "components/Slug/Shell"; -export default function NewsSlug({ - mdxSource, - frontmatter, - slug, -}: InferGetStaticPropsType) { +export default function NewsSlug({ mdxSource, frontmatter, slug }: SlugProp) { const { title, date, pic, tickets, seeMore, path, postLink, bio } = frontmatter; - const buyLink = tickets ? tickets : seeMore; + const buyLink = tickets ? tickets : seeMore || ""; const buyText = tickets ? "RA tickets" : "See More"; return ( diff --git a/src/pages/news/index.tsx b/src/pages/news/index.tsx index a990e16b..52b0d2e5 100644 --- a/src/pages/news/index.tsx +++ b/src/pages/news/index.tsx @@ -1,12 +1,9 @@ -import Link from "next/link"; -import { InferGetStaticPropsType } from "next"; import { GetStaticProps } from "next/types"; import Error from "components/Error"; import { FilterTags } from "components/FilterTags"; import { TextCard } from "components/Card"; import styles from "styles/page.module.scss"; -import { AllPostProps } from "types/frontmatter"; import { useTagsFilter } from "hooks"; import { getAllPosts } from "utils/getAllPosts"; import PageMetaData from "components/PageMetaData"; @@ -14,6 +11,9 @@ import { sortByMostRecentDate } from "utils"; import { Loading } from "components/Loading"; import { SocialGroup } from "components/Icon"; +import { PostProps } from "types/frontmatter"; +import { Showbox } from "components/Button"; +import { useBatch } from "hooks/useBatch.hook"; const newsTags = [ { name: "fresh juice", value: false }, @@ -24,14 +24,16 @@ const newsTags = [ { name: "festivals", value: false }, ]; -export default function NewsPage({ files }: InferGetStaticPropsType) { - const { tagsError, tagsHasErrored, filteredPosts, tagList, handleTags } = useTagsFilter( +export default function NewsPage({ files }: { files: PostProps[] }) { + const { filesToShow, handleLoadMore, handleLoadAll } = useBatch(files); + + const { tagsError, filteredPosts, tagList, handleTags } = useTagsFilter( newsTags, - files, + filesToShow, "tags" ); - if (tagsHasErrored) return ; + if (tagsError) return ; return (
@@ -52,7 +54,7 @@ export default function NewsPage({ files }: InferGetStaticPropsType
{filteredPosts.length > 0 ? ( - filteredPosts.map((story: AllPostProps) => ( + filteredPosts.map((story) => ( -
- - View All Posts - -
+
); } diff --git a/src/pages/premieres/[slug].tsx b/src/pages/premieres/[slug].tsx index 0450a4f5..462647f3 100644 --- a/src/pages/premieres/[slug].tsx +++ b/src/pages/premieres/[slug].tsx @@ -1,19 +1,21 @@ -import { InferGetStaticPropsType } from "next"; import dynamic from "next/dynamic"; import { StickyCard } from "components/Card"; import { Slug } from "components/Slug"; -import { StaticProps } from "types/frontmatter"; +import { SlugProp, StaticProps } from "types/frontmatter"; import { getSlugContent, getSlugPath } from "utils/getSlug"; import PageMetaData from "components/PageMetaData"; import { Shell } from "components/Slug/Shell"; +interface PremiereProps { + frontmatter: { + listen: string; + seeMore: string; + }; +} + const ReactPlayer = dynamic(() => import("react-player/lazy"), { ssr: false }); -export default function PremieresSlug({ - mdxSource, - frontmatter, - slug, -}: InferGetStaticPropsType) { +export default function PremieresSlug({ mdxSource, frontmatter, slug }: SlugProp & PremiereProps) { const { title, date, pic, seeMore, listen, postLink, path, youtube, bio } = frontmatter; return ( @@ -51,6 +53,7 @@ export async function getStaticPaths() { paths, }; } + export async function getStaticProps({ params: { slug } }: StaticProps) { const { frontmatter, mdxSource } = await getSlugContent("premieres", slug); diff --git a/src/pages/premieres/index.tsx b/src/pages/premieres/index.tsx index 2267706a..593888de 100644 --- a/src/pages/premieres/index.tsx +++ b/src/pages/premieres/index.tsx @@ -1,11 +1,10 @@ -import { InferGetStaticPropsType } from "next"; import { GetStaticProps } from "next/types"; import Error from "components/Error"; import { useSearchFilter } from "hooks/useSearchFilter.hook"; import { TextCard } from "components/Card"; import styles from "styles/page.module.scss"; -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { SearchBox } from "components/SearchBox"; import { getPosts } from "utils/getPosts"; import PageMetaData from "components/PageMetaData"; @@ -14,11 +13,9 @@ import { SocialGroup } from "components/Icon"; import { Loading } from "components/Loading"; -export default function PremieresPage({ - premieres, -}: InferGetStaticPropsType) { +export default function PremieresPage({ premieres }: { premieres: PostProps[] }) { const { searchError, filter, searchHasErrored, postCards, handleSearchChange } = - useSearchFilter(premieres); + useSearchFilter(premieres); if (searchHasErrored) return ; @@ -41,7 +38,7 @@ export default function PremieresPage({
- {postCards.map((premiere: AllPostProps) => ( + {postCards.map((premiere) => ( (defaultGuest); - const { searchError, filter, searchHasErrored, postCards, handleSearchChange } = useSearchFilter( - djs, - "array" - ); + const { searchError, filter, searchHasErrored, postCards, handleSearchChange } = + useSearchFilter(djs, "array"); if (searchHasErrored) return ; @@ -39,7 +38,7 @@ export default function PreviousGuestsPage({ gigs }: { gigs: GuestSlug[] }) { {filter ? (
- {postCards.sort(sortAlphabetically).map((guest: PreviousGuestType) => ( + {postCards.sort(sortAlphabetically).map((guest) => ( ) { +interface RadioProps { + frontmatter: { + mixLink: string; + artistPage: string; + }; +} + +export default function RadioSlug({ mdxSource, frontmatter, slug }: SlugProp & RadioProps) { const { title, date, pic, artistPage, mixLink, path, bio } = frontmatter; return ( diff --git a/src/pages/radios/index.tsx b/src/pages/radios/index.tsx index 69fafc3c..ffc63023 100644 --- a/src/pages/radios/index.tsx +++ b/src/pages/radios/index.tsx @@ -1,11 +1,10 @@ -import { InferGetStaticPropsType } from "next"; import { GetStaticProps } from "next/types"; import Error from "components/Error"; import { useSearchFilter } from "hooks/useSearchFilter.hook"; import { TextCard } from "components/Card"; import styles from "styles/page.module.scss"; -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { SearchBox } from "components/SearchBox"; import { getPosts } from "utils/getPosts"; import PageMetaData from "components/PageMetaData"; @@ -13,9 +12,9 @@ import { sortByMostRecentDate } from "utils"; import { SocialGroup } from "components/Icon"; import { Loading } from "components/Loading"; -export default function RadioPage({ radios }: InferGetStaticPropsType) { +export default function RadioPage({ radios }: { radios: PostProps[] }) { const { searchError, filter, searchHasErrored, postCards, handleSearchChange } = - useSearchFilter(radios); + useSearchFilter(radios); if (searchHasErrored) return ; @@ -36,7 +35,7 @@ export default function RadioPage({ radios }: InferGetStaticPropsType
- {postCards.map((radio: AllPostProps) => ( + {postCards.map((radio) => ( ))}
diff --git a/src/pages/takeovers/[slug].tsx b/src/pages/takeovers/[slug].tsx index 3ac310bc..4fb36fe0 100644 --- a/src/pages/takeovers/[slug].tsx +++ b/src/pages/takeovers/[slug].tsx @@ -1,16 +1,17 @@ -import { InferGetStaticPropsType } from "next"; import { StickyCard } from "components/Card"; -import { StaticProps } from "types/frontmatter"; +import { SlugProp, StaticProps } from "types/frontmatter"; import { getSlugContent, getSlugPath } from "utils/getSlug"; import { Slug } from "components/Slug"; import PageMetaData from "components/PageMetaData"; import { Shell } from "components/Slug/Shell"; -export default function TakeoverSlug({ - mdxSource, - frontmatter, - slug, -}: InferGetStaticPropsType) { +interface TakeoverProps { + frontmatter: { + artistPage: string; + }; +} + +export default function TakeoverSlug({ mdxSource, frontmatter, slug }: SlugProp & TakeoverProps) { const { title, date, pic, artistPage, path, postLink, bio } = frontmatter; return ( diff --git a/src/pages/takeovers/index.tsx b/src/pages/takeovers/index.tsx index 42326a06..770b1bbb 100644 --- a/src/pages/takeovers/index.tsx +++ b/src/pages/takeovers/index.tsx @@ -1,11 +1,10 @@ -import { InferGetStaticPropsType } from "next"; import { GetStaticProps } from "next/types"; import Error from "components/Error"; import { useSearchFilter } from "hooks/useSearchFilter.hook"; import { TextCard } from "components/Card"; import styles from "styles/page.module.scss"; -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { SearchBox } from "components/SearchBox"; import { getPosts } from "utils/getPosts"; import PageMetaData from "components/PageMetaData"; @@ -14,11 +13,9 @@ import { SocialGroup } from "components/Icon"; import { Loading } from "components/Loading"; -export default function TakeoverPage({ - takeovers, -}: InferGetStaticPropsType) { +export default function TakeoverPage({ takeovers }: { takeovers: PostProps[] }) { const { searchError, filter, searchHasErrored, postCards, handleSearchChange } = - useSearchFilter(takeovers); + useSearchFilter(takeovers); if (searchHasErrored) return ; @@ -45,7 +42,7 @@ export default function TakeoverPage({
- {postCards.map((takeover: AllPostProps) => ( + {postCards.map((takeover) => ( diff --git a/src/pages/top-ten-releases/[slug].tsx b/src/pages/top-ten-releases/[slug].tsx index 76923fcb..851efd88 100644 --- a/src/pages/top-ten-releases/[slug].tsx +++ b/src/pages/top-ten-releases/[slug].tsx @@ -1,7 +1,6 @@ -import { InferGetStaticPropsType } from "next"; import { MDXRemote } from "next-mdx-remote"; import { Picture } from "components/Picture"; -import { StaticProps } from "types/frontmatter"; +import { SlugProp, StaticProps } from "types/frontmatter"; import { getSlugContent, getSlugPath } from "utils/getSlug"; import { HoverLink } from "components/HoverLink"; import styles from "styles/top-ten.module.scss"; @@ -10,13 +9,15 @@ import { FavTrack } from "components/Slug"; import { Icon } from "components/Icon/Icon"; import { Loading } from "components/Loading"; +interface TopTenProps { + frontmatter: { + cover: string; + }; +} + const components = { HoverLink, Picture, FavTrack }; -export default function TopTenSlug({ - mdxSource, - frontmatter, - slug, -}: InferGetStaticPropsType) { +export default function TopTenSlug({ mdxSource, frontmatter, slug }: SlugProp & TopTenProps) { const { title, date, cover, intro, header, insta, path } = frontmatter; return (
diff --git a/src/pages/top-ten-releases/index.tsx b/src/pages/top-ten-releases/index.tsx index 9a3a529c..dc3df37d 100644 --- a/src/pages/top-ten-releases/index.tsx +++ b/src/pages/top-ten-releases/index.tsx @@ -1,11 +1,10 @@ -import { InferGetStaticPropsType } from "next"; import { GetStaticProps } from "next/types"; import Error from "components/Error"; import { useSearchFilter } from "hooks/useSearchFilter.hook"; import { TextCard } from "components/Card"; import styles from "styles/page.module.scss"; -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { SearchBox } from "components/SearchBox"; import { getPosts } from "utils/getPosts"; import PageMetaData from "components/PageMetaData"; @@ -14,9 +13,9 @@ import { SocialGroup } from "components/Icon"; import { Loading } from "components/Loading"; -export default function TopTenPage({ topTens }: InferGetStaticPropsType) { +export default function TopTenPage({ topTens }: { topTens: PostProps[] }) { const { searchError, filter, searchHasErrored, postCards, handleSearchChange } = - useSearchFilter(topTens); + useSearchFilter(topTens); if (searchHasErrored) return ; @@ -41,7 +40,7 @@ export default function TopTenPage({ topTens }: InferGetStaticPropsType
- {postCards.map((topTen: AllPostProps) => ( + {postCards.map((topTen) => ( ) { - const { month, date, bio, pic, mdxSource, path } = props; +export default function UnderTheRadarSlug({ mdxSource, frontmatter, slug }: SlugProp) { + const { month, date, bio, pic, path } = frontmatter; return (
- +

@@ -58,11 +57,8 @@ export async function getStaticProps({ params: { slug } }: StaticProps) { return { props: { mdxSource, - month: frontmatter.month, - date: frontmatter.date, - bio: frontmatter.bio, - pic: frontmatter.pic, - path: frontmatter.path, + frontmatter, + slug, }, }; } diff --git a/src/pages/under-the-radar/index.tsx b/src/pages/under-the-radar/index.tsx index 8ddf5412..b00e146a 100644 --- a/src/pages/under-the-radar/index.tsx +++ b/src/pages/under-the-radar/index.tsx @@ -1,11 +1,10 @@ -import { InferGetStaticPropsType } from "next"; import { GetStaticProps } from "next/types"; import Error from "components/Error"; import { useSearchFilter } from "hooks/useSearchFilter.hook"; import { TextCard } from "components/Card"; import styles from "styles/page.module.scss"; -import { AllPostProps } from "types/frontmatter"; +import { PostProps } from "types/frontmatter"; import { SearchBox } from "components/SearchBox"; import { getPosts } from "utils/getPosts"; import PageMetaData from "components/PageMetaData"; @@ -14,11 +13,9 @@ import { sortByMostRecentDate } from "utils"; import { Loading } from "components/Loading"; import { SocialGroup } from "components/Icon"; -export default function UnderTheRadarPage({ - radars, -}: InferGetStaticPropsType) { +export default function UnderTheRadarPage({ radars }: { radars: PostProps[] }) { const { searchError, filter, searchHasErrored, postCards, handleSearchChange } = - useSearchFilter(radars); + useSearchFilter(radars); if (searchHasErrored) return ; @@ -41,7 +38,7 @@ export default function UnderTheRadarPage({

- {postCards.map((radar: AllPostProps) => ( + {postCards.map((radar) => ( , Record>; slug: string; - frontmatter: IGigs | IFreshJuice | INews | ITakeover | IRadio | ITopTen | IPremiere; } -interface Frontmatter { - title: string; - name: string; - date: string; - pic: string; - path: string; - bio: string; - postLink: string; +export interface StaticProps { + params: { + slug: string; + }; } -export interface IGigs extends Frontmatter { +interface Optionals { tags: string; city: string; anames: string[]; - tickets: string; -} - -interface IFreshJuice extends Frontmatter { - tags: string; bandcamp: string; - artist?: string; -} - -interface INews extends Frontmatter { - tags: string; - tickets?: string; - seeMore?: string; -} - -interface IPremiere extends Frontmatter { + artist: string; + tickets: string; listen: string; -} - -interface ITakeover extends Frontmatter { - artistPage: string; -} - -interface IRadio extends Omit { artistPage: string; + seeMore: string; mixLink: string; -} - -interface ITopTen extends Omit { - tags: string; cover: string; header: string; insta: string; + youtube: string; + gallery: string; + gallerySize: number; + intro: string; + month: string; +} + +export interface Frontmatter extends Partial { + title: string; + name: string; + date: string; + pic: string; + path: string; + bio: string; + postLink: string; +} + +export interface PostProps { + slug: string; + frontmatter: Frontmatter; } export interface CardProps { @@ -70,9 +66,3 @@ export interface FilterProps { city: string; }; } - -export interface StaticProps { - params: { - slug: string; - }; -} diff --git a/src/utils/getAllPosts.ts b/src/utils/getAllPosts.ts index 1b608f91..c112432b 100644 --- a/src/utils/getAllPosts.ts +++ b/src/utils/getAllPosts.ts @@ -2,14 +2,14 @@ import matter from "gray-matter"; import { resolve } from "path"; import { promises as fs } from "fs"; -import { AllPostProps } from "types/frontmatter"; +import { Frontmatter, PostProps } from "types/frontmatter"; /** * Recursively Reading All Files From a Directory * An async iterator that returns a result whenever * the necessary async operations complete */ -async function* recursiveFind(dir: string) { +async function* recursiveFind(dir: string): AsyncGenerator { const posts = await fs.readdir(dir, { withFileTypes: true }); for (const dirPath of posts) { const res = resolve(dir, dirPath.name); @@ -17,7 +17,8 @@ async function* recursiveFind(dir: string) { yield* recursiveFind(res); } else { const fileContents = await fs.readFile(res, "utf8"); - const { data: frontmatter } = matter(fileContents); + const { data } = matter(fileContents); + const frontmatter: Frontmatter = data as Frontmatter; const slug = dirPath.name.replace(".mdx", ""); yield { frontmatter, slug }; } @@ -27,9 +28,9 @@ async function* recursiveFind(dir: string) { * we can "consume" an entire async iterator and * push the results into an array. */ -export const getAllPosts = async () => { - const posts = await recursiveFind("src/posts"); - const res: AllPostProps[] = []; +export const getAllPosts = async (): Promise => { + const posts = recursiveFind("src/posts"); + const res = []; for await (const item of posts) { res.push(item); } diff --git a/src/utils/getPosts.ts b/src/utils/getPosts.ts index 7a7d36e1..f0c33f2b 100644 --- a/src/utils/getPosts.ts +++ b/src/utils/getPosts.ts @@ -1,15 +1,18 @@ import matter from "gray-matter"; import { join, resolve } from "path"; import { promises as fs } from "fs"; +import { Frontmatter, PostProps } from "types/frontmatter"; -export const getPosts = async (dir: string) => { +export const getPosts = async (dir: string): Promise => { const files = await fs.readdir(join("src/posts", dir), { withFileTypes: true }); const posts = []; for await (const dirPath of files) { const res = resolve("src/posts", dir, dirPath.name); const fileContents = await fs.readFile(res, "utf8"); - const { data: frontmatter } = matter(fileContents); + + const { data } = matter(fileContents); + const frontmatter: Frontmatter = data as Frontmatter; const slug = dirPath.name.replace(".mdx", ""); posts.push({ frontmatter, slug }); } diff --git a/src/utils/sortAlphabetically.ts b/src/utils/sortAlphabetically.ts index b2444324..d8fbeaaf 100644 --- a/src/utils/sortAlphabetically.ts +++ b/src/utils/sortAlphabetically.ts @@ -1,10 +1,8 @@ -interface GuestProp { - img: string; - link: string; +interface SortProp { name: string; } -export const sortAlphabetically = (a: GuestProp, b: GuestProp) => { +export const sortAlphabetically = (a: SortProp, b: SortProp) => { const aName = a.name.toLowerCase(); const bName = b.name.toLowerCase(); diff --git a/tsconfig.json b/tsconfig.json index d0c51c81..941197c3 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -10,7 +10,7 @@ "lib": ["dom", "dom.iterable", "esnext"], "allowJs": true, "skipLibCheck": true, - "strict": false, + "strict": true, "forceConsistentCasingInFileNames": true, "noEmit": true, "incremental": true,