From 8262f0d17a1c74b3567e744c4a30524d4f7e13ae Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 2 Dec 2024 15:30:38 +0000 Subject: [PATCH] format: make the code prettier --- apps/api/app/api/[[...route]]/contributors.ts | 15 +++++------ apps/api/app/api/[[...route]]/route.ts | 9 +++---- apps/www/app/(routes)/about/page.tsx | 25 ++++++++----------- apps/www/app/layout.tsx | 2 +- apps/www/next.config.ts | 2 +- 5 files changed, 23 insertions(+), 30 deletions(-) diff --git a/apps/api/app/api/[[...route]]/contributors.ts b/apps/api/app/api/[[...route]]/contributors.ts index c6a5a6e..61d553c 100644 --- a/apps/api/app/api/[[...route]]/contributors.ts +++ b/apps/api/app/api/[[...route]]/contributors.ts @@ -1,14 +1,11 @@ import { Hono } from "hono"; import { cache } from "@repo/cache"; -const app = new Hono() - .get("/", async (c) => { - const contributorsData = await cache.lrange("contributors", 0, -1); - return c.json({ - contributorsData - }); - }) - - +const app = new Hono().get("/", async (c) => { + const contributorsData = await cache.lrange("contributors", 0, -1); + return c.json({ + contributorsData, + }); +}); export default app; diff --git a/apps/api/app/api/[[...route]]/route.ts b/apps/api/app/api/[[...route]]/route.ts index 2d091e7..f7111bd 100644 --- a/apps/api/app/api/[[...route]]/route.ts +++ b/apps/api/app/api/[[...route]]/route.ts @@ -8,7 +8,7 @@ import auth from "./auth"; import status from "./status"; import health from "./health"; import user from "./user"; -import contributors from "./contributors" +import contributors from "./contributors"; import { cors } from "hono/cors"; export const runtime = "edge"; @@ -26,13 +26,12 @@ const allowedOrigins = [ "https://app.plura.pro", ]; - app.use( - '*', + "*", cors({ origin: allowedOrigins, // Allow requests from your frontend origin - allowMethods: ['GET', 'POST', 'OPTIONS'], - }) + allowMethods: ["GET", "POST", "OPTIONS"], + }), ); app.route("/health", health); diff --git a/apps/www/app/(routes)/about/page.tsx b/apps/www/app/(routes)/about/page.tsx index 0621ffd..b665fdb 100644 --- a/apps/www/app/(routes)/about/page.tsx +++ b/apps/www/app/(routes)/about/page.tsx @@ -1,4 +1,4 @@ -"use client" +"use client"; import ContributorsGrid from "@/components/custom/contributors-grid"; import { SectionHeader, @@ -20,26 +20,24 @@ type ContributorData = { export default function About() { const [contributors, setContributors] = useState([]); const fetchUrl = - process.env.NODE_ENV === 'production' - ? 'https://app.plura.pro/api/contributors' - : 'http://localhost:3001/api/contributors'; + process.env.NODE_ENV === "production" + ? "https://app.plura.pro/api/contributors" + : "http://localhost:3001/api/contributors"; useEffect(() => { const fetchContributors = async () => { - try{ - const response = await fetch(fetchUrl); - const data = await response.json(); - console.log(data); - setContributors(data.contributorsData); - }catch (e){ + try { + const response = await fetch(fetchUrl); + const data = await response.json(); + console.log(data); + setContributors(data.contributorsData); + } catch (e) { console.log(e); } }; fetchContributors(); }, []); - - return (
@@ -73,9 +71,8 @@ export default function About() { className="m-20 transition-all duration-200 hover:brightness-[0.8] grayscale rounded-2xl hover:grayscale-0 object-cover object-center shadow-lg border-2 p-1 border-dashed" /> -
- +
diff --git a/apps/www/app/layout.tsx b/apps/www/app/layout.tsx index d5c94c2..0699b03 100644 --- a/apps/www/app/layout.tsx +++ b/apps/www/app/layout.tsx @@ -33,7 +33,7 @@ export default function RootLayout({ - + ); } diff --git a/apps/www/next.config.ts b/apps/www/next.config.ts index 3f86d91..d92e68b 100644 --- a/apps/www/next.config.ts +++ b/apps/www/next.config.ts @@ -8,7 +8,7 @@ const nextConfig: NextConfig = { ignoreBuildErrors: true, }, images: { - domains: ['avatars.githubusercontent.com'], + domains: ["avatars.githubusercontent.com"], }, reactStrictMode: true, };