Skip to content

Commit

Permalink
feat: begin creating Role Review Cards (#50)
Browse files Browse the repository at this point in the history
* feat: begin creating Role Review Cards

* feat: assembled Role Page

Made role review cards update based on db, put together components for roles page, made search bar
slightly more responsive, updated header logo sizing, edited logo font per design

* feat: create header layout component to standardize header placement

* fix: removed async from exports (not needed)

* fix: made search filter (whole bar) more responsive"

* fix: edit roles/page to prevent tRPC error.t3-oss/create-t3-app#1599

* docs: add TODO and FIXME tags

* refactor: implemented changes suggested in PR. Started to work on style changes for header
  • Loading branch information
banushi-a authored Mar 31, 2024
1 parent 3019fbe commit 55a7d93
Show file tree
Hide file tree
Showing 28 changed files with 507 additions and 101 deletions.
Binary file modified public/favicon.ico
Binary file not shown.
Binary file added public/fonts/AltivoMedium.otf
Binary file not shown.
Binary file added public/fonts/AltivoRegular.otf
Binary file not shown.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
28 changes: 28 additions & 0 deletions public/svg/hidingLogo.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
27 changes: 0 additions & 27 deletions public/svg/logo.svg

This file was deleted.

8 changes: 3 additions & 5 deletions src/app/companies/page.tsx
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
import Header from "~/components/header";
import HeaderLayout from "~/components/header-layout";
import SearchFilter from "~/components/search-filter";

export default async function Companies() {
return (
<div className="flex h-full flex-col">
<Header />

<div className="mx-12 mt-16 flex flex-col">
<HeaderLayout>
<SearchFilter />
</div>
</HeaderLayout>
</div>
);
}
42 changes: 7 additions & 35 deletions src/app/layout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,7 @@ import "~/styles/globals.css";
import { TRPCReactProvider } from "~/trpc/react";
import { Toaster } from "~/components/ui/sonner";
import { cn } from "~/lib/utils";

import localFont from "next/font/local";

// Font files can be colocated inside of `pages`
const myFont = localFont({
src: [
{
path: "./fonts/BentonSansBook.otf",
weight: "300",
style: "normal",
},
{
path: "./fonts/BentonSansRegular.otf",
weight: "500",
style: "normal",
},
{
path: "./fonts/BentonSansMedium.otf",
weight: "700",
style: "normal",
},
{
path: "./fonts/BentonSansBold.otf",
weight: "900",
style: "normal",
},
],
});
import { bentonSansFont } from "~/styles/font";

export const metadata = {
title: "Cooper",
Expand All @@ -43,13 +16,12 @@ export default function RootLayout({
children: React.ReactNode;
}) {
return (
<html lang="en" suppressHydrationWarning>
<body
className={cn(
"min-h-screen bg-background font-sans antialiased",
myFont.className,
)}
>
<html
className={bentonSansFont.variable}
lang="en"
suppressHydrationWarning
>
<body className={cn("min-h-screen bg-white font-sans antialiased")}>
<TRPCReactProvider>{children}</TRPCReactProvider>
<Toaster />
</body>
Expand Down
17 changes: 9 additions & 8 deletions src/app/page.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
import Header from "~/components/header";
import HeaderLayout from "~/components/header-layout";
import SearchFilter from "~/components/search-filter";

export default async function Home() {
return (
<div className="flex h-[85vh] flex-col">
<Header />
<div className="flex h-full flex-col items-center justify-center">
<p className="mb-8 text-2xl font-semibold">
Search your dream co-op role!
</p>
<SearchFilter />
</div>
<HeaderLayout>
<div className="flex h-full flex-col items-center justify-center">
<p className="mb-8 text-2xl font-semibold">
Search your dream co-op role!
</p>
<SearchFilter />
</div>
</HeaderLayout>
</div>
);
}
30 changes: 30 additions & 0 deletions src/app/roles/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
import HeaderLayout from "~/components/header-layout";
import { RoleReviewCard } from "~/components/role-review-card";
import SearchFilter from "~/components/search-filter";
import { api } from "~/trpc/server";
import { unstable_noStore as noStore } from "next/cache";

export default async function Roles() {
/**
* FIXME: This is a temporary fix, figure out how to get build command working without noStore();
* @returns A promise containing the roles from the database
*/
async function getRoles() {
noStore();
const roles = await api.role.list.query();
return roles;
}

const roles = await getRoles();

return (
<HeaderLayout>
<SearchFilter />
<div className="grid grid-cols-1 gap-4 md:grid-cols-2 xl:grid-cols-3">
{roles.map((role) => {
return <RoleReviewCard key={role.id} roleObj={role} />;
})}
</div>
</HeaderLayout>
);
}
18 changes: 18 additions & 0 deletions src/components/header-layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
import { ReactNode } from "react";
import Header from "~/components/header";

/**
* This should be used when placing content under the header, standardizes how children are placed under a header.
* @param param0 Children to pass into the layout
* @returns A layout component that standardizes the distance from the header
*/
export default function HeaderLayout({ children }: { children: ReactNode }) {
return (
<div className="flex min-h-screen flex-col">
<Header />
<article className="mt-16 flex flex-col items-center justify-center">
{children}
</article>
</div>
);
}
Loading

0 comments on commit 55a7d93

Please sign in to comment.