Skip to content

Commit

Permalink
fixed linting
Browse files Browse the repository at this point in the history
  • Loading branch information
gpalmer27 committed Feb 14, 2025
1 parent 03a0c3d commit 77c9c61
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 125 deletions.
3 changes: 0 additions & 3 deletions apps/web/src/app/(pages)/(dashboard)/roles/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import { useEffect, useState } from "react";
import { z } from "zod";

import type {
ReviewType,
RoleType,
WorkEnvironmentType,
WorkTermType,
Expand All @@ -15,10 +14,8 @@ import { useToast } from "@cooper/ui/hooks/use-toast";

import LoadingResults from "~/app/_components/loading-results";
import NoResults from "~/app/_components/no-results";
import { ReviewCard } from "~/app/_components/reviews/review-card";
import { RoleCardPreview } from "~/app/_components/reviews/role-card-preview";
import { RoleInfo } from "~/app/_components/reviews/role-info";
import SearchFilter from "~/app/_components/search/search-filter";
import { api } from "~/trpc/react";

export default function Roles({
Expand Down
56 changes: 10 additions & 46 deletions apps/web/src/app/_components/reviews/review-card.tsx
Original file line number Diff line number Diff line change
@@ -1,60 +1,24 @@
"use client";

import Image from "next/image";
import type { ReviewType } from "@cooper/db/schema";
import { Card, CardContent } from "@cooper/ui/card";

import type {
ReviewType,
RoleType,
WorkEnvironmentType,
} from "@cooper/db/schema";
import { cn } from "@cooper/ui";
import { Card, CardContent, CardHeader, CardTitle } from "@cooper/ui/card";

import { api } from "~/trpc/react";
import { listBenefits } from "~/utils/reviewsAggregationHelpers";
import { prettyWorkEnviornment } from "~/utils/stringHelpers";
import { ReviewCardStars } from "./review-card-stars";

const InterviewDifficulty = [
{ des: "Very Easy", color: "text-[#4bc92e]" },
{ des: "Easy", color: "text-[#09b52b]" },
{ des: "Neither Easy Nor Difficult", color: "text-cooper-blue-400" },
{ des: "Difficult", color: "text-[#f27c38]" },
{ des: "Very Difficult", color: "text-[#f52536]" },
];

const yellowStar = (
<svg
xmlns="http://www.w3.org/2000/svg"
width="19"
height="17"
viewBox="0 0 19 17"
fill="none"
>
<path
d="M8.57668 1.21993C8.91827 0.398637 10.0817 0.398636 10.4233 1.21993L12.0427 5.11343C12.1867 5.45967 12.5123 5.69624 12.8861 5.72621L17.0895 6.06319C17.9761 6.13427 18.3357 7.24078 17.6601 7.81945L14.4576 10.5627C14.1728 10.8067 14.0485 11.1895 14.1355 11.5542L15.1139 15.656C15.3203 16.5212 14.379 17.2051 13.6199 16.7414L10.0213 14.5434C9.70124 14.3479 9.29876 14.3479 8.97875 14.5434L5.38008 16.7414C4.62098 17.2051 3.67973 16.5212 3.88611 15.656L4.86454 11.5542C4.95154 11.1895 4.82717 10.8067 4.54238 10.5627L1.33986 7.81945C0.664326 7.24078 1.02385 6.13427 1.91051 6.06319L6.11387 5.72621C6.48766 5.69624 6.81327 5.45967 6.95728 5.11343L8.57668 1.21993Z"
fill="#FFA400"
/>
</svg>
);
// const InterviewDifficulty = [
// { des: "Very Easy", color: "text-[#4bc92e]" },
// { des: "Easy", color: "text-[#09b52b]" },
// { des: "Neither Easy Nor Difficult", color: "text-cooper-blue-400" },
// { des: "Difficult", color: "text-[#f27c38]" },
// { des: "Very Difficult", color: "text-[#f52536]" },
// ];

interface ReviewCardProps {
className?: string;
reviewObj: ReviewType;
}

export function ReviewCard({ className, reviewObj }: ReviewCardProps) {
// ===== COMPANY DATA ===== //
const company = api.company.getById.useQuery({ id: reviewObj.companyId });

// ===== ROLE DATA ===== //
const role = api.role.getById.useQuery({ id: reviewObj.roleId });

// ===== REVIEW TEXT ===== //
const reviewText = reviewObj.textReview;

// Benefits
const benefits = listBenefits(reviewObj);
export function ReviewCard({ reviewObj }: ReviewCardProps) {
return (
<Card className="mx-auto w-[94%]">
<div className="flex pt-5">
Expand Down
14 changes: 2 additions & 12 deletions apps/web/src/app/_components/reviews/role-card-preview.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,10 @@
"use client";

import Image from "next/image";

import type { ReviewType, RoleType } from "@cooper/db/schema";
import type { RoleType } from "@cooper/db/schema";
import { cn } from "@cooper/ui";
import {
Card,
CardContent,
CardFooter,
CardHeader,
CardTitle,
} from "@cooper/ui/card";
import { Card, CardContent, CardHeader, CardTitle } from "@cooper/ui/card";

import { ReviewCardStars } from "~/app/_components/reviews/review-card-stars";
import { api } from "~/trpc/react";
import { truncateText } from "~/utils/stringHelpers";

interface RoleCardPreviewProps {
className?: string;
Expand Down
73 changes: 9 additions & 64 deletions apps/web/src/app/_components/reviews/role-info.tsx
Original file line number Diff line number Diff line change
@@ -1,30 +1,22 @@
"use client";

import type { inferRouterOutputs } from "@trpc/server";
import Image from "next/image";

import type { AppRouter } from "@cooper/api";
import type {
ReviewType,
RoleType,
WorkEnvironmentType,
} from "@cooper/db/schema";
import type { RoleType } from "@cooper/db/schema";
import { cn } from "@cooper/ui";
import { Card, CardContent, CardHeader, CardTitle } from "@cooper/ui/card";

import { api } from "~/trpc/react";
import { listBenefits } from "~/utils/reviewsAggregationHelpers";
import { prettyWorkEnviornment } from "~/utils/stringHelpers";
import { ReviewCard } from "./review-card";
import { ReviewCardStars } from "./review-card-stars";

const InterviewDifficulty = [
{ des: "Very Easy", color: "text-[#4bc92e]" },
{ des: "Easy", color: "text-[#09b52b]" },
{ des: "Neither Easy Nor Difficult", color: "text-cooper-blue-400" },
{ des: "Difficult", color: "text-[#f27c38]" },
{ des: "Very Difficult", color: "text-[#f52536]" },
];
// const InterviewDifficulty = [
// { des: "Very Easy", color: "text-[#4bc92e]" },
// { des: "Easy", color: "text-[#09b52b]" },
// { des: "Neither Easy Nor Difficult", color: "text-cooper-blue-400" },
// { des: "Difficult", color: "text-[#f27c38]" },
// { des: "Very Difficult", color: "text-[#f52536]" },
// ];

const yellowStar = (
<svg
Expand Down Expand Up @@ -135,7 +127,7 @@ export function RoleInfo({ className, roleObj }: RoleCardProps) {
(() => {
const totalPay = reviews.data.reduce(
(sum, review) =>
sum + parseFloat(review.hourlyPay || "0"),
sum + parseFloat(review.hourlyPay ?? "0"),
0.0,
);
const averagePay = totalPay / reviews.data.length;
Expand Down Expand Up @@ -172,53 +164,6 @@ export function RoleInfo({ className, roleObj }: RoleCardProps) {
);
})()}
</CardContent>
{/* <CardContent className="grid gap-2 justify-end">
{reviews.isSuccess && reviews.data.length > 0 && (() => {
const totalInterviewDifficulty = reviews.data.reduce((sum, review) => sum + review.interviewDifficulty, 0);
const averageInterviewDifficulty = (totalInterviewDifficulty / reviews.data.length);
return (
<>
<div className="flex align-center gap-2">
Interview Difficulty
</div>
<div className="flex align-center gap-2">
{averageInterviewDifficulty}
</div>
</>
);
})()}
</CardContent> */}
</div>
</Card>

<Card className="mx-auto w-[94%] rounded-3xl bg-cooper-gray-200">
<div className="align-center flex">
{/* <CardContent className="pt-2 grid grid-cols-3 mx-auto h-full w-full">
<div>
Drug Test {reviewObj.drugTest}
</div>
<div>
Federal holidays {reviewObj.federalHolidays}
</div>
<div>
Free merch {reviewObj.freeMerch}
</div>
<div>
Overtime {reviewObj.overtimeNormal}
</div>
<div>
Lunch provided {reviewObj.freeLunch}
</div>
<div>
Other benefits {reviewObj.otherBenefits}
</div>
<div>
PTO {reviewObj.pto}
</div>
<div>
Transportation {reviewObj.freeTransport}
</div>
</CardContent> */}
</div>
</Card>

Expand Down

0 comments on commit 77c9c61

Please sign in to comment.