Skip to content

Commit

Permalink
layout fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
marekzelinka committed Feb 14, 2025
1 parent ebdee46 commit 00f2da5
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 28 deletions.
7 changes: 2 additions & 5 deletions app/layouts/search.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,12 @@ import { SearchBar } from "~/components/search-bar";
export default function SearchLayout() {
return (
<div className="min-h-full">
<header className="bg-gray-800 pb-24 [color-scheme:dark]">
<header className="bg-gray-800 pb-24 scheme-dark">
<div className="mx-auto max-w-3xl px-2 sm:px-4 lg:px-8">
<div className="relative flex items-center justify-between py-5">
<div className="flex items-center max-lg:px-2">
<div className="flex flex-none items-center gap-3">
<div className="flex-none">
<Logo className="h-6 w-auto text-sky-500" />
<span className="text-base font-medium text-white max-md:hidden">
DevFinder
</span>
</div>
</div>
<div className="flex flex-1 justify-end px-2 md:ml-6">
Expand Down
7 changes: 7 additions & 0 deletions app/lib/format.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export const decimalFormatter = new Intl.NumberFormat("en-GB", {
style: "decimal",
});

export const dateFormatter = new Intl.DateTimeFormat("en-GB", {
dateStyle: "medium",
});
38 changes: 15 additions & 23 deletions app/routes/search-result.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -90,21 +91,19 @@ export default function Results({ loaderData }: Route.ComponentProps) {
</Select>
<ChevronDownIcon className="pointer-events-none col-start-1 row-start-1 mr-2 size-5 self-center justify-self-end text-gray-500" />
</div>
<TabList
as="nav"
aria-label="Tabs"
className="flex gap-4 max-sm:hidden"
>
{tabs.map((tab) => (
<Tab
key={tab.name}
className="rounded-md px-3 py-2 text-sm font-medium text-gray-600 focus:outline-none data-focus:outline-1 data-focus:outline-white data-hover:text-gray-800 data-selected:bg-gray-200 data-selected:text-gray-800"
>
{tab.name}
</Tab>
))}
</TabList>
<TabPanels className="overflow-hidden bg-white shadow-sm sm:rounded-lg">
<div className="max-sm:hidden">
<TabList as="nav" aria-label="Tabs" className="flex gap-4">
{tabs.map((tab) => (
<Tab
key={tab.name}
className="rounded-md px-3 py-2 text-sm font-medium text-gray-600 focus:outline-none data-focus:outline-1 data-focus:outline-white data-hover:text-gray-800 data-selected:bg-gray-200 data-selected:text-gray-800"
>
{tab.name}
</Tab>
))}
</TabList>
</div>
<TabPanels className="overflow-hidden rounded-lg bg-white shadow-sm">
{tabs.map((tab) => (
<TabPanel key={tab.name}>{tab.children}</TabPanel>
))}
Expand All @@ -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,
Expand All @@ -131,6 +122,7 @@ function UserInfoCard({ user }: { user: User }) {

return (
<div className="overflow-hidden rounded-lg bg-white shadow-sm">
<h2 className="sr-only">Profile Overview</h2>
<div className="bg-white p-6">
<div className="sm:flex sm:items-center sm:justify-between">
<div className="sm:flex sm:space-x-5">
Expand Down

0 comments on commit 00f2da5

Please sign in to comment.