Skip to content

Commit

Permalink
format: make the code prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Dec 2, 2024
1 parent 1c66f00 commit 8262f0d
Show file tree
Hide file tree
Showing 5 changed files with 23 additions and 30 deletions.
15 changes: 6 additions & 9 deletions apps/api/app/api/[[...route]]/contributors.ts
Original file line number Diff line number Diff line change
@@ -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;
9 changes: 4 additions & 5 deletions apps/api/app/api/[[...route]]/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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);
Expand Down
25 changes: 11 additions & 14 deletions apps/www/app/(routes)/about/page.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"use client"
"use client";
import ContributorsGrid from "@/components/custom/contributors-grid";
import {
SectionHeader,
Expand All @@ -20,26 +20,24 @@ type ContributorData = {
export default function About() {
const [contributors, setContributors] = useState<ContributorData[]>([]);
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 (
<section className="flex flex-col items-center md:items-start justify-center overflow-hidden">
<div className="absolute inset-0 mx-auto h-full w-full bg-[radial-gradient(circle,rgba(211,211,211,0.1),rgba(18,20,22,0.05),rgba(18,20,22,0))] opacity-60" />
Expand Down Expand Up @@ -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"
/>
</Card>

</div>
<ContributorsGrid data={contributors}/>
<ContributorsGrid data={contributors} />
</section>
</div>
</section>
Expand Down
2 changes: 1 addition & 1 deletion apps/www/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export default function RootLayout({
</ThemeProvider>
<Toaster />
</body>
</PosthogProvider>
</PosthogProvider>
</html>
);
}
2 changes: 1 addition & 1 deletion apps/www/next.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const nextConfig: NextConfig = {
ignoreBuildErrors: true,
},
images: {
domains: ['avatars.githubusercontent.com'],
domains: ["avatars.githubusercontent.com"],
},
reactStrictMode: true,
};
Expand Down

0 comments on commit 8262f0d

Please sign in to comment.