Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rewrite Landing Page #17

Merged
merged 23 commits into from
Dec 3, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
2c44728
docs: Add exclamation mark
knht Nov 7, 2024
e1ba50f
feat: Create initial project scaffold
knht Nov 7, 2024
22347ca
feat: Create basic layout scaffold
knht Nov 8, 2024
78a8a18
feat: Add the Zufall Labs custom font, add the tailwind config for th…
Colin23 Nov 9, 2024
d4ccc4a
config: Configure prettier
Colin23 Nov 9, 2024
7c1adb0
refactor: Refactor existing files to adhere to the prettier config
Colin23 Nov 9, 2024
e9f549d
feat: Add the head<> element for the website and add href links for m…
Colin23 Nov 9, 2024
2c8df75
config: Add and configure the 'prettier-plugin-tailwindcss'
Colin23 Nov 9, 2024
0193c0e
refactor: Refactor all files to adhere to the new prettier config
Colin23 Nov 9, 2024
87c670b
chore: Update dependencies and deprecated functions
Colin23 Nov 9, 2024
d4f28ed
config: Add custom viewport breakpoints for desktop-first support
knht Nov 16, 2024
29d2ba2
feat: Add medium to large sized mobile view support
knht Nov 16, 2024
93c6652
deps: Add TailwindCSS Scrollbar Plugin
knht Nov 17, 2024
c2c567e
feat: Add feature carousel component
knht Nov 17, 2024
2931e1c
feat: Make use of new Carousel component
knht Nov 17, 2024
232829d
feat(responsiveness): Add tablet viewport support
knht Dec 1, 2024
5211fd2
feat(design): Move background gradient to root body of SPA
knht Dec 1, 2024
f7d5501
feat: Enable text carousel API support
knht Dec 1, 2024
656f948
feat(content): Add a hero description
knht Dec 1, 2024
b548aa1
feat: Remove PR entries from text carousel
knht Dec 1, 2024
50230ce
feat: Add touch support
knht Dec 1, 2024
c51650d
fix: Prevent event defaults when scrolling or touching
knht Dec 1, 2024
eba0efd
feat: Add footer and replace placeholder text
knht Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 11 additions & 6 deletions app/routes/api.issues.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import type { LoaderFunction } from "@remix-run/node";
import { json } from "@remix-run/node";
import { z } from "zod";
import type { RepoIssues, GitHubLoaderData } from "~/types/github";
import type { GitHubLoaderData, RepoIssues } from "~/types/github";

const CONFIG = {
OWNER: "zufall-labs",
Expand Down Expand Up @@ -36,7 +35,8 @@ export const loader: LoaderFunction = async () => {
const now = Date.now();

if (cachedData && now < cacheExpiration) {
return json<GitHubLoaderData>({ data: cachedData });
const responseData: GitHubLoaderData = { data: cachedData };
return Response.json(responseData);
}

try {
Expand All @@ -57,14 +57,19 @@ export const loader: LoaderFunction = async () => {
cachedData = issuesByRepo;
cacheExpiration = now + CONFIG.CACHE_DURATION;

return json<GitHubLoaderData>({ data: issuesByRepo });
const responseData: GitHubLoaderData = { data: issuesByRepo };
return Response.json(responseData);
} catch (error) {
console.error("Error fetching issues:", error);

if (error instanceof z.ZodError) {
return json({ error: "Invalid environment configuration", details: error.errors }, { status: 500 });
return Response.json(
{ error: "Invalid environment configuration", details: error.errors },
{ status: 500 }
);
}

return json<GitHubLoaderData>({ data: [] });
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why was this changed?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Because it will be deprecated in React Routerv7.
image

This is an official flag comming from Remix. Therefore I don't think they will do any changes or handle it under the hood. See Remix changelog and Remix PR. If they choose to change anything so that json can be used again, we could change it any time we want to. But to stay future proof and up to date with official Remix releases, I would suggest keeping my change.

const responseData: GitHubLoaderData = { data: [] };
return Response.json(responseData);
}
};
11 changes: 6 additions & 5 deletions app/routes/apitest.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// app/routes/dashboard.tsx
import { json, type LoaderFunction } from "@remix-run/node";
import { type LoaderFunction } from "@remix-run/node";
import { useLoaderData } from "@remix-run/react";
import type { GitHubLoaderData } from "~/types/github";

Expand All @@ -10,14 +10,15 @@ export const loader: LoaderFunction = async ({ request }) => {
try {
const response = await fetch(apiUrl);
if (!response.ok) {
throw new Error(`API returned ${response.status}`);
console.error(`API returned ${response.status}`);
}

const data = await response.json();
return json<GitHubLoaderData>(data);
const responseData: GitHubLoaderData = await response.json();
return Response.json(responseData);
} catch (error) {
console.error("Error fetching issues:", error);
return json<GitHubLoaderData>({ data: [] });
const responseData: GitHubLoaderData = { data: [] };
return Response.json(responseData);
}
};

Expand Down
Loading