diff --git a/.env b/.env index 07627ad..90c77cf 100644 --- a/.env +++ b/.env @@ -1,3 +1,5 @@ +NEXT_PUBLIC_TITLE=RadioOtherway + QSTASH_CURRENT_SIGNING_KEY=khs3lpVBv1QtV/L9MTdXlcnoI8tTlg0aDfrFz+o8utA= #auth diff --git a/.vscode/settings.json b/.vscode/settings.json index d067910..d83cfbc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,4 +1,15 @@ { + "files.exclude": { + "**/.git": true, + "**/.svn": true, + "**/.hg": true, + "**/CVS": true, + "**/.DS_Store": true, + "**/Thumbs.db": true, + ".vscode":true, + ".next": true, + ".vercel": true + }, "typescript.tsdk": "node_modules/typescript/lib", "typescript.enablePromptUseWorkspaceTsdk": true -} \ No newline at end of file +} diff --git a/package.json b/package.json index 5803073..35249e4 100644 --- a/package.json +++ b/package.json @@ -18,22 +18,27 @@ "@types/react": "18.0.27", "@types/react-dom": "18.0.10", "@upstash/qstash": "^0.3.6", + "classnames": "^2.3.2", "daisyui": "^2.49.0", "encoding": "^0.1.13", "eslint": "8.32.0", "eslint-config-next": "13.1.5", "firebase": "^9.17.1", - "firebase-admin": "^11.5.0", + "firebase-functions": "^4.2.1", + "fireschema": "^4.0.4", "next": "13.1.5", "next-logger": "^3.0.1", + "next-seo": "^5.15.0", "pino": "^8.11.0", "pino-logflare": "^0.3.12", "react": "18.2.0", "react-dom": "18.2.0", + "react-feather": "^2.0.10", "react-hot-toast": "^2.4.0", "react-icons": "^4.7.1", "twilio": "^4.8.0", - "typescript": "4.9.4" + "typescript": "4.9.4", + "zod": "^3.20.6" }, "packageManager": "yarn@1.22.19", "devDependencies": { diff --git a/src/app/(auth)/login/page.tsx b/src/app/(auth)/login/page.tsx index 29a5906..ad8dda1 100644 --- a/src/app/(auth)/login/page.tsx +++ b/src/app/(auth)/login/page.tsx @@ -2,7 +2,12 @@ import { LoginPage } from "@/components/auth"; import React from "react"; const Login = async () => { - return ; + return ( + <> +
+ +
+ ); }; export default Login; diff --git a/src/app/(auth)/signup/page.tsx b/src/app/(auth)/signup/page.tsx new file mode 100644 index 0000000..8cbc469 --- /dev/null +++ b/src/app/(auth)/signup/page.tsx @@ -0,0 +1,7 @@ +import React from "react"; + +const Signup = async () => { + return

Coming soon

; +}; + +export default Signup; diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 74899fb..0d7c3ea 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -4,31 +4,31 @@ import "./globals.css"; import { Inter } from "@next/font/google"; import { NavBar } from "@/components/layout"; import { AuthUserProvider } from "@/lib/auth/authUserContext"; -import dynamic from "next/dynamic"; import { Toaster } from "react-hot-toast"; -// const Toaster = dynamic( -// () => import("react-hot-toast").then((c) => c.Toaster), -// { -// ssr: false, -// } -// ); + const inter = Inter({ subsets: ["latin"] }); export default function RootLayout({ - children, -}: { + children + }: { children: React.ReactNode; }) { return ( - - - + + + +
+
-
{children}
- - +
+ {children} +
+
+
+
+ ); } diff --git a/src/app/loading.tsx b/src/app/loading.tsx index 512724a..fdc5b99 100644 --- a/src/app/loading.tsx +++ b/src/app/loading.tsx @@ -2,13 +2,24 @@ import React from "react"; const Loading = () => { return ( -
-
+ Loading... -
+ + + + Loading...
); }; diff --git a/src/app/page.tsx b/src/app/page.tsx index 9eca7e1..56f38a9 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -8,7 +8,8 @@ const getData = async (): Promise => { `${process.env.NEXT_PUBLIC_API_URL}/api/shows/upcoming` ); logger.debug("getDate", res); - return await res.json(); + const data = await res.json(); + return data.map((r: string) => Show.fromJson(r)); }; const Home = async () => { diff --git a/src/app/profile/page.tsx b/src/app/profile/page.tsx new file mode 100644 index 0000000..efe54a1 --- /dev/null +++ b/src/app/profile/page.tsx @@ -0,0 +1,7 @@ +import { ProfilePageComponent } from "@/components/pages"; + +const ProfilePage = () => { + return ; +}; + +export default ProfilePage; diff --git a/src/components/auth/LoginPage.tsx b/src/components/auth/LoginPage.tsx index 13f1050..2a1e9f8 100644 --- a/src/components/auth/LoginPage.tsx +++ b/src/components/auth/LoginPage.tsx @@ -1,80 +1,163 @@ "use client"; import React from "react"; -import {useRouter} from "next/navigation"; -import {BsFacebook, BsGoogle, BsTwitter} from "react-icons/bs"; +import { useRouter } from "next/navigation"; import useFirebaseAuth from "@/lib/auth/useFirebaseAuth"; +import { IoLogoFacebook, IoLogoGoogle, IoLogoTwitter } from "react-icons/io"; const LoginPage = () => { - const {signInWithGoogle, signInWithTwitter, signInWithFacebook} = useFirebaseAuth(); - const router = useRouter() + const { signInWithGoogle, signInWithFacebook, signInWithTwitter, user, signIn } = + useFirebaseAuth(); + const router = useRouter(); + const [email, setEmail] = React.useState(""); + const [password, setPassword] = React.useState(""); + const [forgot, setForgot] = React.useState(false); + + const login = async ( + event: React.SyntheticEvent + ): Promise => { + const result = await signIn(email, password); + }; return ( -
-
-

- Login to Radio Otherway -

-
-
- - - - - +
+ { + setPassword(event.target.value); + }} + /> +
+ +
+
-
-
- or login with -
-
-
-
- - -
+ {/*
+ + + +
*/}
-
-
-
- -
-
-
-
-
+ + - ); }; diff --git a/src/components/layout/NavBar.tsx b/src/components/layout/NavBar.tsx index daba172..2aed9c5 100644 --- a/src/components/layout/NavBar.tsx +++ b/src/components/layout/NavBar.tsx @@ -1,78 +1,77 @@ "use client"; import React from "react"; -import {BiLogInCircle} from "react-icons/bi"; +import { BiLogInCircle } from "react-icons/bi"; import Link from "next/link"; import useFirebaseAuth from "@/lib/auth/useFirebaseAuth"; -import {useAuthUserContext} from '@/lib/auth/authUserContext'; +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, + } +); const Navbar = () => { - const {authUser, loading, logOut} = useAuthUserContext(); + const { user, loading, logOut } = useAuthUserContext(); + const NavMenu = user ? ( + + + + Profile + + + + ) : ( + + + + Register + + + + Login + + + ); return ( -
- ); }; diff --git a/src/components/pages/ProfilePageComponent.tsx b/src/components/pages/ProfilePageComponent.tsx new file mode 100644 index 0000000..e9a3fa0 --- /dev/null +++ b/src/components/pages/ProfilePageComponent.tsx @@ -0,0 +1,406 @@ +"user client"; +import React from "react"; +import { Switch } from "@headlessui/react"; +import classNames from "classnames"; +import { User, Bell } from "react-feather"; +import { useAuthUserContext } from "@/lib/auth/authUserContext"; + +const ProfilePageComponent = () => { + const { user, loading, logOut } = useAuthUserContext(); + const subNavigation = [ + { name: "Profile", href: "#", icon: User, current: true }, + { name: "Notifications", href: "#", icon: Bell, current: false }, + ]; + return ( +
+
+ + +
+ {/* Profile section */} +
+
+

+ Profile +

+

+ This information will be displayed publicly so be careful what + you share. +

+
+ +
+
+
+ +
+ + workcation.com/ + + +
+
+ +
+ +
+