From df2aa0070a09339807d40b60969c0d5260f9334e Mon Sep 17 00:00:00 2001 From: Xevion Date: Sun, 26 Feb 2023 20:15:21 -0600 Subject: [PATCH] Add Balancer to ItemCard descriptions, add Balancer Provider to app root --- src/components/ItemCard.tsx | 5 ++++- src/pages/_app.tsx | 20 ++++++++++++-------- 2 files changed, 16 insertions(+), 9 deletions(-) diff --git a/src/components/ItemCard.tsx b/src/components/ItemCard.tsx index 706914a..9a57bf7 100644 --- a/src/components/ItemCard.tsx +++ b/src/components/ItemCard.tsx @@ -3,6 +3,7 @@ import {useOnClickOutside, useToggle} from "usehooks-ts"; import {classNames, isHoverable} from "../utils/helpers"; import DependentImage from "./DependentImage"; import ReactMarkdown from 'react-markdown' +import Balancer from "react-wrap-balancer"; import Link from "next/link"; import {useRouter} from "next/router"; @@ -59,7 +60,9 @@ const ItemCard = ({banner, bannerBlur, title, description, links, location, bann e.stopPropagation(); navigate(); }}> - {description} + + {description} + {(links?.length ?? 0) > 0 ? diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index ee3b2e3..2b9826d 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -1,15 +1,19 @@ -import {type AppType} from "next/app"; +import { type AppType } from "next/app"; -import {trpc} from "../utils/trpc"; +import { trpc } from "../utils/trpc"; import "../styles/globals.scss"; -import {Analytics} from "@vercel/analytics/react"; - -const MyApp: AppType = ({Component, pageProps}) => { - return <> +import { Analytics } from "@vercel/analytics/react"; +import { Provider } from "react-wrap-balancer"; +const MyApp: AppType = ({ Component, pageProps }) => { + return ( + <> + - - ; + + + + ); }; export default trpc.withTRPC(MyApp);