Skip to content

Commit

Permalink
Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
ruchernchong committed Nov 9, 2024
2 parents 9783479 + 4cc7f55 commit 67e6793
Show file tree
Hide file tree
Showing 27 changed files with 686 additions and 636 deletions.
6 changes: 0 additions & 6 deletions .github/workflows/sst.dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -58,12 +58,6 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
# - uses: actions/cache@v4
# with:
# path: ${{ github.workspace }}/.next/cache
# key: ${{ runner.OS }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# restore-keys: |
# ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.ROLE_TO_ASSUME }}
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/sst.prod.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
name: Deployment (Production)
on:
push:
branches:
- 'release/*'
tags:
- 'v[0-9]+.[0-9]+.[0-9]+'
- 'v[0-9]+.[0-9]+.[0-9]+-beta.[0-9]+'
Expand Down Expand Up @@ -38,12 +36,6 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
# - uses: actions/cache@v4
# with:
# path: ${{ github.workspace }}/.next/cache
# key: ${{ runner.OS }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# restore-keys: |
# ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.ROLE_TO_ASSUME }}
Expand Down
7 changes: 1 addition & 6 deletions .github/workflows/sst.staging.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ on:
push:
branches:
- 'main'
- 'release/*'
tags-ignore:
- "*"

Expand Down Expand Up @@ -59,12 +60,6 @@ jobs:
cache: 'pnpm'
- name: Install dependencies
run: pnpm install
# - uses: actions/cache@v4
# with:
# path: ${{ github.workspace }}/.next/cache
# key: ${{ runner.OS }}-nextjs-${{ hashFiles('**/package-lock.json') }}-${{ hashFiles('**/*.js', '**/*.jsx', '**/*.ts', '**/*.tsx') }}
# restore-keys: |
# ${{ runner.os }}-nextjs-${{ hashFiles('**/package-lock.json') }}-
- uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: ${{ vars.ROLE_TO_ASSUME }}
Expand Down
71 changes: 71 additions & 0 deletions app/@breadcrumbs/[...slug]/page.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
import { Fragment } from "react";
import Link from "next/link";
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbLink,
BreadcrumbList,
BreadcrumbPage,
BreadcrumbSeparator,
} from "@/components/ui/breadcrumb";

interface Props {
params: {
slug: string[];
};
}

interface BreadcrumbItem {
href: string;
label: string;
isLastItem: boolean;
}

const BREADCRUMB_MAP: Record<string, string> = {
coe: "COE",
};

const capitaliseWords = (text: string): string =>
text
.split("-")
.map((word) => word.charAt(0).toUpperCase() + word.slice(1))
.join(" ");

const generateBreadcrumbs = (slug: string[]): BreadcrumbItem[] =>
slug.map((segment, index) => ({
href: `/${slug.slice(0, index + 1).join("/")}`,
label: BREADCRUMB_MAP[segment] ?? capitaliseWords(segment),
isLastItem: index === slug.length - 1,
}));

const Breadcrumbs = ({ params }: Props) => {
const breadcrumbs = generateBreadcrumbs(params.slug);

return (
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbLink asChild>
<Link href="/">Home</Link>
</BreadcrumbLink>
</BreadcrumbItem>
{breadcrumbs.map(({ isLastItem, href, label }) => (
<Fragment key={href}>
<BreadcrumbSeparator />
<BreadcrumbItem>
{isLastItem ? (
<BreadcrumbPage>{label}</BreadcrumbPage>
) : (
<BreadcrumbLink asChild>
<Link href={href}>{label}</Link>
</BreadcrumbLink>
)}
</BreadcrumbItem>
</Fragment>
))}
</BreadcrumbList>
</Breadcrumb>
);
};

export default Breadcrumbs;
20 changes: 20 additions & 0 deletions app/@breadcrumbs/default.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import {
Breadcrumb,
BreadcrumbItem,
BreadcrumbList,
BreadcrumbPage,
} from "@/components/ui/breadcrumb";

const DefaultBreadcrumb = () => {
return (
<Breadcrumb>
<BreadcrumbList>
<BreadcrumbItem>
<BreadcrumbPage>Home</BreadcrumbPage>
</BreadcrumbItem>
</BreadcrumbList>
</Breadcrumb>
);
};

export default DefaultBreadcrumb;
183 changes: 0 additions & 183 deletions app/cars/[type]/page.tsx

This file was deleted.

File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export const columns: ColumnDef<Car>[] = [
header: "Vehicle Type",
cell: ({ row }) => {
const type = row.getValue("vehicle_type") as string;
return <Link href={`/vehicle-type/${type.toLowerCase()}`}>{type}</Link>;
return <Link href={`/vehicle-types/${type.toLowerCase()}`}>{type}</Link>;
},
},
{
Expand Down
Loading

0 comments on commit 67e6793

Please sign in to comment.