From 36db958929b78464f8e8a25d6840501e601eb3f7 Mon Sep 17 00:00:00 2001 From: OneRandomGithubUser <70461479+Anantu05@users.noreply.github.com> Date: Fri, 20 Oct 2023 23:52:44 +0530 Subject: [PATCH 01/15] Initial commit Migrated from pages to app router --- .../account.tsx => app/account/page.tsx} | 1 + src/{pages/index.tsx => app/index/page.tsx} | 1 + src/app/layout.tsx | 54 +++++++++++++++++++ src/{pages/login.tsx => app/login/page.tsx} | 3 +- src/{pages/logout.tsx => app/logout/page.tsx} | 4 +- src/{pages/404.tsx => app/not-found.tsx} | 0 src/{pages => app/search}/search.tsx | 0 src/components/Seo.tsx | 7 ++- src/pages/_app.tsx | 15 ------ src/pages/_document.tsx | 21 -------- tailwind.config.ts | 2 +- tsconfig.json | 9 +++- 12 files changed, 72 insertions(+), 45 deletions(-) rename src/{pages/account.tsx => app/account/page.tsx} (95%) rename src/{pages/index.tsx => app/index/page.tsx} (99%) create mode 100644 src/app/layout.tsx rename src/{pages/login.tsx => app/login/page.tsx} (95%) rename src/{pages/logout.tsx => app/logout/page.tsx} (87%) rename src/{pages/404.tsx => app/not-found.tsx} (100%) rename src/{pages => app/search}/search.tsx (100%) delete mode 100644 src/pages/_app.tsx delete mode 100644 src/pages/_document.tsx diff --git a/src/pages/account.tsx b/src/app/account/page.tsx similarity index 95% rename from src/pages/account.tsx rename to src/app/account/page.tsx index 90aa73a..7df893e 100644 --- a/src/pages/account.tsx +++ b/src/app/account/page.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import Seo from '@/components/Seo'; diff --git a/src/pages/index.tsx b/src/app/index/page.tsx similarity index 99% rename from src/pages/index.tsx rename to src/app/index/page.tsx index e3de527..66c38ce 100644 --- a/src/pages/index.tsx +++ b/src/app/index/page.tsx @@ -1,3 +1,4 @@ +'use client'; import * as React from 'react'; import Carousel, { CarouselProps } from '@/components/carousel/Carousel'; diff --git a/src/app/layout.tsx b/src/app/layout.tsx new file mode 100644 index 0000000..6eb3ed1 --- /dev/null +++ b/src/app/layout.tsx @@ -0,0 +1,54 @@ +import React from 'react'; + +import '../styles/globals.css'; + +export default function RootLayout({ + children, +}: { + children: React.ReactNode; +}) { + return ( + + + + + {children} + + ); +} + +/*return ( + + + + + +
+ + + + ); +} + +function MyApp({ Component, pageProps }: AppProps) { + return ( + + + + ); +} + +export default MyApp; +*/ diff --git a/src/pages/login.tsx b/src/app/login/page.tsx similarity index 95% rename from src/pages/login.tsx rename to src/app/login/page.tsx index 193c40a..25962ef 100644 --- a/src/pages/login.tsx +++ b/src/app/login/page.tsx @@ -1,4 +1,5 @@ -import { useRouter } from 'next/router'; +'use client'; +import { useRouter } from 'next/navigation'; import { useEffect } from 'react'; import Button from '@/components/buttons/Button'; diff --git a/src/pages/logout.tsx b/src/app/logout/page.tsx similarity index 87% rename from src/pages/logout.tsx rename to src/app/logout/page.tsx index da8aafa..8345963 100644 --- a/src/pages/logout.tsx +++ b/src/app/logout/page.tsx @@ -1,4 +1,6 @@ -import { useRouter } from 'next/router'; +'use client'; + +import { useRouter } from 'next/navigation'; import { useEffect } from 'react'; export default function LogoutPage() { diff --git a/src/pages/404.tsx b/src/app/not-found.tsx similarity index 100% rename from src/pages/404.tsx rename to src/app/not-found.tsx diff --git a/src/pages/search.tsx b/src/app/search/search.tsx similarity index 100% rename from src/pages/search.tsx rename to src/app/search/search.tsx diff --git a/src/components/Seo.tsx b/src/components/Seo.tsx index b259ab6..48ed8c9 100644 --- a/src/components/Seo.tsx +++ b/src/components/Seo.tsx @@ -1,5 +1,5 @@ import Head from 'next/head'; -import { useRouter } from 'next/router'; +import { usePathname } from 'next/navigation'; const defaultMeta = { title: 'Nex | Music Player', @@ -22,7 +22,6 @@ type SeoProps = { } & Partial; export default function Seo(props: SeoProps) { - const router = useRouter(); const meta = { ...defaultMeta, ...props, @@ -46,8 +45,8 @@ export default function Seo(props: SeoProps) { {meta.title} - - + + {/* Open Graph */} diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx deleted file mode 100644 index cec8315..0000000 --- a/src/pages/_app.tsx +++ /dev/null @@ -1,15 +0,0 @@ -import { AppProps } from 'next/app'; - -import '@/styles/globals.css'; - -import Layout from '@/components/layout/Layout'; - -function MyApp({ Component, pageProps }: AppProps) { - return ( - - - - ); -} - -export default MyApp; diff --git a/src/pages/_document.tsx b/src/pages/_document.tsx deleted file mode 100644 index d491d46..0000000 --- a/src/pages/_document.tsx +++ /dev/null @@ -1,21 +0,0 @@ -import { Head, Html, Main, NextScript } from 'next/document'; - -export default function Document() { - return ( - - - - - -
- - - - ); -} diff --git a/tailwind.config.ts b/tailwind.config.ts index d29392f..229f6b8 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -2,7 +2,7 @@ import type { Config } from 'tailwindcss'; import defaultTheme from 'tailwindcss/defaultTheme'; export default { - content: ['./src/**/*.{js,jsx,ts,tsx}'], + content: ['./src/app/**/*.{js,jsx,ts,tsx}'], theme: { fontFamily: { quicksand: ['Quicksand', 'sans-serif'], diff --git a/tsconfig.json b/tsconfig.json index 91efe0c..f3a4ec1 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -18,9 +18,14 @@ "@/*": ["./src/*"], "~/*": ["./public/*"] }, - "incremental": true + "incremental": true, + "plugins": [ + { + "name": "next" + } + ] }, - "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"], + "include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"], "exclude": ["node_modules"], "moduleResolution": ["node_modules", ".next", "node"] } From 5493f05b6ebf7a376f311234f59ed5bddbfeaad9 Mon Sep 17 00:00:00 2001 From: OneRandomGithubUser <70461479+Anantu05@users.noreply.github.com> Date: Sat, 21 Oct 2023 15:58:06 +0530 Subject: [PATCH 02/15] Updated CSS CSS works partially, not-found not working --- src/__tests__/pages/404.test.tsx | 4 +- src/app/layout.tsx | 72 +++++++------------ src/app/{index => }/page.tsx | 0 src/app/search/{search.tsx => page.tsx} | 6 +- src/components/NextImage.tsx | 1 + src/components/Seo.tsx | 5 +- src/components/carousel/Carousel.tsx | 1 + src/components/carousel/CarouselItem.tsx | 1 + src/components/layout/Layout.tsx | 16 ----- src/components/layout/Player.tsx | 5 +- src/components/layout/sidebar/Sidebar.tsx | 17 +++-- .../layout/sidebar/SidebarGroup.tsx | 1 + 12 files changed, 53 insertions(+), 76 deletions(-) rename src/app/{index => }/page.tsx (100%) rename src/app/search/{search.tsx => page.tsx} (73%) delete mode 100644 src/components/layout/Layout.tsx diff --git a/src/__tests__/pages/404.test.tsx b/src/__tests__/pages/404.test.tsx index fc1f529..0fdfb60 100644 --- a/src/__tests__/pages/404.test.tsx +++ b/src/__tests__/pages/404.test.tsx @@ -1,8 +1,8 @@ import { render, screen } from '@testing-library/react'; -import NotFoundPage from '@/pages/404'; +import NotFoundPage from '@/app/not-found'; -describe('404', () => { +describe('not-found', () => { it('renders a heading', () => { render(); diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 6eb3ed1..7b02e53 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,54 +1,36 @@ -import React from 'react'; +import * as React from 'react'; import '../styles/globals.css'; -export default function RootLayout({ - children, -}: { - children: React.ReactNode; -}) { - return ( - - - - - {children} - - ); -} +import Player from '../components/layout/Player'; +import Sidebar from '../components/layout/sidebar/Sidebar'; -/*return ( - - - - - -
- - - - ); +export const metadata = { + title: { + default: 'Nex | Music Player', + template: '%s', + }, + siteName: 'Nex | Music Player', + description: 'A spotify inspired music players for communities and groups', + /** Without additional '/' on the end, e.g. https://theodorusclarence.com */ + url: 'https://nex.theditor.xyz', + type: 'website', + robots: 'follow, index', + /** + * No need to be filled, will be populated with openGraph function + * If you wish to use a normal image, just specify the path below + */ + image: 'https://theditor.xyz/assets/img/profile-img.jpg', } -function MyApp({ Component, pageProps }: AppProps) { +export default function Layout({ children }: { children: React.ReactNode }) { return ( - - - +
+
+ +
{children}
+
+ +
); } - -export default MyApp; -*/ diff --git a/src/app/index/page.tsx b/src/app/page.tsx similarity index 100% rename from src/app/index/page.tsx rename to src/app/page.tsx diff --git a/src/app/search/search.tsx b/src/app/search/page.tsx similarity index 73% rename from src/app/search/search.tsx rename to src/app/search/page.tsx index 3192f83..324cd75 100644 --- a/src/app/search/search.tsx +++ b/src/app/search/page.tsx @@ -1,11 +1,13 @@ +'use client'; import * as React from 'react'; -import Seo from '@/components/Seo'; +//import Seo from '@/components/Seo'; + export default function Search() { return ( <> - + {/* */}

Searching...

diff --git a/src/components/NextImage.tsx b/src/components/NextImage.tsx index 4a00355..bfb9023 100644 --- a/src/components/NextImage.tsx +++ b/src/components/NextImage.tsx @@ -1,3 +1,4 @@ +'use client'; import Image, { ImageProps } from 'next/image'; import * as React from 'react'; diff --git a/src/components/Seo.tsx b/src/components/Seo.tsx index 48ed8c9..f1644f3 100644 --- a/src/components/Seo.tsx +++ b/src/components/Seo.tsx @@ -1,3 +1,4 @@ +'use client'; import Head from 'next/head'; import { usePathname } from 'next/navigation'; @@ -45,8 +46,8 @@ export default function Seo(props: SeoProps) { {meta.title} - - + + {/* Open Graph */} diff --git a/src/components/carousel/Carousel.tsx b/src/components/carousel/Carousel.tsx index d0271b6..b2d6ff7 100644 --- a/src/components/carousel/Carousel.tsx +++ b/src/components/carousel/Carousel.tsx @@ -1,3 +1,4 @@ + import CarouselItem, { CarouselItemProps, } from '@/components/carousel/CarouselItem'; diff --git a/src/components/carousel/CarouselItem.tsx b/src/components/carousel/CarouselItem.tsx index efa6832..d280ddc 100644 --- a/src/components/carousel/CarouselItem.tsx +++ b/src/components/carousel/CarouselItem.tsx @@ -1,3 +1,4 @@ + import clsxm from '@/lib/clsxm'; import NextImage from '@/components/NextImage'; diff --git a/src/components/layout/Layout.tsx b/src/components/layout/Layout.tsx deleted file mode 100644 index 49a74e3..0000000 --- a/src/components/layout/Layout.tsx +++ /dev/null @@ -1,16 +0,0 @@ -import * as React from 'react'; - -import Player from '@/components/layout/Player'; -import Sidebar from '@/components/layout/sidebar/Sidebar'; - -export default function Layout({ children }: { children: React.ReactNode }) { - return ( -
-
- -
{children}
-
- -
- ); -} diff --git a/src/components/layout/Player.tsx b/src/components/layout/Player.tsx index c4ae88a..c54cef9 100644 --- a/src/components/layout/Player.tsx +++ b/src/components/layout/Player.tsx @@ -7,12 +7,13 @@ import { ImVolumeHigh, } from 'react-icons/im'; +import '@/styles/globals.css'; + import clsxm from '@/lib/clsxm'; import IconButton from '@/components/buttons/IconButton'; import NextImage from '@/components/NextImage'; import Slider from '@/components/Slider'; - interface PlayerProps { className?: string; } @@ -126,4 +127,4 @@ function VolumeControl({ ); -} +} \ No newline at end of file diff --git a/src/components/layout/sidebar/Sidebar.tsx b/src/components/layout/sidebar/Sidebar.tsx index d279d5a..c127bff 100644 --- a/src/components/layout/sidebar/Sidebar.tsx +++ b/src/components/layout/sidebar/Sidebar.tsx @@ -1,4 +1,6 @@ -import { useRouter } from 'next/router'; +'use client'; +import { useRouter } from 'next/navigation'; +import { usePathname } from 'next/navigation'; import { ImHome, ImSearch } from 'react-icons/im'; import { RiLoginBoxFill, RiLogoutBoxFill, RiUser3Fill } from 'react-icons/ri'; @@ -14,6 +16,7 @@ interface SidebarProps { export default function Sidebar({ className }: SidebarProps) { const router = useRouter(); const signedIn = false; + const pathname = usePathname(); return (
{ - if (router.asPath !== '/') router.push('/'); + if (pathname !== '/') router.push('/'); }, }, { id: '/search', icon: ImSearch, clickAction: () => { - if (router.asPath !== '/search') router.push('/search'); + if (pathname !== '/search') router.push('/search'); }, }, ]} /> { - if (router.asPath !== '/account') router.push('/account'); + if (pathname !== '/account') router.push('/account'); }, }, { id: 'auth', icon: signedIn ? RiLogoutBoxFill : RiLoginBoxFill, clickAction: () => { - if (!signedIn && router.asPath !== '/login') + if (!signedIn && pathname !== '/login') router.push('/login'); if (signedIn) router.push('/logout'); }, diff --git a/src/components/layout/sidebar/SidebarGroup.tsx b/src/components/layout/sidebar/SidebarGroup.tsx index a7fce9b..b3abe4b 100644 --- a/src/components/layout/sidebar/SidebarGroup.tsx +++ b/src/components/layout/sidebar/SidebarGroup.tsx @@ -1,3 +1,4 @@ +'use client'; import { IconType } from 'react-icons/lib'; import clsxm from '@/lib/clsxm'; From e53cad9297384d3fa30c8ffccbdac6647ace1472 Mon Sep 17 00:00:00 2001 From: OneRandomGithubUser <70461479+Anantu05@users.noreply.github.com> Date: Sat, 21 Oct 2023 16:10:03 +0530 Subject: [PATCH 03/15] Fixed CSS Fixed CSS, known issues: buttons are not directing to corresponding routes --- tailwind.config.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tailwind.config.ts b/tailwind.config.ts index 229f6b8..a43ad48 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -2,7 +2,7 @@ import type { Config } from 'tailwindcss'; import defaultTheme from 'tailwindcss/defaultTheme'; export default { - content: ['./src/app/**/*.{js,jsx,ts,tsx}'], + content: ['./src/**/*.{js,jsx,ts,tsx}'], theme: { fontFamily: { quicksand: ['Quicksand', 'sans-serif'], @@ -73,4 +73,4 @@ export default { }, }, plugins: [require('@tailwindcss/forms')], -} satisfies Config; +} satisfies Config; \ No newline at end of file From 775495fd11d461355d77d71725b8f77fcf30cbc8 Mon Sep 17 00:00:00 2001 From: OneRandomGithubUser <70461479+Anantu05@users.noreply.github.com> Date: Sun, 22 Oct 2023 11:27:17 +0530 Subject: [PATCH 04/15] Added SEO back to search page Known issues: Sidebar buttons won't work, not-found page won't work --- src/app/search/page.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/search/page.tsx b/src/app/search/page.tsx index 324cd75..4108c51 100644 --- a/src/app/search/page.tsx +++ b/src/app/search/page.tsx @@ -1,13 +1,13 @@ 'use client'; import * as React from 'react'; -//import Seo from '@/components/Seo'; +import Seo from '@/components/Seo'; export default function Search() { return ( <> - {/* */} +

Searching...

From bd4ff4a4c836461444745f1928575a0d0280e3c5 Mon Sep 17 00:00:00 2001 From: ThEditor Date: Mon, 23 Oct 2023 00:20:37 +0530 Subject: [PATCH 05/15] fix: html tags not added --- src/app/layout.tsx | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 7b02e53..7b64d0e 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -21,16 +21,20 @@ export const metadata = { * If you wish to use a normal image, just specify the path below */ image: 'https://theditor.xyz/assets/img/profile-img.jpg', -} +}; export default function Layout({ children }: { children: React.ReactNode }) { return ( -
-
- -
{children}
-
- -
+ + +
+
+ +
{children}
+
+ +
+ + ); } From c8e60d323778ff0d703bbd5ada53eb91e41d36ef Mon Sep 17 00:00:00 2001 From: OneRandomGithubUser <70461479+Anantu05@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:43:38 +0530 Subject: [PATCH 06/15] Fix: Migrated to Metadata API + not-found page improvements Migrated from SEO page to Metadata API, introduced different layouts for each page to differentiate server side components and client side components, improved not-found page --- src/app/account/layout.tsx | 16 ++++++ src/app/account/page.tsx | 20 +++----- src/app/layout.tsx | 17 +++---- src/app/login/layout.tsx | 59 ++++++++++++++++++++++ src/app/login/page.tsx | 63 +++--------------------- src/app/logout/layout.tsx | 25 ++++++++++ src/app/logout/page.tsx | 29 +++-------- src/app/not-found.tsx | 4 +- src/app/search/layout.tsx | 15 ++++++ src/app/search/page.tsx | 21 +++----- src/components/carousel/CarouselItem.tsx | 1 - 11 files changed, 148 insertions(+), 122 deletions(-) create mode 100644 src/app/account/layout.tsx create mode 100644 src/app/login/layout.tsx create mode 100644 src/app/logout/layout.tsx create mode 100644 src/app/search/layout.tsx diff --git a/src/app/account/layout.tsx b/src/app/account/layout.tsx new file mode 100644 index 0000000..980ffc7 --- /dev/null +++ b/src/app/account/layout.tsx @@ -0,0 +1,16 @@ +'use client'; +import * as React from 'react'; + +import Seo from '@/components/Seo'; + + +export default function AccountPage() { + return ( + <> + +
+

Account Settings Here

+
+ + ); +} diff --git a/src/app/account/page.tsx b/src/app/account/page.tsx index 7df893e..a308ac0 100644 --- a/src/app/account/page.tsx +++ b/src/app/account/page.tsx @@ -1,15 +1,7 @@ -'use client'; -import * as React from 'react'; - -import Seo from '@/components/Seo'; - -export default function AccountPage() { - return ( - <> - -
-

Account Settings Here

-
- - ); +import { Metadata } from "next" +export const metadata: Metadata = { + title: 'Account', } +export default function Account(){ + return; +} \ No newline at end of file diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 7b64d0e..d83c329 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,3 +1,4 @@ +import { Metadata } from 'next'; import * as React from 'react'; import '../styles/globals.css'; @@ -5,22 +6,16 @@ import '../styles/globals.css'; import Player from '../components/layout/Player'; import Sidebar from '../components/layout/sidebar/Sidebar'; -export const metadata = { +export const metadata: Metadata = { title: { default: 'Nex | Music Player', - template: '%s', + template: '%s | Nex', }, - siteName: 'Nex | Music Player', + applicationName: 'Nex | Music Player', description: 'A spotify inspired music players for communities and groups', - /** Without additional '/' on the end, e.g. https://theodorusclarence.com */ - url: 'https://nex.theditor.xyz', - type: 'website', + authors: {name: "ThEditor", url: 'https://nex.theditor.xyz'}, robots: 'follow, index', - /** - * No need to be filled, will be populated with openGraph function - * If you wish to use a normal image, just specify the path below - */ - image: 'https://theditor.xyz/assets/img/profile-img.jpg', + icons: {icon:'https://theditor.xyz/assets/img/profile-img.jpg'}, }; export default function Layout({ children }: { children: React.ReactNode }) { diff --git a/src/app/login/layout.tsx b/src/app/login/layout.tsx new file mode 100644 index 0000000..761f28a --- /dev/null +++ b/src/app/login/layout.tsx @@ -0,0 +1,59 @@ +'use client'; +import { useRouter } from 'next/navigation'; +import { useEffect } from 'react'; + +import Button from '@/components/buttons/Button'; +import UnderlineLink from '@/components/links/UnderlineLink'; + + +export default function LoginPage() { + const router = useRouter(); + const signedin = false; + + useEffect(() => { + if (signedin) router.push('/'); + }, [router, signedin]); + + if (signedin) { + router.push('/'); + return <>; + } + + return !signedin ? ( +
+
+

Sign In

+ + + + + + +
+
+ ) : ( + <> + ); +} diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index 25962ef..d7b1a87 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -1,58 +1,9 @@ -'use client'; -import { useRouter } from 'next/navigation'; -import { useEffect } from 'react'; +import { Metadata } from "next"; -import Button from '@/components/buttons/Button'; -import UnderlineLink from '@/components/links/UnderlineLink'; - -export default function LoginPage() { - const router = useRouter(); - const signedin = false; - - useEffect(() => { - if (signedin) router.push('/'); - }, [router, signedin]); - - if (signedin) { - router.push('/'); - return <>; - } - - return !signedin ? ( -
-
-

Sign In

- - - - - - -
-
- ) : ( - <> - ); +export const metadata: Metadata = { + title: "Login", } + +export default function Login(){ + return; +} \ No newline at end of file diff --git a/src/app/logout/layout.tsx b/src/app/logout/layout.tsx new file mode 100644 index 0000000..8345963 --- /dev/null +++ b/src/app/logout/layout.tsx @@ -0,0 +1,25 @@ +'use client'; + +import { useRouter } from 'next/navigation'; +import { useEffect } from 'react'; + +export default function LogoutPage() { + const router = useRouter(); + const signedin = true; + + useEffect(() => { + if (signedin) { + // todo: request logout + } + + router.push('/login'); + }, [router, signedin]); + + return signedin ? ( +
+

Logging you out...

+
+ ) : ( + <> + ); +} diff --git a/src/app/logout/page.tsx b/src/app/logout/page.tsx index 8345963..065d262 100644 --- a/src/app/logout/page.tsx +++ b/src/app/logout/page.tsx @@ -1,25 +1,8 @@ -'use client'; +import { Metadata } from "next"; -import { useRouter } from 'next/navigation'; -import { useEffect } from 'react'; - -export default function LogoutPage() { - const router = useRouter(); - const signedin = true; - - useEffect(() => { - if (signedin) { - // todo: request logout - } - - router.push('/login'); - }, [router, signedin]); - - return signedin ? ( -
-

Logging you out...

-
- ) : ( - <> - ); +export const metadata: Metadata = { + title: "Logout", } +export default function Logout(){ + return; +} \ No newline at end of file diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index ca98d53..1ba8f03 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -10,8 +10,8 @@ export default function NotFoundPage() {
-
-
+
+
+ +
+

Searching...

+
+ + ); +} diff --git a/src/app/search/page.tsx b/src/app/search/page.tsx index 4108c51..eceecd6 100644 --- a/src/app/search/page.tsx +++ b/src/app/search/page.tsx @@ -1,16 +1,7 @@ -'use client'; -import * as React from 'react'; - -import Seo from '@/components/Seo'; - - -export default function Search() { - return ( - <> - -
-

Searching...

-
- - ); +import { Metadata } from "next" +export const metadata: Metadata = { + title:"Search", } +export default function Search(){ + return; +} \ No newline at end of file diff --git a/src/components/carousel/CarouselItem.tsx b/src/components/carousel/CarouselItem.tsx index d280ddc..efa6832 100644 --- a/src/components/carousel/CarouselItem.tsx +++ b/src/components/carousel/CarouselItem.tsx @@ -1,4 +1,3 @@ - import clsxm from '@/lib/clsxm'; import NextImage from '@/components/NextImage'; From 3edced5ff04c4e8c1a5a2c0e6c537367516641f1 Mon Sep 17 00:00:00 2001 From: OneRandomGithubUser <70461479+Anantu05@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:46:18 +0530 Subject: [PATCH 07/15] Fix: Removed SEO page Removed SEO page and its references entirely. --- src/app/account/layout.tsx | 4 -- src/app/not-found.tsx | 3 - src/app/search/layout.tsx | 3 - src/components/Seo.tsx | 111 ------------------------------------- 4 files changed, 121 deletions(-) delete mode 100644 src/components/Seo.tsx diff --git a/src/app/account/layout.tsx b/src/app/account/layout.tsx index 980ffc7..140ba31 100644 --- a/src/app/account/layout.tsx +++ b/src/app/account/layout.tsx @@ -1,13 +1,9 @@ 'use client'; import * as React from 'react'; -import Seo from '@/components/Seo'; - - export default function AccountPage() { return ( <> -

Account Settings Here

diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index 1ba8f03..53d8868 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -2,13 +2,10 @@ import * as React from 'react'; import { RiAlarmWarningFill } from 'react-icons/ri'; import ArrowLink from '@/components/links/ArrowLink'; -import Seo from '@/components/Seo'; export default function NotFoundPage() { return (
- -
diff --git a/src/app/search/layout.tsx b/src/app/search/layout.tsx index 8006484..07cdf2d 100644 --- a/src/app/search/layout.tsx +++ b/src/app/search/layout.tsx @@ -1,12 +1,9 @@ 'use client'; import * as React from 'react'; -import Seo from '@/components/Seo'; - export default function Search() { return ( <> -

Searching...

diff --git a/src/components/Seo.tsx b/src/components/Seo.tsx deleted file mode 100644 index f1644f3..0000000 --- a/src/components/Seo.tsx +++ /dev/null @@ -1,111 +0,0 @@ -'use client'; -import Head from 'next/head'; -import { usePathname } from 'next/navigation'; - -const defaultMeta = { - title: 'Nex | Music Player', - siteName: 'Nex | Music Player', - description: 'A spotify inspired music players for communities and groups', - /** Without additional '/' on the end, e.g. https://theodorusclarence.com */ - url: 'https://nex.theditor.xyz', - type: 'website', - robots: 'follow, index', - /** - * No need to be filled, will be populated with openGraph function - * If you wish to use a normal image, just specify the path below - */ - image: 'https://theditor.xyz/assets/img/profile-img.jpg', -}; - -type SeoProps = { - date?: string; - templateTitle?: string; -} & Partial; - -export default function Seo(props: SeoProps) { - const meta = { - ...defaultMeta, - ...props, - }; - meta['title'] = props.templateTitle - ? `${props.templateTitle} | ${meta.siteName}` - : meta.title; - - // Use siteName if there is templateTitle - // but show full title if there is none - // !STARTERCONF Follow config for opengraph, by deploying one on https://github.com/theodorusclarence/og - // ? Uncomment code below if you want to use default open graph - // meta['image'] = openGraph({ - // description: meta.description, - // siteName: props.templateTitle ? meta.siteName : meta.title, - // templateTitle: props.templateTitle, - // }); - - return ( - - {meta.title} - - - - - {/* Open Graph */} - - - - - - {/* Twitter */} - - - - - - {meta.date && ( - <> - - - - - )} - - {/* Favicons */} - {favicons.map((linkProps) => ( - - ))} - - - - - ); -} - -const favicons: Array> = [ - { - rel: 'apple-touch-icon', - sizes: '180x180', - href: '/favicon/apple-touch-icon.png', - }, - { - rel: 'icon', - type: 'image/png', - sizes: '32x32', - href: '/favicon/favicon-32x32.png', - }, - { - rel: 'icon', - type: 'image/png', - sizes: '16x16', - href: '/favicon/favicon-16x16.png', - }, - { rel: 'manifest', href: '/favicon/site.webmanifest' }, - { - rel: 'mask-icon', - href: '/favicon/safari-pinned-tab.svg', - color: '#00e887', - }, - { rel: 'shortcut icon', href: '/favicon/favicon.ico' }, -]; From f97a668cdd65f55bd2c26451b7c88951ee3a8736 Mon Sep 17 00:00:00 2001 From: OneRandomGithubUser <70461479+Anantu05@users.noreply.github.com> Date: Mon, 23 Oct 2023 16:50:22 +0530 Subject: [PATCH 08/15] Fix: Minor code formatting --- src/app/account/page.tsx | 3 ++- src/app/logout/layout.tsx | 1 - src/app/search/page.tsx | 3 ++- src/components/carousel/Carousel.tsx | 1 - 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/app/account/page.tsx b/src/app/account/page.tsx index a308ac0..e081a16 100644 --- a/src/app/account/page.tsx +++ b/src/app/account/page.tsx @@ -1,4 +1,5 @@ -import { Metadata } from "next" +import { Metadata } from "next"; + export const metadata: Metadata = { title: 'Account', } diff --git a/src/app/logout/layout.tsx b/src/app/logout/layout.tsx index 8345963..4a09b11 100644 --- a/src/app/logout/layout.tsx +++ b/src/app/logout/layout.tsx @@ -1,5 +1,4 @@ 'use client'; - import { useRouter } from 'next/navigation'; import { useEffect } from 'react'; diff --git a/src/app/search/page.tsx b/src/app/search/page.tsx index eceecd6..5ab333c 100644 --- a/src/app/search/page.tsx +++ b/src/app/search/page.tsx @@ -1,4 +1,5 @@ -import { Metadata } from "next" +import { Metadata } from "next"; + export const metadata: Metadata = { title:"Search", } diff --git a/src/components/carousel/Carousel.tsx b/src/components/carousel/Carousel.tsx index b2d6ff7..d0271b6 100644 --- a/src/components/carousel/Carousel.tsx +++ b/src/components/carousel/Carousel.tsx @@ -1,4 +1,3 @@ - import CarouselItem, { CarouselItemProps, } from '@/components/carousel/CarouselItem'; From 5fd8f391f4bb389e31c30c963557365dee2d7dd9 Mon Sep 17 00:00:00 2001 From: OneRandomGithubUser <70461479+OneRandom1509@users.noreply.github.com> Date: Fri, 27 Oct 2023 23:13:54 +0530 Subject: [PATCH 09/15] "fix: changed login page to server side" --- src/app/login/layout.tsx | 59 ---------------------------------------- src/app/login/page.tsx | 52 +++++++++++++++++++++++++++++++++-- 2 files changed, 49 insertions(+), 62 deletions(-) delete mode 100644 src/app/login/layout.tsx diff --git a/src/app/login/layout.tsx b/src/app/login/layout.tsx deleted file mode 100644 index 761f28a..0000000 --- a/src/app/login/layout.tsx +++ /dev/null @@ -1,59 +0,0 @@ -'use client'; -import { useRouter } from 'next/navigation'; -import { useEffect } from 'react'; - -import Button from '@/components/buttons/Button'; -import UnderlineLink from '@/components/links/UnderlineLink'; - - -export default function LoginPage() { - const router = useRouter(); - const signedin = false; - - useEffect(() => { - if (signedin) router.push('/'); - }, [router, signedin]); - - if (signedin) { - router.push('/'); - return <>; - } - - return !signedin ? ( -
-
-

Sign In

- - - - - - -
-
- ) : ( - <> - ); -} diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index d7b1a87..bbb5764 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -1,9 +1,55 @@ import { Metadata } from "next"; +import { redirect } from 'next/navigation'; +import Button from '@/components/buttons/Button'; +import UnderlineLink from '@/components/links/UnderlineLink'; export const metadata: Metadata = { title: "Login", } -export default function Login(){ - return; -} \ No newline at end of file + +export default function LoginPage() { + + const signedin = false; + if (signedin) { + redirect('/'); + } + + return !signedin ? ( +
+
+

Sign In

+ + + + + + +
+
+ ) : ( + <> + ); +} From 94bf3c544c0a9217c0d03f5c6ddaf75fe51a9421 Mon Sep 17 00:00:00 2001 From: OneRandomGithubUser <70461479+OneRandom1509@users.noreply.github.com> Date: Fri, 27 Oct 2023 23:37:01 +0530 Subject: [PATCH 10/15] fix: changed account page to server side --- src/app/account/layout.tsx | 12 ------------ src/app/account/page.tsx | 15 +++++++++++---- src/app/login/page.tsx | 9 ++++----- 3 files changed, 15 insertions(+), 21 deletions(-) delete mode 100644 src/app/account/layout.tsx diff --git a/src/app/account/layout.tsx b/src/app/account/layout.tsx deleted file mode 100644 index 140ba31..0000000 --- a/src/app/account/layout.tsx +++ /dev/null @@ -1,12 +0,0 @@ -'use client'; -import * as React from 'react'; - -export default function AccountPage() { - return ( - <> -
-

Account Settings Here

-
- - ); -} diff --git a/src/app/account/page.tsx b/src/app/account/page.tsx index e081a16..e89b0c1 100644 --- a/src/app/account/page.tsx +++ b/src/app/account/page.tsx @@ -1,8 +1,15 @@ -import { Metadata } from "next"; +import { Metadata } from 'next'; export const metadata: Metadata = { title: 'Account', +}; + +export default function AccountPage() { + return ( + <> +
+

Account Settings Here

+
+ + ); } -export default function Account(){ - return; -} \ No newline at end of file diff --git a/src/app/login/page.tsx b/src/app/login/page.tsx index bbb5764..36d0b6a 100644 --- a/src/app/login/page.tsx +++ b/src/app/login/page.tsx @@ -1,15 +1,14 @@ -import { Metadata } from "next"; +import { Metadata } from 'next'; import { redirect } from 'next/navigation'; + import Button from '@/components/buttons/Button'; import UnderlineLink from '@/components/links/UnderlineLink'; export const metadata: Metadata = { - title: "Login", -} - + title: 'Login', +}; export default function LoginPage() { - const signedin = false; if (signedin) { redirect('/'); From 8a831fa2732ee3ebde6942591a2db3b0df7f470e Mon Sep 17 00:00:00 2001 From: OneRandomGithubUser <70461479+OneRandom1509@users.noreply.github.com> Date: Fri, 27 Oct 2023 23:39:07 +0530 Subject: [PATCH 11/15] fix: changed search page to server side --- src/app/search/layout.tsx | 12 ------------ src/app/search/page.tsx | 16 +++++++++++----- 2 files changed, 11 insertions(+), 17 deletions(-) delete mode 100644 src/app/search/layout.tsx diff --git a/src/app/search/layout.tsx b/src/app/search/layout.tsx deleted file mode 100644 index 07cdf2d..0000000 --- a/src/app/search/layout.tsx +++ /dev/null @@ -1,12 +0,0 @@ -'use client'; -import * as React from 'react'; - -export default function Search() { - return ( - <> -
-

Searching...

-
- - ); -} diff --git a/src/app/search/page.tsx b/src/app/search/page.tsx index 5ab333c..05ea4f7 100644 --- a/src/app/search/page.tsx +++ b/src/app/search/page.tsx @@ -1,8 +1,14 @@ -import { Metadata } from "next"; +import { Metadata } from 'next'; export const metadata: Metadata = { - title:"Search", + title: 'Search', +}; +export default function Search() { + return ( + <> +
+

Searching...

+
+ + ); } -export default function Search(){ - return; -} \ No newline at end of file From 7cdcdb45312d44fafc5ba41b3d4394dbf2a4ecb5 Mon Sep 17 00:00:00 2001 From: OneRandomGithubUser <70461479+OneRandom1509@users.noreply.github.com> Date: Sat, 28 Oct 2023 00:09:59 +0530 Subject: [PATCH 12/15] fix: removed old layouts folder --- src/app/layout.tsx | 8 ++++---- src/components/{layout => }/Player.tsx | 2 +- src/components/{layout => }/sidebar/Sidebar.tsx | 5 ++--- src/components/{layout => }/sidebar/SidebarGroup.tsx | 0 4 files changed, 7 insertions(+), 8 deletions(-) rename src/components/{layout => }/Player.tsx (99%) rename src/components/{layout => }/sidebar/Sidebar.tsx (92%) rename src/components/{layout => }/sidebar/SidebarGroup.tsx (100%) diff --git a/src/app/layout.tsx b/src/app/layout.tsx index d83c329..62d4be5 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -3,8 +3,8 @@ import * as React from 'react'; import '../styles/globals.css'; -import Player from '../components/layout/Player'; -import Sidebar from '../components/layout/sidebar/Sidebar'; +import Player from '../components/Player'; +import Sidebar from '../components/sidebar/Sidebar'; export const metadata: Metadata = { title: { @@ -13,9 +13,9 @@ export const metadata: Metadata = { }, applicationName: 'Nex | Music Player', description: 'A spotify inspired music players for communities and groups', - authors: {name: "ThEditor", url: 'https://nex.theditor.xyz'}, + authors: { name: 'ThEditor', url: 'https://nex.theditor.xyz' }, robots: 'follow, index', - icons: {icon:'https://theditor.xyz/assets/img/profile-img.jpg'}, + icons: { icon: 'https://theditor.xyz/assets/img/profile-img.jpg' }, }; export default function Layout({ children }: { children: React.ReactNode }) { diff --git a/src/components/layout/Player.tsx b/src/components/Player.tsx similarity index 99% rename from src/components/layout/Player.tsx rename to src/components/Player.tsx index c54cef9..a15ef86 100644 --- a/src/components/layout/Player.tsx +++ b/src/components/Player.tsx @@ -127,4 +127,4 @@ function VolumeControl({
); -} \ No newline at end of file +} diff --git a/src/components/layout/sidebar/Sidebar.tsx b/src/components/sidebar/Sidebar.tsx similarity index 92% rename from src/components/layout/sidebar/Sidebar.tsx rename to src/components/sidebar/Sidebar.tsx index c127bff..b31ba74 100644 --- a/src/components/layout/sidebar/Sidebar.tsx +++ b/src/components/sidebar/Sidebar.tsx @@ -6,8 +6,8 @@ import { RiLoginBoxFill, RiLogoutBoxFill, RiUser3Fill } from 'react-icons/ri'; import clsxm from '@/lib/clsxm'; -import SidebarGroup from '@/components/layout/sidebar/SidebarGroup'; import NextImage from '@/components/NextImage'; +import SidebarGroup from '@/components/sidebar/SidebarGroup'; interface SidebarProps { className?: string; @@ -71,8 +71,7 @@ export default function Sidebar({ className }: SidebarProps) { id: 'auth', icon: signedIn ? RiLogoutBoxFill : RiLoginBoxFill, clickAction: () => { - if (!signedIn && pathname !== '/login') - router.push('/login'); + if (!signedIn && pathname !== '/login') router.push('/login'); if (signedIn) router.push('/logout'); }, }, diff --git a/src/components/layout/sidebar/SidebarGroup.tsx b/src/components/sidebar/SidebarGroup.tsx similarity index 100% rename from src/components/layout/sidebar/SidebarGroup.tsx rename to src/components/sidebar/SidebarGroup.tsx From 2e57e275d1bc13ae990305f3a05b1df38c33d624 Mon Sep 17 00:00:00 2001 From: OneRandomGithubUser <70461479+OneRandom1509@users.noreply.github.com> Date: Sat, 28 Oct 2023 00:13:07 +0530 Subject: [PATCH 13/15] fix: reverted back not-found page --- src/app/not-found.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/not-found.tsx b/src/app/not-found.tsx index 53d8868..510818c 100644 --- a/src/app/not-found.tsx +++ b/src/app/not-found.tsx @@ -7,8 +7,8 @@ export default function NotFoundPage() { return (
-
-
+
+
Date: Sat, 28 Oct 2023 00:36:22 +0530 Subject: [PATCH 14/15] chore: replaced click action function with normal link --- src/app/page.tsx | 16 ++++------------ src/components/carousel/Carousel.tsx | 2 +- src/components/carousel/CarouselItem.tsx | 9 ++++++--- 3 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/app/page.tsx b/src/app/page.tsx index 66c38ce..a00745f 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -15,17 +15,13 @@ export default function HomePage() { { title: 'Life in a bubble', subtitle: 'The van', - clickAction: () => { - return; - }, + link: '/', imgSrc: '/images/test.png', }, { title: 'Life in a bubble', subtitle: 'The van', - clickAction: () => { - return; - }, + link: '/', imgSrc: '/images/test.png', }, ], @@ -36,17 +32,13 @@ export default function HomePage() { { title: 'Life in a bubble', subtitle: 'The van', - clickAction: () => { - return; - }, + link: '/', imgSrc: '/images/test.png', }, { title: 'Life in a bubble', subtitle: 'The van', - clickAction: () => { - return; - }, + link: '/', imgSrc: '/images/test.png', }, ], diff --git a/src/components/carousel/Carousel.tsx b/src/components/carousel/Carousel.tsx index d0271b6..68f8fb4 100644 --- a/src/components/carousel/Carousel.tsx +++ b/src/components/carousel/Carousel.tsx @@ -15,7 +15,7 @@ export default function Carousel({ data }: CarouselProps) { title={v.title} subtitle={v.subtitle} imgSrc={v.imgSrc} - clickAction={v.clickAction} + link={v.link} /> ))}
diff --git a/src/components/carousel/CarouselItem.tsx b/src/components/carousel/CarouselItem.tsx index efa6832..0da5b4f 100644 --- a/src/components/carousel/CarouselItem.tsx +++ b/src/components/carousel/CarouselItem.tsx @@ -1,3 +1,6 @@ +'use client'; +import { redirect } from 'next/navigation'; + import clsxm from '@/lib/clsxm'; import NextImage from '@/components/NextImage'; @@ -5,7 +8,7 @@ import NextImage from '@/components/NextImage'; export interface CarouselItemProps { title: string; subtitle: string; - clickAction: () => void; + link: string; imgSrc: string; className?: string; } @@ -13,7 +16,7 @@ export interface CarouselItemProps { export default function CarouselItem({ title, subtitle, - clickAction, + link, imgSrc, className, }: CarouselItemProps) { @@ -23,7 +26,7 @@ export default function CarouselItem({ className, 'text-light font-quicksand hover:bg-light flex w-fit cursor-pointer select-none flex-col gap-1 rounded-3xl p-3 transition-all ease-linear hover:bg-opacity-10' )} - onClick={() => clickAction()} + onClick={() => redirect(link)} > Date: Sat, 28 Oct 2023 11:05:24 +0530 Subject: [PATCH 15/15] fix: changed logout page to server side --- src/app/logout/layout.tsx | 24 ------------------------ src/app/logout/page.tsx | 14 +++++++++----- 2 files changed, 9 insertions(+), 29 deletions(-) delete mode 100644 src/app/logout/layout.tsx diff --git a/src/app/logout/layout.tsx b/src/app/logout/layout.tsx deleted file mode 100644 index 4a09b11..0000000 --- a/src/app/logout/layout.tsx +++ /dev/null @@ -1,24 +0,0 @@ -'use client'; -import { useRouter } from 'next/navigation'; -import { useEffect } from 'react'; - -export default function LogoutPage() { - const router = useRouter(); - const signedin = true; - - useEffect(() => { - if (signedin) { - // todo: request logout - } - - router.push('/login'); - }, [router, signedin]); - - return signedin ? ( -
-

Logging you out...

-
- ) : ( - <> - ); -} diff --git a/src/app/logout/page.tsx b/src/app/logout/page.tsx index 065d262..07e668c 100644 --- a/src/app/logout/page.tsx +++ b/src/app/logout/page.tsx @@ -1,8 +1,12 @@ -import { Metadata } from "next"; +import { Metadata } from 'next'; +import { redirect } from 'next/navigation'; export const metadata: Metadata = { - title: "Logout", + title: 'Logout', +}; + +export default function LogoutPage() { + const signedin = true; + + return signedin ? redirect('/') : <>; } -export default function Logout(){ - return; -} \ No newline at end of file