diff --git a/.eslintrc.json b/.eslintrc.json
deleted file mode 100644
index b471089..0000000
--- a/.eslintrc.json
+++ /dev/null
@@ -1,12 +0,0 @@
-{
- "parser": "@typescript-eslint/parser",
- "parserOptions": {
- "project": "./tsconfig.json"
- },
- "plugins": ["@typescript-eslint"],
- "extends": ["next/core-web-vitals", "plugin:@typescript-eslint/recommended"],
- "rules": {
- "react/no-unescaped-entities": "off",
- "@next/next/no-page-custom-font": "off"
- }
-}
diff --git a/.gitignore b/.gitignore
deleted file mode 100644
index 8e42ab9..0000000
--- a/.gitignore
+++ /dev/null
@@ -1,42 +0,0 @@
-# See https://help.github.com/articles/ignoring-files/ for more about ignoring files.
-
-# dependencies
-/node_modules
-/.pnp
-.pnp.js
-
-# testing
-/coverage
-
-# database
-/prisma/db.sqlite
-/prisma/db.sqlite-journal
-
-# next.js
-/.next/
-/out/
-
-# production
-/build
-
-# misc
-.DS_Store
-*.pem
-
-# debug
-npm-debug.log*
-yarn-debug.log*
-yarn-error.log*
-.pnpm-debug.log*
-
-# local env files
-.env
-.env*.local
-
-# vercel
-.vercel
-
-# typescript
-*.tsbuildinfo
-
-
diff --git a/README.md b/README.md
deleted file mode 100644
index 5dce8de..0000000
--- a/README.md
+++ /dev/null
@@ -1,216 +0,0 @@
-# Create T3 App
-
-This is an app bootstrapped according to the [init.tips](https://init.tips) stack, also known as the T3-Stack.
-
-## Why are there `.js` files in here?
-
-As per [T3-Axiom #3](https://github.com/t3-oss/create-t3-app/tree/next#3-typesafety-isnt-optional), we take typesafety as a first class citizen. Unfortunately, not all frameworks and plugins support TypeScript which means some of the configuration files have to be `.js` files.
-
-We try to emphasize that these files are javascript for a reason, by explicitly declaring its type (`cjs` or `mjs`) depending on what's supported by the library it is used by. Also, all the `js` files in this project are still typechecked using a `@ts-check` comment at the top.
-
-## What's next? How do I make an app with this?
-
-We try to keep this project as simple as possible, so you can start with the most basic configuration and then move on to more advanced configuration.
-
-If you are not familiar with the different technologies used in this project, please refer to the respective docs. If you still are in the wind, please join our [Discord](https://t3.gg/discord) and ask for help.
-
-- [Next-Auth.js](https://next-auth.js.org)
-- [Prisma](https://prisma.io)
-- [TailwindCSS](https://tailwindcss.com)
-- [tRPC](https://trpc.io) (using @next version? [see v10 docs here](https://alpha.trpc.io))
-
-Also checkout these awesome tutorials on `create-t3-app`.
-
-- [Build a Blog With the T3 Stack - tRPC, TypeScript, Next.js, Prisma & Zod](https://www.youtube.com/watch?v=syEWlxVFUrY)
-- [Build a Live Chat Application with the T3 Stack - TypeScript, Tailwind, tRPC](https://www.youtube.com/watch?v=dXRRY37MPuk)
-- [Build a full stack app with create-t3-app](https://www.nexxel.dev/blog/ct3a-guestbook)
-- [A first look at create-t3-app](https://dev.to/ajcwebdev/a-first-look-at-create-t3-app-1i8f)
-
-## How do I deploy this?
-
-### Vercel
-
-We recommend deploying to [Vercel](https://vercel.com/?utm_source=t3-oss&utm_campaign=oss). It makes it super easy to deploy NextJs apps.
-
-- Push your code to a GitHub repository.
-- Go to [Vercel](https://vercel.com/?utm_source=t3-oss&utm_campaign=oss) and sign up with GitHub.
-- Create a Project and import the repository you pushed your code to.
-- Add your environment variables.
-- Click **Deploy**
-- Now whenever you push a change to your repository, Vercel will automatically redeploy your website!
-
-### Docker
-
-You can also dockerize this stack and deploy a container.
-
-Please note that Next.js requires a different process for buildtime (available in the frontend, prefixed by `NEXT_PUBLIC`) and runtime environment, server-side only, variables. In this demo we are using two variables, `NEXT_PUBLIC_FOO` and `BAR`. Pay attention to their positions in the `Dockerfile`, command-line arguments, and `docker-compose.yml`.
-
-1. In your [next.config.mjs](./next.config.mjs), add the `standalone` output-option to your config:
-
- ```diff
- export default defineNextConfig({
- reactStrictMode: true,
- swcMinify: true,
- + output: "standalone",
- });
- ```
-
-2. Remove the `env`-import from [next.config.mjs](./next.config.mjs):
-
- ```diff
- - import { env } from "./src/env/server.mjs";
- ```
-
-3. Create a `.dockerignore` file with the following contents:
-
- .dockerignore
-
- ```
- .env
- Dockerfile
- .dockerignore
- node_modules
- npm-debug.log
- README.md
- .next
- .git
- ```
-
-
-
-4. Create a `Dockerfile` with the following contents:
-
- Dockerfile
-
- ```Dockerfile
- ########################
- # DEPS #
- ########################
-
- # Install dependencies only when needed
- # TODO: re-evaluate if emulation is still necessary on arm64 after moving to node 18
- FROM --platform=linux/amd64 node:16-alpine AS deps
- # Check https://github.com/nodejs/docker-node/tree/b4117f9333da4138b03a546ec926ef50a31506c3#nodealpine to understand why libc6-compat might be needed.
- RUN apk add --no-cache libc6-compat
- WORKDIR /app
-
- # Install dependencies based on the preferred package manager
- COPY package.json yarn.lock* package-lock.json* pnpm-lock.yaml* ./
- RUN \
- if [ -f yarn.lock ]; then yarn --frozen-lockfile; \
- elif [ -f package-lock.json ]; then npm ci; \
- elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm i; \
- else echo "Lockfile not found." && exit 1; \
- fi
-
- ########################
- # BUILDER #
- ########################
-
- # Rebuild the source code only when needed
- # TODO: re-evaluate if emulation is still necessary on arm64 after moving to node 18
- FROM --platform=linux/amd64 node:16-alpine AS builder
-
- ARG NEXT_PUBLIC_FOO
- ARG BAR
-
- WORKDIR /app
- COPY --from=deps /app/node_modules ./node_modules
- COPY . .
-
- # Next.js collects completely anonymous telemetry data about general usage.
- # Learn more here: https://nextjs.org/telemetry
- # Uncomment the following line in case you want to disable telemetry during the build.
- # ENV NEXT_TELEMETRY_DISABLED 1
-
- RUN \
- if [ -f yarn.lock ]; then yarn build; \
- elif [ -f package-lock.json ]; then npm run build; \
- elif [ -f pnpm-lock.yaml ]; then yarn global add pnpm && pnpm run build; \
- else echo "Lockfile not found." && exit 1; \
- fi
-
- ########################
- # RUNNER #
- ########################
-
- # Production image, copy all the files and run next
- # TODO: re-evaluate if emulation is still necessary after moving to node 18
- FROM --platform=linux/amd64 node:16-alpine AS runner
- # WORKDIR /usr/app
- WORKDIR /app
-
- ENV NODE_ENV production
- # Uncomment the following line in case you want to disable telemetry during runtime.
- # ENV NEXT_TELEMETRY_DISABLED 1
-
- RUN addgroup --system --gid 1001 nodejs
- RUN adduser --system --uid 1001 nextjs
-
- COPY --from=builder /app/next.config.mjs ./
- COPY --from=builder /app/public ./public
- COPY --from=builder /app/package.json ./package.json
-
- # Automatically leverage output traces to reduce image size
- # https://nextjs.org/docs/advanced-features/output-file-tracing
- COPY --from=builder --chown=nextjs:nodejs /app/.next/standalone ./
- COPY --from=builder --chown=nextjs:nodejs /app/.next/static ./.next/static
-
- USER nextjs
-
- EXPOSE 3000
-
- ENV PORT 3000
-
- CMD ["node", "server.js"]
- ```
-
-
-
-5. To build and run this image locally, run:
-
- ```bash
- docker build -t ct3a -e NEXT_PUBLIC_FOO=foo .
- docker run -p 3000:3000 -e BAR="bar" ct3a
- ```
-
-6. You can also use a PaaS such as [Railway's](https://railway.app) automated [Dockerfile deployments](https://docs.railway.app/deploy/dockerfiles) to deploy your app.
-
-### docker-compose
-
-You can also use docker-compose to build and run the container.
-
-1. Follow steps 1-4 above
-
-2. Create a `docker-compose.yml` file with the following:
-
-
- docker-compose.yml
-
- ```yaml
- version: "3.7"
- services:
- app:
- platform: "linux/amd64"
- build:
- context: .
- dockerfile: Dockerfile
- args:
- NEXT_PUBLIC_FOO: "foo"
- working_dir: /app
- ports:
- - "3000:3000"
- image: t3-app
- environment:
- - BAR=bar
- ```
-
-
-
-3. Run this using `docker-compose up`.
-
-## Useful resources
-
-Here are some resources that we commonly refer to:
-
-- [Protecting routes with Next-Auth.js](https://next-auth.js.org/configuration/nextjs#unstable_getserversession)
diff --git a/next-env.d.ts b/next-env.d.ts
deleted file mode 100644
index 4f11a03..0000000
--- a/next-env.d.ts
+++ /dev/null
@@ -1,5 +0,0 @@
-///
-///
-
-// NOTE: This file should not be edited
-// see https://nextjs.org/docs/basic-features/typescript for more information.
diff --git a/next.config.mjs b/next.config.mjs
deleted file mode 100644
index aae5640..0000000
--- a/next.config.mjs
+++ /dev/null
@@ -1,25 +0,0 @@
-import { env } from "./src/env/server.mjs";
-
-/**
- * Don't be scared of the generics here.
- * All they do is to give us autocompletion when using this.
- *
- * @template {import('next').NextConfig} T
- * @param {T} config - A generic parameter that flows through to the return type
- * @constraint {{import('next').NextConfig}}
- */
-function defineNextConfig(config) {
- return config;
-}
-
-export default defineNextConfig({
- reactStrictMode: true,
- swcMinify: true,
- images: {
- domains: ['upload.wikimedia.org']
- },
- eslint: {
- ignoreDuringBuilds: true,
- ignoreBuildErrors: true,
- },
-});
diff --git a/package.json b/package.json
deleted file mode 100644
index cbefefd..0000000
--- a/package.json
+++ /dev/null
@@ -1,52 +0,0 @@
-{
- "name": "train-track",
- "version": "0.1.0",
- "private": true,
- "scripts": {
- "dev": "next dev",
- "build": "next build",
- "start": "next start",
- "lint": "next lint",
- "postinstall": "prisma generate"
- },
- "dependencies": {
- "@emotion/react": "^11.10.4",
- "@mantine/core": "^5.2.4",
- "@mantine/dates": "^5.2.4",
- "@mantine/form": "^5.2.4",
- "@mantine/hooks": "^5.2.4",
- "@mantine/modals": "^5.2.4",
- "@mantine/notifications": "^5.2.4",
- "@mantine/nprogress": "^5.2.4",
- "@mantine/spotlight": "^5.2.4",
- "@next-auth/prisma-adapter": "^1.0.4",
- "@prisma/client": "^4.3.1",
- "@trpc/client": "^9.27.2",
- "@trpc/next": "^9.27.2",
- "@trpc/react": "^9.27.2",
- "@trpc/server": "^9.27.2",
- "dayjs": "^1.11.5",
- "next": "12.2.5",
- "next-auth": "^4.10.3",
- "react": "18.2.0",
- "react-dom": "18.2.0",
- "react-query": "^3.39.2",
- "superjson": "^1.9.1",
- "tabler-icons-react": "^1.54.0",
- "zod": "^3.18.0"
- },
- "devDependencies": {
- "@types/node": "18.0.0",
- "@types/react": "18.0.14",
- "@types/react-dom": "18.0.5",
- "@typescript-eslint/eslint-plugin": "^5.33.0",
- "@typescript-eslint/parser": "^5.33.0",
- "eslint": "8.22.0",
- "eslint-config-next": "12.2.5",
- "prisma": "^4.3.1",
- "typescript": "4.7.4"
- },
- "ct3aMetadata": {
- "initVersion": "5.9.0"
- }
-}
diff --git a/prisma/schema.prisma b/prisma/schema.prisma
deleted file mode 100644
index e3fcc7b..0000000
--- a/prisma/schema.prisma
+++ /dev/null
@@ -1,175 +0,0 @@
-// This is your Prisma schema file,
-// learn more about it in the docs: https://pris.ly/d/prisma-schema
-
-generator client {
- provider = "prisma-client-js"
-}
-
-datasource db {
- provider = "mysql"
- // NOTE: When using postgresql, mysql or sqlserver, uncomment the @db.text annotations in model Account below
- // Further reading:
- // https://next-auth.js.org/adapters/prisma#create-the-prisma-schema
- // https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#string
- url = env("DATABASE_URL")
-}
-
-model Example {
- id String @id @default(cuid())
-}
-
-model RStock {
- id String @id @default(cuid())
- // rstock number
- identifier String @unique
- // rstock attributes
- livery String
- builtYear String
- depot String
- formation String
- carCount Int
- // sightings
- sightings RstockSighting[]
- // operator set
- opSet OperatorSet @relation(fields: [opSetId], references: [id])
- opSetId String
-}
-
-model Illustration {
- id String @id @default(cuid())
- // illustration attributes
- url String
- license String
- author String
- source String
- // operator set
- opSet OperatorSet @relation(fields: [opSetId], references: [id])
- opSetId String
-}
-
-model Operator {
- id String @id @default(cuid())
- // operator attributes
- name String
- shortName String?
- code String @unique
- logoUrl String
- callStatCount String?
- website String?
- franchise String
- // operator sets
- operatorSets OperatorSet[]
-}
-
-// Sighting table
-model Sighting {
- id String @id @default(cuid())
- // user
- userId String
-
- // sighting attributes
- location String
- date DateTime
-
- // rstock
- rStockSightings RstockSighting[]
-}
-
-model RstockSighting {
- id String @id @default(cuid())
- // sighting
- sighting Sighting @relation(fields: [sightingId], references: [id])
- sightingId String
- // rstock
- rstock RStock @relation(fields: [rstockId], references: [id])
- rstockId String
- // userFirst
- userFirst Boolean @default(false)
- // Make sightings and rstocks unique so that it crashes
- // on trying to do duplicates
- @@unique([sightingId, rstockId])
-}
-
-model Class {
- id String @id @default(cuid())
- // class attributes
- no String @unique
- type String
- model String
- // Manufacturer
- manufacturer Manufacturer @relation(fields: [manufacturerId], references: [id])
- manufacturerId String
- // operator sets
- operatorSets OperatorSet[]
-}
-
-model Manufacturer {
- id String @id @default(cuid())
- // manufacturer attributes
- name String
- logoUrl String
- headquarters String?
- website String?
- status String?
- // classes
- classes Class[]
-}
-
-model OperatorSet {
- id String @id @default(cuid())
- // operator
- operator Operator @relation(fields: [operatorId], references: [id])
- operatorId String
- // class
- class Class @relation(fields: [classId], references: [id])
- classId String
- // illustrations
- illustrations Illustration[]
- // rstock
- rstock RStock[]
-}
-
-// Necessary for Next auth
-model Account {
- id String @id @default(cuid())
- userId String
- type String
- provider String
- providerAccountId String
- refresh_token String? //@db.Text
- access_token String? //@db.Text
- expires_at Int?
- token_type String?
- scope String?
- id_token String? //@db.Text
- session_state String?
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
-
- @@unique([provider, providerAccountId])
-}
-
-model Session {
- id String @id @default(cuid())
- sessionToken String @unique
- userId String
- expires DateTime
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
-}
-
-model User {
- id String @id @default(cuid())
- name String?
- email String? @unique
- emailVerified DateTime?
- image String?
- accounts Account[]
- sessions Session[]
-}
-
-model VerificationToken {
- identifier String
- token String @unique
- expires DateTime
-
- @@unique([identifier, token])
-}
diff --git a/public/favicon.ico b/public/favicon.ico
deleted file mode 100644
index d3b456c..0000000
Binary files a/public/favicon.ico and /dev/null differ
diff --git a/src/components/attributePoint.tsx b/src/components/attributePoint.tsx
deleted file mode 100644
index 87fbbef..0000000
--- a/src/components/attributePoint.tsx
+++ /dev/null
@@ -1,42 +0,0 @@
-import { Anchor, createStyles, Text, Code } from "@mantine/core";
-import { useRouter } from "next/router";
-
-export function AttributePoint({ name, value, href }: AttributePointProps) {
- // Use router
- const router = useRouter();
- // Use styles
- const { classes } = useStyles();
-
- let valueElement = {value};
- if (href) valueElement = router.push(href)}>{value}
-
- return <>
-
- {name}
- {((value == "" || value == null) && Unknown ?) || valueElement}
-
- >
-}
-
-const useStyles = createStyles((theme) => ({
- attributePoint: {
- display: 'flex',
- // For mobile
- [theme.fn.smallerThan('sm')]: {
- justifyContent: 'flex-start',
- flexDirection: 'column',
- alignItems: 'left'
- },
- // For desktop
- [theme.fn.largerThan('sm')]: {
- justifyContent: 'space-between',
- alignItems: 'center'
- },
- }
-}));
-
-interface AttributePointProps {
- name: string,
- value: any,
- href?: string
-}
\ No newline at end of file
diff --git a/src/components/authGuard.ts b/src/components/authGuard.ts
deleted file mode 100644
index 19802a1..0000000
--- a/src/components/authGuard.ts
+++ /dev/null
@@ -1,31 +0,0 @@
-import { IncomingMessage, ServerResponse } from "http";
-import { unstable_getServerSession } from "next-auth";
-import { authOptions } from "../pages/api/auth/[...nextauth]";
-
-export async function AuthGuardUI(req: IncomingMessageWithCookies, res: ServerResponse) {
- // Get session from next auth
- const session = await unstable_getServerSession(req, res, authOptions);
- const user = session?.user;
-
- // If no user logged in, redirect
- if (!user) {
- return {
- redirect: {
- destination: "/welcome",
- permanent: false,
- },
- };
- }
- // Otherwise, attatch user to page props
- return {
- props: {
- user,
- },
- };
-}
-
-type IncomingMessageWithCookies = IncomingMessage & {
- cookies: Partial<{
- [key: string]: string;
- }>;
-}
\ No newline at end of file
diff --git a/src/components/classList/operatorCard.tsx b/src/components/classList/operatorCard.tsx
deleted file mode 100644
index 96b2c4f..0000000
--- a/src/components/classList/operatorCard.tsx
+++ /dev/null
@@ -1,61 +0,0 @@
-import { Anchor, Avatar, Box, Text, Title, Tooltip } from "@mantine/core";
-import { Class, Manufacturer } from "@prisma/client";
-import { useRouter } from "next/router";
-
-export function OperatorSetThumbnail({ opSet, operator }: { opSet: OperatorSetFull, operator: OperatorFull }) {
- const router = useRouter();
- return (
-
-
-
-
-
-
- router.push(`/mf/${opSet.class.manufacturer.id}`)}
- style={{cursor: 'pointer'}}
- src={opSet.class.manufacturer.logoUrl}
- size={40}>{opSet.class.manufacturer.name.substring(0,2)}
-
-
- router.push(`/op/${operator.code}`)}
- style={{cursor: 'pointer'}}
- src={operator.logoUrl}
- radius="xl"
- size={40}/>
-
-
-
-
-
- Class {opSet.class.no}
- {opSet._count.rstock} units
-
-
-
router.push(`/op/${operator.code}/${opSet.class.no}`)}>View
-
- )
-}
-
-export function ClassThumbnail({classObj, manufacturer}: { classObj: ClassWithOperators, manufacturer: Manufacturer }) {
- const router = useRouter();
- return (
- <>
-
-
-
{manufacturer.name.substring(0,2)}
-
- Class {classObj.no}
- {classObj.model} ({classObj.type})
-
-
-
View
-
- >
- )
-}
\ No newline at end of file
diff --git a/src/components/classList/shortTrainCard.tsx b/src/components/classList/shortTrainCard.tsx
deleted file mode 100644
index 807b15e..0000000
--- a/src/components/classList/shortTrainCard.tsx
+++ /dev/null
@@ -1,39 +0,0 @@
-import { Button, Card, Title, Text, Checkbox, ThemeIcon } from "@mantine/core";
-import Link from "next/link";
-import { useState } from "react";
-import { ArrowRight, Check, CircleCheck, CircleDashed } from "tabler-icons-react";
-
-export default function ShortTrainCard({ userSeen, identifier, formation, carCount }: ShortTrain) {
-
- const [seen, setSeen] = useState(userSeen);
-
- return (
-
-
- {userSeen && (
-
-
-
- )}
- {!userSeen && (
-
-
-
- )}
-
{identifier}
-
- {formation}
- {carCount} carriages
-
- } compact>View unit
-
-
- );
-}
-
-interface ShortTrain {
- userSeen: boolean
- identifier: string;
- formation: string;
- carCount: number;
-}
\ No newline at end of file
diff --git a/src/components/errorPopup.tsx b/src/components/errorPopup.tsx
deleted file mode 100644
index feca173..0000000
--- a/src/components/errorPopup.tsx
+++ /dev/null
@@ -1,26 +0,0 @@
-import { Button, Text, Title } from "@mantine/core";
-import { closeModal, openModal } from "@mantine/modals";
-
-/**
- * Show an error popup modal
- * @param type The type of error
- * @param title A friendly short description of the error
- * @param resolveMessage Tips on how to resolve the error
- */
-
-export default function showErrorPopup(type: string, title: string, resolveMessage: string) {
- openModal({
- modalId: `error.${type}`,
- title: type,
- centered: true,
- children: (
- <>
- {title}
- {resolveMessage}
-
- >
- )
- });
-}
\ No newline at end of file
diff --git a/src/components/footer.tsx b/src/components/footer.tsx
deleted file mode 100644
index 11bf577..0000000
--- a/src/components/footer.tsx
+++ /dev/null
@@ -1,126 +0,0 @@
-import { createStyles, Text, Container, ActionIcon, Code, Title, Anchor } from '@mantine/core';
-
-const useStyles = createStyles((theme) => ({
- footer: {
- paddingTop: theme.spacing.md,
- paddingBottom: theme.spacing.md,
- backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.colors.gray[0],
- borderTop: `1px solid ${
- theme.colorScheme === 'dark' ? theme.colors.dark[5] : theme.colors.gray[2]
- }`,
- },
-
- logo: {
- maxWidth: 200,
-
- [theme.fn.smallerThan('sm')]: {
- display: 'flex',
- flexDirection: 'column',
- alignItems: 'center',
- },
- },
-
- inner: {
- display: 'flex',
- justifyContent: 'space-between',
-
- [theme.fn.smallerThan('sm')]: {
- flexDirection: 'column',
- alignItems: 'center',
- },
- },
-
- groups: {
- display: 'flex',
- flexWrap: 'wrap',
-
- [theme.fn.smallerThan('sm')]: {
- display: 'none',
- },
- },
-
- wrapper: {
- width: 160,
- },
-
- link: {
- display: 'block',
- color: theme.colorScheme === 'dark' ? theme.colors.dark[1] : theme.colors.gray[6],
- fontSize: theme.fontSizes.sm,
- paddingTop: 3,
- paddingBottom: 3,
-
- '&:hover': {
- textDecoration: 'underline',
- },
- },
-
- title: {
- fontSize: theme.fontSizes.md,
- fontWeight: 700,
- fontFamily: `Greycliff CF, ${theme.fontFamily}`,
- marginBottom: theme.spacing.xs / 2,
- color: theme.colorScheme === 'dark' ? theme.white : theme.black,
- },
-
- afterFooter: {
- display: 'flex',
- justifyContent: 'space-between',
- alignItems: 'center',
- marginTop: theme.spacing.sm,
- paddingTop: theme.spacing.sm,
- paddingBottom: theme.spacing.sm,
- borderTop: `1px solid ${
- theme.colorScheme === 'dark' ? theme.colors.dark[4] : theme.colors.gray[2]
- }`,
-
- [theme.fn.smallerThan('sm')]: {
- flexDirection: 'column',
- },
- },
-
- social: {
- [theme.fn.smallerThan('sm')]: {
- marginTop: theme.spacing.xs,
- },
- },
-}));
-
-interface FooterLinksProps {
- data: {
- title: string;
- links: { label: string; link: string }[];
- }[];
-}
-
-export function FooterLinks() {
- const { classes } = useStyles();
-
- return (
-
- );
-}
\ No newline at end of file
diff --git a/src/components/headerMiddle.tsx b/src/components/headerMiddle.tsx
deleted file mode 100644
index 080f587..0000000
--- a/src/components/headerMiddle.tsx
+++ /dev/null
@@ -1,142 +0,0 @@
-import { useState } from 'react';
-import { createStyles, Header, Group, ActionIcon, Container, Burger, Title, Text, Button, Input, TextInput, Menu, UnstyledButton, Avatar } from '@mantine/core';
-import { useDisclosure } from '@mantine/hooks';
-import Link from 'next/link';
-import { Book2, ChevronDown, Logout, Search, Settings, User as UserIcon } from 'tabler-icons-react';
-import { User } from 'next-auth';
-import { signOut } from 'next-auth/react';
-import { useRouter } from 'next/router';
-
-const useStyles = createStyles((theme) => ({
- inner: {
- display: 'flex',
- justifyContent: 'space-between',
- alignItems: 'center',
- height: 56,
-
-
- },
-
- links: {
- width: 260,
-
- [theme.fn.smallerThan('sm')]: {
- display: 'none',
- },
- },
-
- social: {
- width: 260,
-
- [theme.fn.smallerThan('sm')]: {
- width: 'auto',
- marginLeft: 'auto',
- },
- },
-
- burger: {
- marginRight: theme.spacing.md,
-
- [theme.fn.largerThan('sm')]: {
- display: 'none',
- },
- },
-
- link: {
- display: 'block',
- lineHeight: 1,
- padding: '8px 12px',
- borderRadius: theme.radius.sm,
- textDecoration: 'none',
- color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.colors.gray[7],
- fontSize: theme.fontSizes.sm,
- fontWeight: 500,
-
- '&:hover': {
- backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[6] : theme.colors.gray[0],
- },
- },
-
- linkActive: {
- '&, &:hover': {
- backgroundColor: theme.fn.variant({ variant: 'light', color: theme.primaryColor }).background,
- color: theme.fn.variant({ variant: 'light', color: theme.primaryColor }).color,
- },
- },
-
- user: {
- color: theme.colorScheme === 'dark' ? theme.colors.dark[0] : theme.black,
- padding: `${theme.spacing.xs}px ${theme.spacing.sm}px`,
- borderRadius: theme.radius.sm,
- transition: 'background-color 100ms ease',
-
- '&:hover': {
- backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.white,
- },
- },
-
- userName: {
- [theme.fn.smallerThan('xs')]: {
- display: 'none',
- },
- },
-
- userActive: {
- backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark[8] : theme.white,
- },
-}));
-
-interface HeaderMiddleProps {
- links: { link: string; label: string }[];
-}
-
-export function HeaderMiddle({ user }: {user: User}) {
- const { classes, cx } = useStyles();
- const [userMenuOpened, setUserMenuOpened] = useState(false);
- console.log(user);
- const router = useRouter();
-
- return (
-
-
-
- 🚅 Track
-
-
- {/* }
- placeholder="Search"/> */}
-
-
-
-
- );
-}
\ No newline at end of file
diff --git a/src/components/mainPageLoading.tsx b/src/components/mainPageLoading.tsx
deleted file mode 100644
index 194f2e2..0000000
--- a/src/components/mainPageLoading.tsx
+++ /dev/null
@@ -1,52 +0,0 @@
-import { HeaderMiddle } from "./headerMiddle";
-import { Box, Container, Skeleton, createStyles } from "@mantine/core";
-import { User } from "next-auth";
-
-
-export function MainPageLoading({user}: {user:User}) {
-
- const { classes } = useStyles();
-
- return <>
-
-
-
-
-
-
-
-
-
- >
-}
-
-export function SubPageLoading({user}: {user:User}) {
-
- const { classes } = useStyles();
-
- return <>
-
-
-
-
-
-
-
-
- >
-}
-
-
-const useStyles = createStyles((theme) => ({
- header: {
- backgroundColor: theme.colorScheme === 'dark' ? theme.colors.dark![6] : theme.colors.gray![0],
- borderBottom: `1px solid ${
- theme.colorScheme === 'dark' ? theme.colors.dark![5] : theme.colors.gray![2]
- }`,
- },
-
- headerText: {
- paddingTop: 50,
- paddingBottom: 40,
- }
-}));
\ No newline at end of file
diff --git a/src/components/routerTransition.tsx b/src/components/routerTransition.tsx
deleted file mode 100644
index c28ff9a..0000000
--- a/src/components/routerTransition.tsx
+++ /dev/null
@@ -1,29 +0,0 @@
-// components/RouterTransition.tsx
-import { useEffect } from 'react';
-import { useRouter } from 'next/router';
-import {
- startNavigationProgress,
- resetNavigationProgress,
- NavigationProgress,
-} from '@mantine/nprogress';
-
-export function RouterTransition() {
- const router = useRouter();
-
- useEffect(() => {
- const handleStart = (url: string) => url !== router.asPath && startNavigationProgress();
- const handleComplete = () => resetNavigationProgress();
-
- router.events.on('routeChangeStart', handleStart);
- router.events.on('routeChangeComplete', handleComplete);
- router.events.on('routeChangeError', handleComplete);
-
- return () => {
- router.events.off('routeChangeStart', handleStart);
- router.events.off('routeChangeComplete', handleComplete);
- router.events.off('routeChangeError', handleComplete);
- };
- }, [router.asPath]);
-
- return ;
-}
\ No newline at end of file
diff --git a/src/components/sightingCard.tsx b/src/components/sightingCard.tsx
deleted file mode 100644
index 2ee831d..0000000
--- a/src/components/sightingCard.tsx
+++ /dev/null
@@ -1,37 +0,0 @@
-import { Anchor, Chip, Code, Text } from "@mantine/core"
-import { Clock, Location } from "tabler-icons-react"
-import { useRouter } from "next/router"
-import { RstockSighting } from "@prisma/client";
-import { ChipGroup } from "@mantine/core/lib/Chip/ChipGroup/ChipGroup";
-
-export default function SightingBlock({ sighting, hasChips = true }: SightingBlockProps) {
-
- const router = useRouter();
-
- const stockList = sighting.rStockSightings.map((rs: RStockSightingWithRstock, i: number) =>
- <>
- router.push("/rs/" + rs.rstock.identifier)}>
- {rs.rstock.identifier}
-
- >
- )
-
- return
-
- {sighting.location}
- {sighting.date.toDateString()}
- {hasChips && {stockList}}
-
-
router.push("/rs/350101")}>View
-
-}
-
-
-interface SightingBlockProps {
- sighting: SightingForList
- hasChips: Boolean
-}
\ No newline at end of file
diff --git a/src/components/tickets/inlineTicketsCount.tsx b/src/components/tickets/inlineTicketsCount.tsx
deleted file mode 100644
index c9cb602..0000000
--- a/src/components/tickets/inlineTicketsCount.tsx
+++ /dev/null
@@ -1,7 +0,0 @@
-import { Badge, Tooltip } from "@mantine/core";
-
-export default function InlineTicketsCount({ count }: { count: number }) {
- return <>
- +{count}
- >
-}
\ No newline at end of file
diff --git a/src/env/client.mjs b/src/env/client.mjs
deleted file mode 100644
index d51a689..0000000
--- a/src/env/client.mjs
+++ /dev/null
@@ -1,36 +0,0 @@
-// @ts-check
-import { clientEnv, clientSchema } from "./schema.mjs";
-
-const _clientEnv = clientSchema.safeParse(clientEnv);
-
-export const formatErrors = (
- /** @type {import('zod').ZodFormattedError