diff --git a/.hintrc b/.hintrc new file mode 100644 index 0000000..001c704 --- /dev/null +++ b/.hintrc @@ -0,0 +1,13 @@ +{ + "extends": [ + "development" + ], + "hints": { + "axe/parsing": [ + "default", + { + "duplicate-id-aria": "off" + } + ] + } +} \ No newline at end of file diff --git a/.working/layout.html b/.working/layout.html new file mode 100644 index 0000000..49645b0 --- /dev/null +++ b/.working/layout.html @@ -0,0 +1,1068 @@ +<> + + + daisyUI — Tailwind CSS Components + + + + + + + + + + + + + + + + + + + + + + + +
+ +
+
+

{ /* HTML_TAG_START */ }daisyUI components{ /* HTML_TAG_END */ }

+

{ /* HTML_TAG_START */ }Use Tailwind CSS but write fewer class names{ /* HTML_TAG_END */ }

+
+ A free plugin for Tailwind CSS
+
+ Faster development
+
+ Cleaner HTML
+
+ Customizable and themeable
+
+ Pure CSS. Works on all frameworks
+
npm i daisyui
+
+
+ +
+

Or try it online:

+
+

Install daisyUI

+

{ /* HTML_TAG_START */ }Pure CSS. Works on all frameworks. daisyUI can be used as a Tailwind CSS plugin or as an independent CSS library{ /* HTML_TAG_END */ }

+

1. Install daisyUI as a Node package:

+
npm i daisyui
+

2. Add daisyUI to Tailwind CSS as a plugin:

+
// tailwind.config.js
+  module.exports = {
+    plugins: [
+      require('daisyui'),
+    ],
+  }
+ Install guide
+
+
+
+ + +

Congratulations random Internet user!

+

You've been selected for a chance to get one year of subscription to use Wikipedia for free!

+
+ +

Congratulations random Internet user!

+

You've been selected for a chance to get one year of subscription to use Wikipedia for free!

+
+ Yay!
+ + +
+

Congratulations random Internet user!

+

You've been selected for a chance to get one year of subscription to use Wikipedia for free!

+ + + + + +

Congratulations random Internet user!

+

You've been selected for a chance to get one year of subscription to use Wikipedia for free!

+
+ + +

Congratulations random Internet user!

+

You've been selected for a chance to get one year of subscription to use Wikipedia for free!

+
+ + + + + + + + + + + diff --git a/package.json b/package.json index e774ff6..858c399 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.1.0", "private": true, "scripts": { + "turbo": "NODE_OPTIONS='-r next-logger' next dev --turbo", "dev": "NODE_OPTIONS='-r next-logger' node ./server.js", "debug": "node ./server.js", "dev-nossl": "next dev", @@ -28,7 +29,7 @@ "firebase": "^9.17.1", "firebase-functions": "^4.2.1", "fireschema": "^4.0.4", - "next": "13.2.0", + "next": "^13.2.1", "next-logger": "^3.0.1", "next-seo": "^5.15.0", "pino": "^8.11.0", diff --git a/src/app/error.tsx b/src/app/error.tsx new file mode 100644 index 0000000..df81613 --- /dev/null +++ b/src/app/error.tsx @@ -0,0 +1,21 @@ +"use client"; +import logger from "@/lib/util/logging"; +import React from "react"; + +const ErrorPage = ({ error, reset }: { error: Error; reset: () => void }) => { + React.useEffect(() => { + // Log the error to an error reporting service + console.error(error); + logger.error(error); + }, [error]); + return ( +
+
An error occurred: {error.message}
+ +
+ ); +}; + +export default ErrorPage; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 5987a51..4ab15c0 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -2,12 +2,16 @@ import React from "react"; import { themeChange } from "theme-change"; import "./globals.css"; -import { Inter } from "@next/font/google"; +import { Raleway } from "@next/font/google"; import { NavBar } from "@/components/layout"; import { AuthUserProvider } from "@/lib/auth/authUserContext"; import { Toaster } from "react-hot-toast"; -const inter = Inter({ subsets: ["latin"] }); +const font = Raleway({ + weight: ["400", "700"], + subsets: ["latin"], + variable: "--font-raleway", +}); export default function RootLayout({ children, @@ -20,13 +24,15 @@ export default function RootLayout({ return ( - + + -
-
- +
+
-
{children}
+
+
+
{children}
diff --git a/src/app/page.tsx b/src/app/page.tsx index 3b6a700..d23b30d 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,68 +1,18 @@ -import RemindMeButton from "@/components/widgets/RemindMeButton"; -import { getMonthName, getTime } from "@/lib/util/dateUtils"; -import logger from "@/lib/util/logging"; -import { Show } from "@/models"; +import React from "react"; +import HomePageComponent from "@/components/pages/home/HomePageComponent"; -const getData = async (): Promise => { +const getData = async () => { + // const res = await fetch( + // `${process.env.NEXT_PUBLIC_API_URL}/api/shows/upcoming` + // ); const res = await fetch( - `${process.env.NEXT_PUBLIC_API_URL}/api/shows/upcoming` + "https://otherway.dev.fergl.ie:3000/api/shows/upcoming" ); - logger.debug("getDate", res); - const data = await res.json(); - return data.map((r: string) => Show.fromJson(r)); + return await res.json(); }; const Home = async () => { const results = await getData(); - logger.debug("results", results); - return results.length === 0 ? ( -
-
-
-

No upcoming shows found

-
-
-
- ) : ( -
-
-
- Tracking events -
-
- - - {results && - results.map((show: Show) => ( - - - - - - ))} - -
-
- {`${new Date(show.date).getDay()} ${getMonthName(show.date)}`} -
-
{getTime(show.date)}
-
-
- {show.creator} -
-
{show.title}
-
- -
-
-
-
- ); + return ; }; export default Home; diff --git a/src/app/profile/page.tsx b/src/app/profile/page.tsx index efe54a1..e640428 100644 --- a/src/app/profile/page.tsx +++ b/src/app/profile/page.tsx @@ -1,4 +1,4 @@ -import { ProfilePageComponent } from "@/components/pages"; +import { ProfilePageComponent } from "@/components/pages/profile"; const ProfilePage = () => { return ; diff --git a/src/components/auth/LoginPage.tsx b/src/components/auth/LoginPage.tsx index 6ab2af3..2ca88cc 100644 --- a/src/components/auth/LoginPage.tsx +++ b/src/components/auth/LoginPage.tsx @@ -9,6 +9,7 @@ const LoginPage = () => { useFirebaseAuth(); const router = useRouter(); const [error, setError] = React.useState(""); + const [forgot, setForgot] = React.useState(false); const [email, setEmail] = React.useState(""); const [password, setPassword] = React.useState(""); diff --git a/src/components/layout/NavBar.tsx b/src/components/layout/NavBar.tsx index 02d7f9d..37dc874 100644 --- a/src/components/layout/NavBar.tsx +++ b/src/components/layout/NavBar.tsx @@ -1,18 +1,15 @@ "use client"; import React from "react"; -import { BiLogInCircle } from "react-icons/bi"; import Link from "next/link"; -import useFirebaseAuth from "@/lib/auth/useFirebaseAuth"; import { useAuthUserContext } from "@/lib/auth/authUserContext"; import Image from "next/image"; import { LogIn, LogOut, PlusSquare, Menu, User } from "react-feather"; import dynamic from "next/dynamic"; -import Signup from "@/app/(auth)/signup/page"; const ThemeToggle = dynamic( () => import("@/components/widgets/ui/theme/ThemeToggle"), { - ssr: false + ssr: false, } ); const Navbar = () => { @@ -22,18 +19,24 @@ const Navbar = () => { - + Profile ) : ( @@ -46,8 +49,15 @@ const Navbar = () => { Register - - + + Login @@ -59,7 +69,7 @@ const Navbar = () => { Otherway
- {NavMenu} + {!loading && NavMenu}
diff --git a/src/components/pages/home/HomePageComponent.tsx b/src/components/pages/home/HomePageComponent.tsx new file mode 100644 index 0000000..b9ff5d6 --- /dev/null +++ b/src/components/pages/home/HomePageComponent.tsx @@ -0,0 +1,35 @@ +import Loading from "@/app/loading"; +import { RemindMeButton } from "@/components/widgets"; +import { getMonthName, getTime } from "@/lib/util/dateUtils"; +import { Show } from "@/models"; +import React from "react"; +import NoShows from "./NoShows"; +import UpcomingShowsTable from "./UpcomingShowsTable"; + +interface IHomePageComponentProps { + shows: Show[] | undefined; +} +const HomePageComponent = ({ shows }: IHomePageComponentProps) => { + const _getLayout = () => { + if (!shows) { + return ; + } + if (shows.length === 0) { + return ; + } + return ( +
+
+ Upcoming events +
+
+
+ +
+
+ ); + }; + return _getLayout(); +}; + +export default HomePageComponent; diff --git a/src/components/pages/home/NoShows.tsx b/src/components/pages/home/NoShows.tsx new file mode 100644 index 0000000..d7d8f4c --- /dev/null +++ b/src/components/pages/home/NoShows.tsx @@ -0,0 +1,15 @@ +import React from "react"; + +const NoShows = () => { + return ( +
+
+
+

No upcoming shows found

+
+
+
+ ); +}; + +export default NoShows; diff --git a/src/components/pages/home/UpcomingShowsTable.tsx b/src/components/pages/home/UpcomingShowsTable.tsx new file mode 100644 index 0000000..efa6078 --- /dev/null +++ b/src/components/pages/home/UpcomingShowsTable.tsx @@ -0,0 +1,44 @@ +import React from "react"; +import { RemindMeButton } from "@/components/widgets"; +import { getMonthName, getTime } from "@/lib/util/dateUtils"; +import { Show } from "@/models"; + +interface IUpcomingShowsTableProps { + shows: Show[]; +} +const UpcomingShowsTable = ({ shows }: IUpcomingShowsTableProps) => { + return ( + + {/* head */} + + + + + + + + + + {/* row 1 */} + {shows && + shows.map((show: Show) => ( + + + + + + + ))} + +
Who?When?What?
{show.creator} +
+ {`${new Date(show.date).getDay()} ${getMonthName(show.date)}`}{" "} + @ {getTime(show.date)} +
+
{show.title} + +
+ ); +}; + +export default UpcomingShowsTable; diff --git a/src/components/pages/home/index.ts b/src/components/pages/home/index.ts new file mode 100644 index 0000000..e69de29 diff --git a/src/components/pages/ProfilePageComponent.tsx b/src/components/pages/profile/ProfilePageComponent.tsx similarity index 91% rename from src/components/pages/ProfilePageComponent.tsx rename to src/components/pages/profile/ProfilePageComponent.tsx index abd7ec1..96de61a 100644 --- a/src/components/pages/ProfilePageComponent.tsx +++ b/src/components/pages/profile/ProfilePageComponent.tsx @@ -4,11 +4,9 @@ import { useRouter } from "next/navigation"; import { User, Bell } from "react-feather"; import classNames from "classnames"; import { useAuthUserContext } from "@/lib/auth/authUserContext"; -import useFirebaseAuth from "@/lib/auth/useFirebaseAuth"; -import { ImageUpload, InputText } from "../widgets/inputs"; -import { HeadingSubComponent } from "../widgets/text"; import ProfilePageComponentProfile from "./ProfilePageComponentProfile"; import ProfilePageComponentNotifications from "./ProfilePageComponentNotifications"; + const ProfilePageComponent = () => { const { profile, loading } = useAuthUserContext(); const router = useRouter(); @@ -42,8 +40,11 @@ const ProfilePageComponent = () => { return
Rerouting
; } else if (!loading && profile) { return ( -
-

{selectedItem}

+
+
+ Your Profile +
+