From c2c1599221a3b41f9392b55c076b8b3b21bbd267 Mon Sep 17 00:00:00 2001 From: Chris Hunt Date: Tue, 10 Jan 2023 09:41:42 +0000 Subject: [PATCH] Make registry more responsive Add dynamic route for clickable tiles Make copy url notification instead of alert Add achitecture to details --- .gitignore | 2 + site/components/App.js | 13 +- site/components/header.js | 11 +- site/components/layout.js | 3 + site/package-lock.json | 76 +++++++++-- site/package.json | 1 + .../pages/{addapp.js => addapp/[[...app]].js} | 129 +++++++++++++++--- site/styles/globals.css | 4 + site/yarn.lock | 38 ++++-- 9 files changed, 228 insertions(+), 49 deletions(-) rename site/pages/{addapp.js => addapp/[[...app]].js} (63%) diff --git a/.gitignore b/.gitignore index ee9d195..8f48256 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,8 @@ dist target packages/next/wasm/@next out +site/public/icons +site/public/list.json # dependencies node_modules diff --git a/site/components/App.js b/site/components/App.js index 9faef37..da95442 100644 --- a/site/components/App.js +++ b/site/components/App.js @@ -1,6 +1,17 @@ +import { useRouter } from 'next/router' + function App({ Component, pageProps, app }) { + const router = useRouter() + + const viewexample = (app) => { + router.push({ + pathname: '/addapp/[app]', + query: { app: btoa(app.name)} + }) + } + return ( -
+
viewexample(app)} className="w-[245px] h-[88px] transition-all relative cursor-pointer group flex p-2 items-center justify-center bg-slate-100/90 dark:bg-slate-900/90 shadow rounded hover:shadow-xl hover:bg-gradient-to-r hover:from-slate-900 hover:to-cyan-800 hover:text-white">
diff --git a/site/components/header.js b/site/components/header.js index cf0ca1c..9fa4a42 100644 --- a/site/components/header.js +++ b/site/components/header.js @@ -1,6 +1,7 @@ import Bubbles from '../components/Bubbles' import Link from 'next/link' import { useRouter } from "next/router"; +import { NotificationManager } from 'react-notifications'; export default function Header({ searchText, changeSearch }) { @@ -11,13 +12,13 @@ export default function Header({ searchText, changeSearch }) { textField.select() document.execCommand('copy') textField.remove() - alert('URL copied to clipboard') + NotificationManager.info('URL successfully copied to clipboard', 'Copy URL', 4000); } const listUrl = process.env.listUrl; const router = useRouter(); return ( -
+
{process.env.name}
@@ -45,8 +46,8 @@ export default function Header({ searchText, changeSearch }) {
@@ -62,7 +63,7 @@ export default function Header({ searchText, changeSearch }) {
- diff --git a/site/components/layout.js b/site/components/layout.js index c56f8c9..c6155b2 100644 --- a/site/components/layout.js +++ b/site/components/layout.js @@ -2,6 +2,8 @@ import Header from './header' import Footer from './footer' +import 'react-notifications/lib/notifications.css'; +import { NotificationContainer } from 'react-notifications'; export default function Layout({ children, searchText, changeSearch }) { return ( @@ -9,6 +11,7 @@ export default function Layout({ children, searchText, changeSearch }) {
{children}