From 00f2da552b861f922d25f78ff856d628a340f26e Mon Sep 17 00:00:00 2001 From: Marek Zelinka Date: Fri, 14 Feb 2025 11:44:19 +0100 Subject: [PATCH] layout fixes --- app/layouts/search.tsx | 7 ++----- app/lib/format.ts | 7 +++++++ app/routes/search-result.tsx | 38 ++++++++++++++---------------------- 3 files changed, 24 insertions(+), 28 deletions(-) create mode 100644 app/lib/format.ts diff --git a/app/layouts/search.tsx b/app/layouts/search.tsx index f36f7f8..6a54f22 100644 --- a/app/layouts/search.tsx +++ b/app/layouts/search.tsx @@ -5,15 +5,12 @@ import { SearchBar } from "~/components/search-bar"; export default function SearchLayout() { return (
-
+
-
+
- - DevFinder -
diff --git a/app/lib/format.ts b/app/lib/format.ts new file mode 100644 index 0000000..6f2934c --- /dev/null +++ b/app/lib/format.ts @@ -0,0 +1,7 @@ +export const decimalFormatter = new Intl.NumberFormat("en-GB", { + style: "decimal", +}); + +export const dateFormatter = new Intl.DateTimeFormat("en-GB", { + dateStyle: "medium", +}); diff --git a/app/routes/search-result.tsx b/app/routes/search-result.tsx index fef07fd..886ef02 100644 --- a/app/routes/search-result.tsx +++ b/app/routes/search-result.tsx @@ -13,6 +13,7 @@ import { useState, type CSSProperties } from "react"; import { data, redirect } from "react-router"; import { EmptyState } from "~/components/empty-state"; import { GeneralErrorBoundary } from "~/components/error-boundary"; +import { dateFormatter, decimalFormatter } from "~/lib/format"; import { getUserByLogin } from "~/lib/github.server"; import type { User } from "~/types"; import type { Route } from "./+types/search-result"; @@ -90,21 +91,19 @@ export default function Results({ loaderData }: Route.ComponentProps) {
- - {tabs.map((tab) => ( - - {tab.name} - - ))} - - +
+ + {tabs.map((tab) => ( + + {tab.name} + + ))} + +
+ {tabs.map((tab) => ( {tab.children} ))} @@ -114,14 +113,6 @@ export default function Results({ loaderData }: Route.ComponentProps) { ); } -const decimalFormatter = new Intl.NumberFormat("en-GB", { - style: "decimal", -}); - -const dateFormatter = new Intl.DateTimeFormat("en-GB", { - dateStyle: "medium", -}); - function UserInfoCard({ user }: { user: User }) { const stats = { Repositories: user.repositories.totalCount, @@ -131,6 +122,7 @@ function UserInfoCard({ user }: { user: User }) { return (
+

Profile Overview