Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchernchong committed Dec 2, 2024
1 parent a4a6873 commit b286d6e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 deletions.
13 changes: 9 additions & 4 deletions app/(dashboard)/cars/makes/[make]/columns.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
import Link from "next/link";
import { ArrowUpDown } from "lucide-react";
import { Button } from "@/components/ui/button";
import { deslugify, slugify } from "@/utils/slugify";
import type { Car } from "@/types";
import type { ColumnDef } from "@tanstack/react-table";

Expand All @@ -25,19 +26,23 @@ export const columns: ColumnDef<Car>[] = [
accessorKey: "fuel_type",
header: "Fuel Type",
cell: ({ row }) => {
const type = row.getValue("fuel_type") as string;
const type: string = row.getValue("fuel_type");
return (
<Link href={`/cars/fuel-types/${type.toLowerCase()}`}>{type}</Link>
<Link href={`/cars/fuel-types/${slugify(type)}`}>
{deslugify(type)}
</Link>
);
},
},
{
accessorKey: "vehicle_type",
header: "Vehicle Type",
cell: ({ row }) => {
const type = row.getValue("vehicle_type") as string;
const type: string = row.getValue("vehicle_type");
return (
<Link href={`/cars/vehicle-types/${type.toLowerCase()}`}>{type}</Link>
<Link href={`/cars/vehicle-types/${slugify(type)}`}>
{deslugify(type)}
</Link>
);
},
},
Expand Down
10 changes: 1 addition & 9 deletions config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,6 @@ const DEFAULT_API_URL = `https://api.${DOMAIN_NAME}`;
const API_BASE_URL = process.env.NEXT_PUBLIC_API_URL ?? DEFAULT_API_URL;
export const API_URL = `${API_BASE_URL}/${API_VERSION}`;

/**
* List of make to be excluded from the dataset because they are usually part of the following:
* - BlueSG (BLUECAR)
* - Private Hire Cars (PHC)
*/
export const EXCLUSION_LIST: string[] = ["BLUECAR"];
export const POPULAR_MAKES_THRESHOLD: number = 8;

export enum FUEL_TYPE {
DIESEL = "Diesel",
ELECTRIC = "Electric",
Expand All @@ -34,7 +26,7 @@ export enum FUEL_TYPE {

export const HYBRID_REGEX = /^(Diesel|Petrol)-(Electric)(\s\(Plug-In\))?$/;

export const ANNOUNCEMENT = "";
export const ANNOUNCEMENT = null;

// export const ANNOUNCEMENT =
// "🌟 Big Updates Ahead! Our website is getting an upgrade with awesome new features rolling out soon. Stay tuned!";
Expand Down

0 comments on commit b286d6e

Please sign in to comment.