Skip to content

Commit

Permalink
[tech debt] updated tech debt and fixed build errors after tech debt …
Browse files Browse the repository at this point in the history
…update
  • Loading branch information
Alfredoeb9 committed Oct 23, 2024
1 parent 6c6db7b commit 09e7c20
Show file tree
Hide file tree
Showing 32 changed files with 3,920 additions and 3,233 deletions.
1 change: 0 additions & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
/** @type {import("eslint").Linter.Config} */
const config = {
parser: "@typescript-eslint/parser",
parserOptions: {
Expand Down
9 changes: 4 additions & 5 deletions drizzle.config.ts
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
import { type Config } from "drizzle-kit";
import { defineConfig } from "drizzle-kit";

import { env } from "@/env";

export default {
export default defineConfig({
schema: "./src/server/db/schema.ts",
out: "./migrations",
driver: "turso",
dialect: "sqlite",
dialect: "turso",
dbCredentials: {
url: env.DATABASE_URL,
authToken: env.AUTH_TOKEN,
},
tablesFilter: ["ele_*"],
verbose: true,
strict: true,
} satisfies Config;
});
5,435 changes: 2,963 additions & 2,472 deletions package-lock.json

Large diffs are not rendered by default.

69 changes: 34 additions & 35 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,62 +17,61 @@
"stripe:add-cash": "stripe listen --forward-to localhost:3000/api/stripe-add-cash"
},
"dependencies": {
"@auth/drizzle-adapter": "0.7.0",
"@libsql/client": "0.10.0",
"@nextui-org/react": "2.2.9",
"@reduxjs/toolkit": "2.1.0",
"@auth/drizzle-adapter": "1.7.2",
"@libsql/client": "0.14.0",
"@nextui-org/react": "2.4.8",
"@reduxjs/toolkit": "2.3.0",
"@stripe/stripe-js": "2.4.0",
"@t3-oss/env-nextjs": "0.11.1",
"@tanstack/react-query": "5.25.0",
"@tanstack/react-query-devtools": "5.25.0",
"@tanstack/react-query": "5.59.15",
"@tanstack/react-query-devtools": "5.59.15",
"@trpc/client": "11.0.0-next-beta.316",
"@trpc/next": "11.0.0-next-beta.316",
"@trpc/react-query": "11.0.0-next-beta.316",
"@trpc/server": "11.0.0-next-beta.316",
"@vercel/analytics": "1.2.2",
"axios": "1.6.7",
"axios": "1.7.7",
"bcrypt": "5.1.1",
"drizzle-orm": "0.33.0",
"framer-motion": "11.0.3",
"handlebars": "4.7.8",
"jsonwebtoken": "9.0.2",
"moment": "2.30.1",
"next": "14.2.0",
"next-auth": "4.24.5",
"nodemailer": "6.9.9",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-icons": "5.0.1",
"react-redux": "9.1.0",
"react-toastify": "10.0.4",
"next": "14.2.15",
"next-auth": "4.24.8",
"nodemailer": "6.9.15",
"react": "18.3.0",
"react-dom": "18.3.0",
"react-icons": "5.3.0",
"react-redux": "9.1.2",
"react-toastify": "10.0.6",
"redux-thunk": "3.1.0",
"server-only": "0.0.1",
"stripe": "14.15.0",
"superjson": "2.2.1",
"validator": "13.11.0",
"zod": "3.22.4"
"validator": "13.12.0",
"zod": "3.23.8"
},
"devDependencies": {
"@types/bcrypt": "5.0.2",
"@types/eslint": "8.44.7",
"@types/jsonwebtoken": "9.0.5",
"@types/node": "18.17.0",
"@types/nodemailer": "6.4.14",
"@types/react": "18.2.37",
"@types/react-dom": "18.2.15",
"@types/validator": "13.11.9",
"@typescript-eslint/eslint-plugin": "6.11.0",
"@typescript-eslint/parser": "6.11.0",
"@types/eslint": "9.6.1",
"@types/jsonwebtoken": "9.0.7",
"@types/node": "22.7.8",
"@types/nodemailer": "6.4.16",
"@types/react": "18.3.11",
"@types/react-dom": "18.3.1",
"@types/validator": "13.12.2",
"@typescript-eslint/eslint-plugin": "8.11.0",
"@typescript-eslint/parser": "8.11.0",
"autoprefixer": "10.4.14",
"drizzle-kit": "0.24.2",
"eslint": "8.54.0",
"eslint-config-next": "14.0.4",
"mysql2": "3.9.9",
"postcss": "8.4.31",
"prettier": "3.1.0",
"prettier-plugin-tailwindcss": "0.5.7",
"tailwindcss": "3.3.5",
"typescript": "5.1.6"
"drizzle-kit": "0.26.2",
"eslint": "8.57.0",
"eslint-config-next": "14.2.15",
"postcss": "8.4.47",
"prettier": "3.3.3",
"prettier-plugin-tailwindcss": "0.6.8",
"tailwindcss": "3.4.14",
"typescript": "5.6.3"
},
"ct3aMetadata": {
"initVersion": "7.26.0"
Expand Down
18 changes: 9 additions & 9 deletions src/app/(profile)/tickets/[id]/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@ export default function UniqueTickets() {

const deleteTicket = api.user.deleteUniqueTicket.useMutation({
onSuccess: async () => {
await utils.user.getUserDataWithTickets.invalidate(),
toast(`Ticket: ${ticketFromUrl} has been deleted.`, {
position: "bottom-right",
autoClose: 3000,
closeOnClick: true,
draggable: false,
type: "success",
toastId: 78,
});
await utils.user.getUserDataWithTickets.invalidate();
toast(`Ticket: ${ticketFromUrl} has been deleted.`, {
position: "bottom-right",
autoClose: 3000,
closeOnClick: true,
draggable: false,
type: "success",
toastId: 78,
});

setTimeout(() => {
router.push("/tickets");
Expand Down
3 changes: 2 additions & 1 deletion src/app/(team)/team-settings/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,8 @@ export default function TeamSettings() {
className="text-red-500"
variant="bordered"
onPress={() => {
onOpen(), setModalPath("owner");
onOpen();
setModalPath("owner");
setTeamName(team.team_name);
setTeamId(team.id);
}}
Expand Down
16 changes: 16 additions & 0 deletions src/app/_components/home/HomeTournamentMatchFinder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,22 @@ import { Spinner } from "@nextui-org/react";
import { TournamentMatchFinderTable } from "./TournamentMatchFinderTable";
import { api } from "@/trpc/react";

// interface TournamentMatch {
// platform: string | string[];
// [key: string]: any;

// id: string;
// game: string;
// entry: string;
// team_size: string;
// competition?: string;
// rules: Record<string, string>[];
// start_time: string | null;
// support?: string;
// starting?: string;
// // info?: MatchFinderInfoProps[];
// }

export default function HomeTournamentMatchFinder() {
const tournamentMatches = api.matches.getAllTournaments.useQuery();

Expand Down
50 changes: 22 additions & 28 deletions src/app/_components/home/MoneyMatchFinderTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,26 @@ import { moneyMatchColumns } from "@/lib/sharedData";
import Link from "next/link";
import Image from "next/image";

interface MatchListProps {
data: MatchFinderTableProps[] | any;
}

interface MatchFinderTableProps {
id: number | string;
game: string;
platform: string;
entry: number;
team_size: string;
competition: string;
support: string;
starting: string;
matchId: string;
// game: string;
platform: any;
matchEntry: number;
// entry: string;
// team_size: string;
tournament_type?: string;
rules: any;
startTime: string | number | Date;
gameTitle: string;
support?: string;
starting?: string;
info?: MatchFinderInfoProps[];
}

interface MatchListProps {
data: MatchFinderTableProps[];
}

interface MatchFinderInfoProps {
pc_players: string;
snipers: string;
Expand All @@ -47,7 +51,7 @@ const statusColorMap: Record<string, ChipProps["color"]> = {
export const MoneyMatchFinderTable = ({ data }: MatchListProps) => {
if (!data) return null;

type Match = typeof data.matches;
type Match = MatchFinderTableProps;

// const [selectedKeys, setSelectedKeys] = useState<Selection>(new Set([]));
const [rowsPerPage, setRowsPerPage] = useState<number>(5);
Expand Down Expand Up @@ -119,18 +123,8 @@ export const MoneyMatchFinderTable = ({ data }: MatchListProps) => {
};

const renderCell = useCallback(
(
moneyMatch: {
[x: string]: any;
startTime: string | number | Date;
gameTitle: string;
platform: any[];
rules: (Record<string, string> | ArrayLike<ReactNode>)[] | undefined;
matchId: string;
},
columnKey: React.Key,
) => {
const cellValue = moneyMatch[columnKey as unknown as Match];
(moneyMatch: Match, columnKey: React.Key): React.ReactNode => {
const cellValue = moneyMatch[columnKey as keyof Match];

const d1 = new Date(moneyMatch.startTime),
d2 = new Date();
Expand Down Expand Up @@ -204,7 +198,7 @@ export const MoneyMatchFinderTable = ({ data }: MatchListProps) => {
</div>
);
default:
return cellValue;
return cellValue as ReactNode;
}
},
[],
Expand Down Expand Up @@ -256,11 +250,11 @@ export const MoneyMatchFinderTable = ({ data }: MatchListProps) => {
)}
</TableHeader>
<TableBody items={items}>
{(item: { matchId: string }) => (
{(item: Match) => (
<TableRow key={item?.matchId}>
{(columnKey) => (
<TableCell className="text-center">
{renderCell(item as any, columnKey)}
{renderCell(item, columnKey)}
</TableCell>
)}
</TableRow>
Expand Down
Loading

0 comments on commit 09e7c20

Please sign in to comment.