From 8f89292522b83b78fd3f5b73d406cebf8976e41c Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Tue, 6 Jun 2023 09:58:42 +0200 Subject: [PATCH 01/17] fix: clipping text on small screens --- components/landing/hero.tsx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/landing/hero.tsx b/components/landing/hero.tsx index 5241658..ac14a37 100644 --- a/components/landing/hero.tsx +++ b/components/landing/hero.tsx @@ -29,7 +29,7 @@ export const Hero: React.FC = () => {

One Dashboard, Countless Solutions From 89b81530c7b8fa2de08762b490e50f1761a3398b Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Tue, 6 Jun 2023 21:26:14 +0200 Subject: [PATCH 02/17] task: Disable experimental features (esmExternals) --- next.config.js | 1 - 1 file changed, 1 deletion(-) diff --git a/next.config.js b/next.config.js index b86956e..9181109 100644 --- a/next.config.js +++ b/next.config.js @@ -2,7 +2,6 @@ const nextConfig = { reactStrictMode: true, experimental: { - esmExternals: "loose", appDir: true, }, } From 18bb4d94a584d35de7f67bbf0ae11453dc68340b Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Tue, 6 Jun 2023 21:30:03 +0200 Subject: [PATCH 03/17] task: Remove unreachable `tailwind-indicator` --- app/layout.tsx | 2 -- components/tailwind-indicator.tsx | 16 ---------------- 2 files changed, 18 deletions(-) delete mode 100644 components/tailwind-indicator.tsx diff --git a/app/layout.tsx b/app/layout.tsx index c0748a9..4f018e2 100644 --- a/app/layout.tsx +++ b/app/layout.tsx @@ -1,7 +1,6 @@ import { Inter } from 'next/font/google'; import LocalFont from "next/font/local"; -import { TailwindIndicator } from "@/components/tailwind-indicator"; import { ThemeProvider } from "@/components/theme-provider"; import "tailwindcss/tailwind.css"; import { ToastProvider } from "../toast-provider"; @@ -72,7 +71,6 @@ export default async function RootLayout({ children }: RootLayoutProps) { {children} - diff --git a/components/tailwind-indicator.tsx b/components/tailwind-indicator.tsx deleted file mode 100644 index 38d20e1..0000000 --- a/components/tailwind-indicator.tsx +++ /dev/null @@ -1,16 +0,0 @@ -export function TailwindIndicator() { - if (process.env.NODE_ENV === "production") { - return null; - } - return null; - return ( -
-
xs
-
sm
-
md
-
lg
-
xl
-
2xl
-
- ); -} From 91cd7f05d0c25025b0e508786b85c1c60bba6bc7 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Wed, 7 Jun 2023 08:49:57 +0200 Subject: [PATCH 04/17] feat: Changed logo and icon --- components/logo.tsx | 23 ++++++++++++++--------- public/favicon.png | Bin 197 -> 1198 bytes public/favicon.svg | 8 +++++++- 3 files changed, 21 insertions(+), 10 deletions(-) diff --git a/components/logo.tsx b/components/logo.tsx index 3cbdaf6..ef54a98 100644 --- a/components/logo.tsx +++ b/components/logo.tsx @@ -5,16 +5,21 @@ export const Logo: React.FC = ({ className }) => { return ( - {/* */} - - - - - + width="24" + height="24" + viewBox="0 0 24 24" + fill="none" + stroke="current" + stroke-width="2" + stroke-linecap="round" + stroke-linejoin="round"> + + + + ); }; + + diff --git a/public/favicon.png b/public/favicon.png index 71ce82b22e99dab306b665d13e036ab0ff384683..c0a2f675772ec17e888479ea7597a6906c08c61a 100644 GIT binary patch literal 1198 zcmV;f1X25mP)-|X-2 zKQYs6z5(VJ3D%jsoM1j6qE2knMyt{IYgi}^xeLr{9o_(86(a~W0(QW3RjKBW!-BN# zz7FEM0L~V`*#qOYQqIQ!4yAxh0kjT30pX(pk{C!Rd08p-o6M;fLDmBRvxTxU)|7It zOD<6W-;XX>cG5vH|NJ0jN4d>K$)khd4}e}Mo)f*qw&tbfAZ~)T9bd*&CJz9-ptVk| z>mUf8oYLe0V8)L5lIW0(%rp;5ng0gpetvF#D{ZqE0qh>1Jz%*(BOebI( zl^0-2#m-oWC1Vf-LLG4u=&3;qgT?VnBS0M6+m@ZA>AJ(-o!ErsOPDU!aderJU=26n$;Se0hTA=njZ}?{&NDb8~b5X2zAO zFK`6?U3BP9IuaabsJre97(y+8=>$xp@&cT+2{v>Xeh9{E02Tn`z6$`@1$Yx|ebIl; zFBLKc2*dE{1o#1r=O^Si1JE*vmvtE4QI7LIGLENAAZrN_GrlZf^2fng(Ym`*=$I2i z6hQ0ls|>s{6-G*KW$~IoMk4&u^eCzAN71v>8$Tc9S7Zp!q-!$#O5o4(5=fmLJC2`2 z5!Gb@5CtHRCA=c@*ma%Ub-4~g$!zBxXId!DS~P`P0MiMWMlFEp1Wcpy0+gmNz-;-_ zk=S^gyd;nwNRe_KK(xi+cLvPoDotMi06fp@fay&DI|Xs}`d^EzWd#iTW(WY_ zN74Dy=nEXh-rin&)^V;(*c^Qr+w}7!A5B#Pm9GP80Zb=g8kHB|KdQ2~hS&KY3;+NC M07*qoM6N<$g65_nkN^Mx literal 197 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM1|%Pp+x`GjJ)SO(As*g$rv~yhDDXHxOnG(o zYucgqlv6QYvKdbpYPa;aNLbCkVQJ69x@P6sCs#DmbuGQkKCt9yR_|k)qgUT2`O0C@ z%$=v+8NFD?$gHtjnZaCsy=6jeh};A=T{|s)jt3L_&oiumFT16yxtzD%HbQgoCtDnm{r-UW|@ \ No newline at end of file + + + + + + From 0346e4344033dae866839bb634cff8bd87b1a0bb Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 8 Jun 2023 00:34:52 +0200 Subject: [PATCH 05/17] feat: Use Clerk as middleware --- middleware.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 middleware.ts diff --git a/middleware.ts b/middleware.ts new file mode 100644 index 0000000..a6943ba --- /dev/null +++ b/middleware.ts @@ -0,0 +1,12 @@ +import { withClerkMiddleware } from "@clerk/nextjs/server"; +import { NextResponse } from "next/server"; +import type { NextRequest } from "next/server"; + +export default withClerkMiddleware((_req: NextRequest) => { + return NextResponse.next(); +}); + +// Stop Middleware running on static files and public folder +export const config = { + matcher: ["/((?!_next|_static|_vercel|[\\w-]+\\.\\w+).*)"], +}; From 1d4a5503a2308f0d26d6981d26e156f94c7d03f3 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 8 Jun 2023 00:35:35 +0200 Subject: [PATCH 06/17] feat: Add some `@radix` components --- package.json | 4 + yarn.lock | 280 ++++++++++++++++++++++++++++++++++++++++++++++++++- 2 files changed, 282 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index b7f1a72..7f6107e 100644 --- a/package.json +++ b/package.json @@ -10,6 +10,10 @@ }, "dependencies": { "@clerk/nextjs": "^4.19.0", + "@radix-ui/react-avatar": "^1.0.3", + "@radix-ui/react-dialog": "^1.0.4", + "@radix-ui/react-dropdown-menu": "^2.0.5", + "@radix-ui/react-scroll-area": "^1.0.4", "@radix-ui/react-toast": "^1.1.4", "@tailwindcss/forms": "^0.5.3", "@types/node": "20.2.5", diff --git a/yarn.lock b/yarn.lock index 8001d3c..bb0b1cb 100644 --- a/yarn.lock +++ b/yarn.lock @@ -110,6 +110,25 @@ resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.42.0.tgz#484a1d638de2911e6f5a30c12f49c7e4a3270fb6" integrity sha512-6SWlXpWU5AvId8Ac7zjzmIOqMOba/JWY8XZ4A7q7Gn1Vlfg/SFFIlrtHXt9nPn4op9ZPAkl91Jao+QQv3r/ukw== +"@floating-ui/core@^1.2.6": + version "1.2.6" + resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.2.6.tgz#d21ace437cc919cdd8f1640302fa8851e65e75c0" + integrity sha512-EvYTiXet5XqweYGClEmpu3BoxmsQ4hkj3QaYA6qEnigCWffTP3vNRwBReTdrwDwo7OoJ3wM8Uoe9Uk4n+d4hfg== + +"@floating-ui/dom@^1.2.7": + version "1.2.9" + resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.2.9.tgz#b9ed1c15d30963419a6736f1b7feb350dd49c603" + integrity sha512-sosQxsqgxMNkV3C+3UqTS6LxP7isRLwX8WMepp843Rb3/b0Wz8+MdUkxJksByip3C2WwLugLHN1b4ibn//zKwQ== + dependencies: + "@floating-ui/core" "^1.2.6" + +"@floating-ui/react-dom@^2.0.0": + version "2.0.0" + resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-2.0.0.tgz#7514baac526c818892bbcc84e1c3115008c029f9" + integrity sha512-Ke0oU3SeuABC2C4OFu2mSAwHIP5WUiV98O9YWoHV4Q5aT6E9k06DV0Khi5uYspR8xmmBk08t8ZDcz3TR3ARkEg== + dependencies: + "@floating-ui/dom" "^1.2.7" + "@humanwhocodes/config-array@^0.11.10": version "0.11.10" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.10.tgz#5a3ffe32cc9306365fb3fd572596cd602d5e12d2" @@ -283,6 +302,13 @@ picocolors "^1.0.0" tslib "^2.5.0" +"@radix-ui/number@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/number/-/number-1.0.1.tgz#644161a3557f46ed38a042acf4a770e826021674" + integrity sha512-T5gIdVO2mmPW3NNhjNgEP3cqMXjXL9UbO0BzWcXfvdBs+BohbQxvd/K5hSVKmn9/lbTdsQVKbUcP5WLCwvUbBg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive@1.0.1": version "1.0.1" resolved "https://registry.yarnpkg.com/@radix-ui/primitive/-/primitive-1.0.1.tgz#e46f9958b35d10e9f6dc71c497305c22e3e55dbd" @@ -290,6 +316,25 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-arrow@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-arrow/-/react-arrow-1.0.3.tgz#c24f7968996ed934d57fe6cde5d6ec7266e1d25d" + integrity sha512-wSP+pHsB/jQRaL6voubsQ/ZlrGBHHrOjmBnr19hxYgtS0WvAFwZhK2WP/YY5yF9uKECCEEDGxuLxq1NBK51wFA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "1.0.3" + +"@radix-ui/react-avatar@^1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-avatar/-/react-avatar-1.0.3.tgz#06a31d06bfb03be5e0d156a5af26a437dce96e7f" + integrity sha512-9ToF7YNex3Ste45LrAeTlKtONI9yVRt/zOS158iilIkW5K/Apeyb/TUQlcEFTEFvWr8Kzdi2ZYrm1/suiXPajQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-callback-ref" "1.0.1" + "@radix-ui/react-use-layout-effect" "1.0.1" + "@radix-ui/react-collection@1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@radix-ui/react-collection/-/react-collection-1.0.3.tgz#9595a66e09026187524a36c6e7e9c7d286469159" @@ -315,6 +360,34 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-dialog@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-dialog/-/react-dialog-1.0.4.tgz#06bce6c16bb93eb36d7a8589e665a20f4c1c52c1" + integrity sha512-hJtRy/jPULGQZceSAP2Re6/4NpKo8im6V8P2hUqZsdFiSL8l35kYsw3qbRI6Ay5mQd2+wlLqje770eq+RJ3yZg== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-dismissable-layer" "1.0.4" + "@radix-ui/react-focus-guards" "1.0.1" + "@radix-ui/react-focus-scope" "1.0.3" + "@radix-ui/react-id" "1.0.1" + "@radix-ui/react-portal" "1.0.3" + "@radix-ui/react-presence" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-slot" "1.0.2" + "@radix-ui/react-use-controllable-state" "1.0.1" + aria-hidden "^1.1.1" + react-remove-scroll "2.5.5" + +"@radix-ui/react-direction@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-direction/-/react-direction-1.0.1.tgz#9cb61bf2ccf568f3421422d182637b7f47596c9b" + integrity sha512-RXcvnXgyvYvBEOhCBuddKecVkoMiI10Jcm5cTI7abJRAHYfFxeu+FBQs/DvdxSYucxR5mna0dNsL6QFlds5TMA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-dismissable-layer@1.0.4": version "1.0.4" resolved "https://registry.yarnpkg.com/@radix-ui/react-dismissable-layer/-/react-dismissable-layer-1.0.4.tgz#883a48f5f938fa679427aa17fcba70c5494c6978" @@ -327,6 +400,87 @@ "@radix-ui/react-use-callback-ref" "1.0.1" "@radix-ui/react-use-escape-keydown" "1.0.3" +"@radix-ui/react-dropdown-menu@^2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@radix-ui/react-dropdown-menu/-/react-dropdown-menu-2.0.5.tgz#19bf4de8ffa348b4eb6a86842f14eff93d741170" + integrity sha512-xdOrZzOTocqqkCkYo8yRPCib5OkTkqN7lqNCdxwPOdE466DOaNl4N8PkUIlsXthQvW5Wwkd+aEmWpfWlBoDPEw== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-id" "1.0.1" + "@radix-ui/react-menu" "2.0.5" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-controllable-state" "1.0.1" + +"@radix-ui/react-focus-guards@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-focus-guards/-/react-focus-guards-1.0.1.tgz#1ea7e32092216b946397866199d892f71f7f98ad" + integrity sha512-Rect2dWbQ8waGzhMavsIbmSVCgYxkXLxxR3ZvCX79JOglzdEy4JXMb98lq4hPxUbLr77nP0UOGf4rcMU+s1pUA== + dependencies: + "@babel/runtime" "^7.13.10" + +"@radix-ui/react-focus-scope@1.0.3": + version "1.0.3" + resolved "https://registry.yarnpkg.com/@radix-ui/react-focus-scope/-/react-focus-scope-1.0.3.tgz#9c2e8d4ed1189a1d419ee61edd5c1828726472f9" + integrity sha512-upXdPfqI4islj2CslyfUBNlaJCPybbqRHAi1KER7Isel9Q2AtSJ0zRBZv8mWQiFXD2nyAJ4BhC3yXgZ6kMBSrQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-callback-ref" "1.0.1" + +"@radix-ui/react-id@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-id/-/react-id-1.0.1.tgz#73cdc181f650e4df24f0b6a5b7aa426b912c88c0" + integrity sha512-tI7sT/kqYp8p96yGWY1OAnLHrqDgzHefRBKQ2YAkBS5ja7QLcZ9Z/uY7bEjPUatf8RomoXM8/1sMj1IJaE5UzQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-layout-effect" "1.0.1" + +"@radix-ui/react-menu@2.0.5": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@radix-ui/react-menu/-/react-menu-2.0.5.tgz#a7d78b0808c4d38269240bf5d5c7ffea3e225e16" + integrity sha512-Gw4f9pwdH+w5w+49k0gLjN0PfRDHvxmAgG16AbyJZ7zhwZ6PBHKtWohvnSwfusfnK3L68dpBREHpVkj8wEM7ZA== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-collection" "1.0.3" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-direction" "1.0.1" + "@radix-ui/react-dismissable-layer" "1.0.4" + "@radix-ui/react-focus-guards" "1.0.1" + "@radix-ui/react-focus-scope" "1.0.3" + "@radix-ui/react-id" "1.0.1" + "@radix-ui/react-popper" "1.1.2" + "@radix-ui/react-portal" "1.0.3" + "@radix-ui/react-presence" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-roving-focus" "1.0.4" + "@radix-ui/react-slot" "1.0.2" + "@radix-ui/react-use-callback-ref" "1.0.1" + aria-hidden "^1.1.1" + react-remove-scroll "2.5.5" + +"@radix-ui/react-popper@1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-popper/-/react-popper-1.1.2.tgz#4c0b96fcd188dc1f334e02dba2d538973ad842e9" + integrity sha512-1CnGGfFi/bbqtJZZ0P/NQY20xdG3E0LALJaLUEoKwPLwl6PPPfbeiCqMVQnhoFRAxjJj4RpBRJzDmUgsex2tSg== + dependencies: + "@babel/runtime" "^7.13.10" + "@floating-ui/react-dom" "^2.0.0" + "@radix-ui/react-arrow" "1.0.3" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-callback-ref" "1.0.1" + "@radix-ui/react-use-layout-effect" "1.0.1" + "@radix-ui/react-use-rect" "1.0.1" + "@radix-ui/react-use-size" "1.0.1" + "@radix-ui/rect" "1.0.1" + "@radix-ui/react-portal@1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@radix-ui/react-portal/-/react-portal-1.0.3.tgz#ffb961244c8ed1b46f039e6c215a6c4d9989bda1" @@ -352,6 +506,38 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-slot" "1.0.2" +"@radix-ui/react-roving-focus@1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-roving-focus/-/react-roving-focus-1.0.4.tgz#e90c4a6a5f6ac09d3b8c1f5b5e81aab2f0db1974" + integrity sha512-2mUg5Mgcu001VkGy+FfzZyzbmuUWzgWkj3rvv4yu+mLw03+mTzbxZHvfcGyFp2b8EkQeMkpRQ5FiA2Vr2O6TeQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-collection" "1.0.3" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-direction" "1.0.1" + "@radix-ui/react-id" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-callback-ref" "1.0.1" + "@radix-ui/react-use-controllable-state" "1.0.1" + +"@radix-ui/react-scroll-area@^1.0.4": + version "1.0.4" + resolved "https://registry.yarnpkg.com/@radix-ui/react-scroll-area/-/react-scroll-area-1.0.4.tgz#13c36c453b2880aba57df67fb91a1d3f9b18998d" + integrity sha512-OIClwBkwPG+FKvC4OMTRaa/3cfD069nkKFFL/TQzRzaO42Ce5ivKU9VMKgT7UU6UIkjcQqKBrDOIzWtPGw6e6w== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/number" "1.0.1" + "@radix-ui/primitive" "1.0.1" + "@radix-ui/react-compose-refs" "1.0.1" + "@radix-ui/react-context" "1.0.1" + "@radix-ui/react-direction" "1.0.1" + "@radix-ui/react-presence" "1.0.1" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-use-callback-ref" "1.0.1" + "@radix-ui/react-use-layout-effect" "1.0.1" + "@radix-ui/react-slot@1.0.2": version "1.0.2" resolved "https://registry.yarnpkg.com/@radix-ui/react-slot/-/react-slot-1.0.2.tgz#a9ff4423eade67f501ffb32ec22064bc9d3099ab" @@ -409,6 +595,22 @@ dependencies: "@babel/runtime" "^7.13.10" +"@radix-ui/react-use-rect@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-rect/-/react-use-rect-1.0.1.tgz#fde50b3bb9fd08f4a1cd204572e5943c244fcec2" + integrity sha512-Cq5DLuSiuYVKNU8orzJMbl15TXilTnJKUCltMVQg53BQOF1/C5toAaGrowkgksdBQ9H+SRL23g0HDmg9tvmxXw== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/rect" "1.0.1" + +"@radix-ui/react-use-size@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/react-use-size/-/react-use-size-1.0.1.tgz#1c5f5fea940a7d7ade77694bb98116fb49f870b2" + integrity sha512-ibay+VqrgcaI6veAojjofPATwledXiSmX+C0KrBk/xgpX9rBzPV3OsfwlhQdUOFbh+LKQorLYT+xTXW9V8yd0g== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-use-layout-effect" "1.0.1" + "@radix-ui/react-visually-hidden@1.0.3": version "1.0.3" resolved "https://registry.yarnpkg.com/@radix-ui/react-visually-hidden/-/react-visually-hidden-1.0.3.tgz#51aed9dd0fe5abcad7dee2a234ad36106a6984ac" @@ -417,6 +619,13 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-primitive" "1.0.3" +"@radix-ui/rect@1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@radix-ui/rect/-/rect-1.0.1.tgz#bf8e7d947671996da2e30f4904ece343bc4a883f" + integrity sha512-fyrgCaedtvMg9NK3en0pnOYJdtfwxUcNolezkNPUsoX57X8oQk+NkqcvzHXD2uKNij6GXmWU9NDru2IWjrO4BQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@rushstack/eslint-patch@^1.1.3": version "1.3.0" resolved "https://registry.yarnpkg.com/@rushstack/eslint-patch/-/eslint-patch-1.3.0.tgz#f5635b36fc0dad96ef1e542a302cd914230188c0" @@ -694,6 +903,13 @@ argparse@^2.0.1: resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== +aria-hidden@^1.1.1: + version "1.2.3" + resolved "https://registry.yarnpkg.com/aria-hidden/-/aria-hidden-1.2.3.tgz#14aeb7fb692bbb72d69bebfa47279c1fd725e954" + integrity sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ== + dependencies: + tslib "^2.0.0" + aria-query@^5.1.3: version "5.1.3" resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-5.1.3.tgz#19db27cd101152773631396f7a95a3b58c22c35e" @@ -1094,6 +1310,11 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ== +detect-node-es@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/detect-node-es/-/detect-node-es-1.1.0.tgz#163acdf643330caa0b4cd7c21e7ee7755d6fa493" + integrity sha512-ypdmJU/TbBby2Dxibuv7ZLW3Bs1QEmM7nHjEANfohJLvE0XVujisn1qPJcZxg+qDucsr+bP6fLD1rPS3AhJ7EQ== + didyoumean@^1.2.2: version "1.2.2" resolved "https://registry.yarnpkg.com/didyoumean/-/didyoumean-1.2.2.tgz#989346ffe9e839b4555ecf5666edea0d3e8ad037" @@ -1605,6 +1826,11 @@ get-intrinsic@^1.0.2, get-intrinsic@^1.1.1, get-intrinsic@^1.1.3, get-intrinsic@ has-proto "^1.0.1" has-symbols "^1.0.3" +get-nonce@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/get-nonce/-/get-nonce-1.0.1.tgz#fdf3f0278073820d2ce9426c18f07481b1e0cdf3" + integrity sha512-FJhYRoDaiatfEkUK8HKlicmu/3SGFD51q3itKDGoSTysQJBnfOcxU5GxnhE1E6soB76MbT0MBtnKJuXyAx+96Q== + get-stream@^6.0.0, get-stream@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" @@ -1825,6 +2051,13 @@ internal-slot@^1.0.3, internal-slot@^1.0.4, internal-slot@^1.0.5: has "^1.0.3" side-channel "^1.0.4" +invariant@^2.2.4: + version "2.2.4" + resolved "https://registry.yarnpkg.com/invariant/-/invariant-2.2.4.tgz#610f3c92c9359ce1db616e538008d23ff35158e6" + integrity sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA== + dependencies: + loose-envify "^1.0.0" + is-arguments@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/is-arguments/-/is-arguments-1.1.1.tgz#15b3f88fda01f2a97fec84ca761a560f123efa9b" @@ -2125,7 +2358,7 @@ lodash.throttle@^4.0.1: resolved "https://registry.yarnpkg.com/lodash.throttle/-/lodash.throttle-4.1.1.tgz#c23e91b710242ac70c37f1e1cda9274cc39bf2f4" integrity sha512-wIkUCfVKpVsWo3JSZlc+8MB5it+2AN5W8J7YVMST30UrvcQNZ1Okbj+rbVniijTWE6FGYy4XJq/rHkas8qJMLQ== -loose-envify@^1.1.0, loose-envify@^1.4.0: +loose-envify@^1.0.0, loose-envify@^1.1.0, loose-envify@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/loose-envify/-/loose-envify-1.4.0.tgz#71ee51fa7be4caec1a63839f7e682d8132d30caf" integrity sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q== @@ -2620,6 +2853,34 @@ react-is@^16.13.1: resolved "https://registry.yarnpkg.com/react-is/-/react-is-16.13.1.tgz#789729a4dc36de2999dc156dd6c1d9c18cea56a4" integrity sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ== +react-remove-scroll-bar@^2.3.3: + version "2.3.4" + resolved "https://registry.yarnpkg.com/react-remove-scroll-bar/-/react-remove-scroll-bar-2.3.4.tgz#53e272d7a5cb8242990c7f144c44d8bd8ab5afd9" + integrity sha512-63C4YQBUt0m6ALadE9XV56hV8BgJWDmmTPY758iIJjfQKt2nYwoUrPk0LXRXcB/yIj82T1/Ixfdpdk68LwIB0A== + dependencies: + react-style-singleton "^2.2.1" + tslib "^2.0.0" + +react-remove-scroll@2.5.5: + version "2.5.5" + resolved "https://registry.yarnpkg.com/react-remove-scroll/-/react-remove-scroll-2.5.5.tgz#1e31a1260df08887a8a0e46d09271b52b3a37e77" + integrity sha512-ImKhrzJJsyXJfBZ4bzu8Bwpka14c/fQt0k+cyFp/PBhTfyDnU5hjOtM4AG/0AMyy8oKzOTR0lDgJIM7pYXI0kw== + dependencies: + react-remove-scroll-bar "^2.3.3" + react-style-singleton "^2.2.1" + tslib "^2.1.0" + use-callback-ref "^1.3.0" + use-sidecar "^1.1.2" + +react-style-singleton@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/react-style-singleton/-/react-style-singleton-2.2.1.tgz#f99e420492b2d8f34d38308ff660b60d0b1205b4" + integrity sha512-ZWj0fHEMyWkHzKYUr2Bs/4zU6XLmq9HsgBURm7g5pAVfyn49DgUiNgY2d4lXRlYSiCif9YBGpQleewkcqddc7g== + dependencies: + get-nonce "^1.0.0" + invariant "^2.2.4" + tslib "^2.0.0" + react-wrap-balancer@^0.5.0: version "0.5.0" resolved "https://registry.yarnpkg.com/react-wrap-balancer/-/react-wrap-balancer-0.5.0.tgz#a63b14b6a125c8f15509e6f8be7e2faaae5ad8a9" @@ -3052,7 +3313,7 @@ tslib@^1.8.1: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.0.3, tslib@^2.4.0, tslib@^2.4.1, tslib@^2.5.0: +tslib@^2.0.0, tslib@^2.0.3, tslib@^2.1.0, tslib@^2.4.0, tslib@^2.4.1, tslib@^2.5.0: version "2.5.3" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.5.3.tgz#24944ba2d990940e6e982c4bea147aba80209913" integrity sha512-mSxlJJwl3BMEQCUNnxXBU9jP4JBktcEGhURcPR6VQVlnP0FdDEsIaz0C35dXNGLyRfrATNofF0F5p2KPxQgB+w== @@ -3125,6 +3386,21 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" +use-callback-ref@^1.3.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/use-callback-ref/-/use-callback-ref-1.3.0.tgz#772199899b9c9a50526fedc4993fc7fa1f7e32d5" + integrity sha512-3FT9PRuRdbB9HfXhEq35u4oZkvpJ5kuYbpqhCfmiZyReuRgpnhDlbr2ZEnnuS0RrJAPn6l23xjFg9kpDM+Ms7w== + dependencies: + tslib "^2.0.0" + +use-sidecar@^1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/use-sidecar/-/use-sidecar-1.1.2.tgz#2f43126ba2d7d7e117aa5855e5d8f0276dfe73c2" + integrity sha512-epTbsLuzZ7lPClpz2TyryBfztm7m+28DlEv2ZCQ3MDr5ssiwyOwGH/e5F9CkfWjJ1t4clvI58yF822/GUkjjhw== + dependencies: + detect-node-es "^1.1.0" + tslib "^2.0.0" + util-deprecate@^1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/util-deprecate/-/util-deprecate-1.0.2.tgz#450d4dc9fa70de732762fbd2d4a28981419a0ccf" From 7a0d95710067081bceabaf49d02646de150c40e3 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 8 Jun 2023 00:36:09 +0200 Subject: [PATCH 07/17] feat: Add CSS for Tailwind imports --- app/(landing)/css/additional-styles/theme.css | 83 +++++++++++++++++++ app/(landing)/css/style.css | 14 ++++ 2 files changed, 97 insertions(+) create mode 100644 app/(landing)/css/additional-styles/theme.css create mode 100644 app/(landing)/css/style.css diff --git a/app/(landing)/css/additional-styles/theme.css b/app/(landing)/css/additional-styles/theme.css new file mode 100644 index 0000000..afe3f08 --- /dev/null +++ b/app/(landing)/css/additional-styles/theme.css @@ -0,0 +1,83 @@ + +/* Custom AOS distance */ +@media screen { + html:not(.no-js) [data-aos=fade-up] { + -webkit-transform: translate3d(0, 14px, 0); + transform: translate3d(0, 14px, 0); + } + + html:not(.no-js) [data-aos=fade-down] { + -webkit-transform: translate3d(0, -14px, 0); + transform: translate3d(0, -14px, 0); + } + + html:not(.no-js) [data-aos=fade-right] { + -webkit-transform: translate3d(-14px, 0, 0); + transform: translate3d(-14px, 0, 0); + } + + html:not(.no-js) [data-aos=fade-left] { + -webkit-transform: translate3d(14px, 0, 0); + transform: translate3d(14px, 0, 0); + } + + html:not(.no-js) [data-aos=fade-up-right] { + -webkit-transform: translate3d(-14px, 14px, 0); + transform: translate3d(-14px, 14px, 0); + } + + html:not(.no-js) [data-aos=fade-up-left] { + -webkit-transform: translate3d(14px, 14px, 0); + transform: translate3d(14px, 14px, 0); + } + + html:not(.no-js) [data-aos=fade-down-right] { + -webkit-transform: translate3d(-14px, -14px, 0); + transform: translate3d(-14px, -14px, 0); + } + + html:not(.no-js) [data-aos=fade-down-left] { + -webkit-transform: translate3d(14px, -14px, 0); + transform: translate3d(14px, -14px, 0); + } + + html:not(.no-js) [data-aos=zoom-in-up] { + -webkit-transform: translate3d(0, 14px, 0) scale(.6); + transform: translate3d(0, 14px, 0) scale(.6); + } + + html:not(.no-js) [data-aos=zoom-in-down] { + -webkit-transform: translate3d(0, -14px, 0) scale(.6); + transform: translate3d(0, -14px, 0) scale(.6); + } + + html:not(.no-js) [data-aos=zoom-in-right] { + -webkit-transform: translate3d(-14px, 0, 0) scale(.6); + transform: translate3d(-14px, 0, 0) scale(.6); + } + + html:not(.no-js) [data-aos=zoom-in-left] { + -webkit-transform: translate3d(14px, 0, 0) scale(.6); + transform: translate3d(14px, 0, 0) scale(.6); + } + + html:not(.no-js) [data-aos=zoom-out-up] { + -webkit-transform: translate3d(0, 14px, 0) scale(1.2); + transform: translate3d(0, 14px, 0) scale(1.2); + } + + html:not(.no-js) [data-aos=zoom-out-down] { + -webkit-transform: translate3d(0, -14px, 0) scale(1.2); + transform: translate3d(0, -14px, 0) scale(1.2); + } + + html:not(.no-js) [data-aos=zoom-out-right] { + -webkit-transform: translate3d(-14px, 0, 0) scale(1.2); + transform: translate3d(-14px, 0, 0) scale(1.2); + } + + html:not(.no-js) [data-aos=zoom-out-left] { + -webkit-transform: translate3d(14px, 0, 0) scale(1.2); + transform: translate3d(14px, 0, 0) scale(1.2); + } +} \ No newline at end of file diff --git a/app/(landing)/css/style.css b/app/(landing)/css/style.css new file mode 100644 index 0000000..5bd9cac --- /dev/null +++ b/app/(landing)/css/style.css @@ -0,0 +1,14 @@ +@import 'tailwindcss/base'; +@import 'tailwindcss/components'; + +@import 'additional-styles/theme.css'; + +@import 'tailwindcss/utilities'; + +/* Additional Tailwind directives: https://tailwindcss.com/docs/functions-and-directives/#responsive */ +@layer utilities { + .rtl { + direction: rtl; + } +} + From 5fe16ec370b0e82cac253545a683f8f757024b08 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 8 Jun 2023 00:36:39 +0200 Subject: [PATCH 08/17] refactor: Change URLs for after authentication --- app/(authenticated)/layout.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/(authenticated)/layout.tsx b/app/(authenticated)/layout.tsx index 53c63f6..d972fce 100644 --- a/app/(authenticated)/layout.tsx +++ b/app/(authenticated)/layout.tsx @@ -20,8 +20,8 @@ export default function AppLayout({ colorText: "#161616", }, }} - afterSignInUrl={"/"} - afterSignUpUrl={"/"} + afterSignInUrl={"/overview"} + afterSignUpUrl={"/overview"} /> From 01c95b65be45c62d556b7032163e67f6b3370903 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 8 Jun 2023 00:37:16 +0200 Subject: [PATCH 09/17] feat: Add a bunch of generic UI components --- components/ui/avatar.tsx | 47 ++++++++ components/ui/button.tsx | 47 ++++++++ components/ui/dropdown-menu.tsx | 191 +++++++++++++++++++++++++++++ components/ui/input.tsx | 21 ++++ components/ui/label.tsx | 23 ++++ components/ui/scroll-area.tsx | 46 +++++++ components/ui/sheet.tsx | 207 ++++++++++++++++++++++++++++++++ 7 files changed, 582 insertions(+) create mode 100644 components/ui/avatar.tsx create mode 100644 components/ui/button.tsx create mode 100644 components/ui/dropdown-menu.tsx create mode 100644 components/ui/input.tsx create mode 100644 components/ui/label.tsx create mode 100644 components/ui/scroll-area.tsx create mode 100644 components/ui/sheet.tsx diff --git a/components/ui/avatar.tsx b/components/ui/avatar.tsx new file mode 100644 index 0000000..1d9ba9d --- /dev/null +++ b/components/ui/avatar.tsx @@ -0,0 +1,47 @@ +"use client"; + +import * as React from "react"; +import * as AvatarPrimitive from "@radix-ui/react-avatar"; + +import { cn } from "@/lib/utils"; + +const Avatar = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)); +Avatar.displayName = AvatarPrimitive.Root.displayName; + +const AvatarImage = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)); +AvatarImage.displayName = AvatarPrimitive.Image.displayName; + +const AvatarFallback = React.forwardRef< + React.ElementRef, + React.ComponentPropsWithoutRef +>(({ className, ...props }, ref) => ( + +)); +AvatarFallback.displayName = AvatarPrimitive.Fallback.displayName; + +export { Avatar, AvatarImage, AvatarFallback }; diff --git a/components/ui/button.tsx b/components/ui/button.tsx new file mode 100644 index 0000000..ba96182 --- /dev/null +++ b/components/ui/button.tsx @@ -0,0 +1,47 @@ +import * as React from "react"; +import { VariantProps, cva } from "class-variance-authority"; + +import { cn } from "@/lib/utils"; + +const buttonVariants = cva( + "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus:outline-none dark:hover:bg-zinc-800 dark:hover:text-zinc-100 disabled:opacity-50 disabled:pointer-events-none data-[state=open]:bg-zinc-100 dark:data-[state=open]:bg-zinc-800", + { + variants: { + variant: { + default: "bg-zinc-900 text-white hover:bg-zinc-700 dark:bg-zinc-50 dark:text-zinc-900", + destructive: "bg-red-500 text-white hover:bg-red-600 dark:hover:bg-red-600", + outline: + "bg-transparent border border-zinc-200 hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-100", + subtle: "bg-zinc-100 text-zinc-900 hover:bg-zinc-200 dark:bg-zinc-800 dark:text-zinc-100", + ghost: + "bg-transparent hover:bg-zinc-100 dark:hover:bg-zinc-800 dark:text-zinc-100 dark:hover:text-zinc-100 data-[state=open]:bg-transparent dark:data-[state=open]:bg-transparent", + link: "bg-transparent dark:bg-transparent underline-offset-4 hover:underline text-zinc-900 dark:text-zinc-100 hover:bg-transparent dark:hover:bg-transparent", + }, + size: { + square: "h-10 w-10", + default: "h-10 py-2 px-4", + sm: "h-9 px-2 rounded-md", + lg: "h-11 px-8 rounded-md", + }, + }, + defaultVariants: { + variant: "default", + size: "default", + }, + }, +); + +export interface ButtonProps + extends React.ButtonHTMLAttributes, + VariantProps {} + +const Button = React.forwardRef( + ({ className, variant, size, ...props }, ref) => { + return ( + + + + + + Omnidash + + + + + {/* {docsConfig.sidebarNav?.map( + (item, index) => + item.href && ( + + {item.title} + + ) + )} + {docsConfig.sidebarNav.map((item, index) => ( + + + {item.title} + + {item?.items?.length && + item.items.map((item) => ( + + {item.href ? ( + {item.title} + ) : ( + item.title + )} + + ))} + + ))} */} + + + + ); +} diff --git a/components/page-header.tsx b/components/page-header.tsx new file mode 100644 index 0000000..00859ac --- /dev/null +++ b/components/page-header.tsx @@ -0,0 +1,21 @@ +type Props = { + title: string; + description?: string; + actions?: React.ReactNode[]; +}; + +export const PageHeader: React.FC = ({ title, description, actions }) => { + return ( +
+
+

{title}

+

{description}

+
+
    + {(actions ?? []).map((action, i) => ( +
  • {action}
  • + ))} +
+
+ ); +}; From 130a4932e646b39a2df045c25ca002f44f975b72 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 8 Jun 2023 00:38:36 +0200 Subject: [PATCH 12/17] feat: Auth library for Tenant and User ID --- lib/auth.ts | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 lib/auth.ts diff --git a/lib/auth.ts b/lib/auth.ts new file mode 100644 index 0000000..4a8cd95 --- /dev/null +++ b/lib/auth.ts @@ -0,0 +1,12 @@ +import { auth } from "@clerk/nextjs/app-beta"; +import { notFound } from "next/navigation"; + +/** + * Return the tenant id or a 404 not found page. + * + * The auth check should already be done at a higher level, and we're just returning 404 to make typescript happy. + */ +export function getTenantId(): string { + const { userId, orgId } = auth(); + return orgId ?? userId ?? notFound(); +} From 6c4b88cff7f17c3003915a53224d3ad40e600dff Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 8 Jun 2023 00:39:28 +0200 Subject: [PATCH 13/17] feat: Add pages/components for authenticated flow --- app/(authenticated)/(app)/DesktopSidebar.tsx | 84 +++++++++++++ app/(authenticated)/(app)/MobileSidebar.tsx | 107 ++++++++++++++++ app/(authenticated)/(app)/TeamSwitcher.tsx | 99 +++++++++++++++ app/(authenticated)/(app)/channelLink.tsx | 28 +++++ app/(authenticated)/(app)/layout.tsx | 32 +++++ .../(app)/overview/loading.tsx | 9 ++ app/(authenticated)/(app)/overview/page.tsx | 119 ++++++++++++++++++ 7 files changed, 478 insertions(+) create mode 100644 app/(authenticated)/(app)/DesktopSidebar.tsx create mode 100644 app/(authenticated)/(app)/MobileSidebar.tsx create mode 100644 app/(authenticated)/(app)/TeamSwitcher.tsx create mode 100644 app/(authenticated)/(app)/channelLink.tsx create mode 100644 app/(authenticated)/(app)/layout.tsx create mode 100644 app/(authenticated)/(app)/overview/loading.tsx create mode 100644 app/(authenticated)/(app)/overview/page.tsx diff --git a/app/(authenticated)/(app)/DesktopSidebar.tsx b/app/(authenticated)/(app)/DesktopSidebar.tsx new file mode 100644 index 0000000..f5291ab --- /dev/null +++ b/app/(authenticated)/(app)/DesktopSidebar.tsx @@ -0,0 +1,84 @@ +import { Logo } from "@/components/logo"; +import { Button } from "@/components/ui/button"; +import { ScrollArea } from "@/components/ui/scroll-area"; +import { BarChart, Database, FileKey, Filter, FormInput, Home } from "lucide-react"; +import { ChannelLink } from "./channelLink"; +import { TeamSwitcher } from "./TeamSwitcher"; +import Link from "next/link"; +type Props = { + navigation: { + href: string; + external?: boolean; + label: string; + }[]; + + channels: { + name: string; + }[]; +}; + +export const DesktopSidebar: React.FC = ({ navigation, channels }) => { + return ( + + ); +}; diff --git a/app/(authenticated)/(app)/MobileSidebar.tsx b/app/(authenticated)/(app)/MobileSidebar.tsx new file mode 100644 index 0000000..122af63 --- /dev/null +++ b/app/(authenticated)/(app)/MobileSidebar.tsx @@ -0,0 +1,107 @@ +"use client"; + +import { Logo } from "@/components/logo"; +import { Button } from "@/components/ui/button"; +import { ScrollArea } from "@/components/ui/scroll-area"; +import { BarChart, Database, FileKey, Filter, FormInput, Home, Menu } from "lucide-react"; +import { ChannelLink } from "./channelLink"; +import { TeamSwitcher } from "./TeamSwitcher"; +import Link from "next/link"; +import { + Sheet, + SheetContent, + SheetDescription, + SheetFooter, + SheetHeader, + SheetTitle, + SheetTrigger, +} from "@/components/ui/sheet"; +import { Label } from "@/components/ui/label"; +import { Input } from "@/components/ui/input"; +type Props = { + navigation: { + href: string; + external?: boolean; + label: string; + }[]; + + channels: { + name: string; + }[]; +}; + +export const MobileSidebar: React.FC = ({ navigation, channels }) => { + return ( +
+ +
+ + + +
+ + + + {" "} + + Omnidash + + {/* + Make changes to your profile here. Click save when you're done. + */} + +
+
+

{/* Events */}

+
+ + + + + + + + + + + +
+
+
+

Events

+ +
+ {channels.map((channel) => ( + + ))} +
+
+
+
+ + + +
+
+
+ ); +}; diff --git a/app/(authenticated)/(app)/TeamSwitcher.tsx b/app/(authenticated)/(app)/TeamSwitcher.tsx new file mode 100644 index 0000000..91c6520 --- /dev/null +++ b/app/(authenticated)/(app)/TeamSwitcher.tsx @@ -0,0 +1,99 @@ +"use client"; + +import { + DropdownMenuTrigger, + DropdownMenu, + DropdownMenuContent, + DropdownMenuCheckboxItem, + DropdownMenuGroup, + DropdownMenuItem, + DropdownMenuLabel, + DropdownMenuPortal, + DropdownMenuRadioGroup, + DropdownMenuRadioItem, + DropdownMenuSeparator, + DropdownMenuShortcut, + DropdownMenuSub, + DropdownMenuSubContent, + DropdownMenuSubTrigger, +} from "@/components/ui/dropdown-menu"; +import { Check, ChevronsUpDown, Plus, Key, Book, LogOut, Rocket } from "lucide-react"; +import Link from "next/link"; +import { useRouter } from "next/navigation"; +import { useEffect, useState } from "react"; +import { Button } from "@/components/ui/button"; +import { Input } from "@/components/ui/input"; +import { Label } from "@/components/ui/label"; +import { Loading } from "@/components/loading"; + +import { cn } from "@/lib/utils"; +import { useAuth, useOrganization, useOrganizationList, useUser } from "@clerk/clerk-react"; +import { Avatar, AvatarImage } from "@/components/ui/avatar"; +import { AvatarFallback } from "@radix-ui/react-avatar"; + +type Props = {}; + +export const TeamSwitcher: React.FC = (): JSX.Element => { + const { setActive, organizationList } = useOrganizationList(); + const { organization: currentOrg } = useOrganization(); + + const { signOut } = useAuth(); + const { user } = useUser(); + + const router = useRouter(); + + const [loading, setLoading] = useState(false); + + async function changeOrg(id: string | null) { + if (!setActive) { + return; + } + try { + setLoading(true); + await setActive({ organization: id }); + router.refresh(); + } finally { + setLoading(false); + } + } + + return ( + + {loading ? ( + + ) : ( + +
+ + {user?.profileImageUrl ? ( + + ) : null} + + {(currentOrg?.slug ?? user?.username ?? "").slice(0, 2).toUpperCase() ?? "P"} + + + {currentOrg?.name ?? "Personal"} +
+ {/* */} + +
+ )} + + + + + + + +
+ ); +}; diff --git a/app/(authenticated)/(app)/channelLink.tsx b/app/(authenticated)/(app)/channelLink.tsx new file mode 100644 index 0000000..d1ac988 --- /dev/null +++ b/app/(authenticated)/(app)/channelLink.tsx @@ -0,0 +1,28 @@ +"use client"; + +import Link from "next/link"; +import { useSelectedLayoutSegments } from "next/navigation"; +import { Hash } from "lucide-react"; + +import { Button } from "@/components/ui/button"; + +type Props = { + href: string; + channelName: string | null; +}; + +export const ChannelLink: React.FC = ({ href, channelName }) => { + const isActive = channelName === useSelectedLayoutSegments().at(1); + return ( + + + + ); +}; diff --git a/app/(authenticated)/(app)/layout.tsx b/app/(authenticated)/(app)/layout.tsx new file mode 100644 index 0000000..6c83cdb --- /dev/null +++ b/app/(authenticated)/(app)/layout.tsx @@ -0,0 +1,32 @@ +import Link from "next/link"; +import { BarChart, FileKey, Filter, FormInput, Keyboard, Menu, Tornado } from "lucide-react"; +import { Button } from "@/components/ui/button"; +import { ScrollArea } from "@/components/ui/scroll-area"; +import { TeamSwitcher } from "./TeamSwitcher"; +import { auth } from "@clerk/nextjs/app-beta"; +import { notFound } from "next/navigation"; +import { ChannelLink } from "./channelLink"; +import { Logo } from "@/components/logo"; +import { DesktopSidebar } from "./DesktopSidebar"; +import { MobileNav } from "@/components/mobile-nav"; +import { MobileSidebar } from "./MobileSidebar"; +import { getTenantId } from "@/lib/auth"; +import { Fragment } from "react"; + +interface LayoutProps { + children: React.ReactNode; +} + +export default async function Layout({ children }: LayoutProps) { + const tenantId = getTenantId(); + + return ( + + + + + +
{children}
+
+ ); +} diff --git a/app/(authenticated)/(app)/overview/loading.tsx b/app/(authenticated)/(app)/overview/loading.tsx new file mode 100644 index 0000000..f37ff65 --- /dev/null +++ b/app/(authenticated)/(app)/overview/loading.tsx @@ -0,0 +1,9 @@ +import { Loading as Spinner } from "@/components/loading"; + +export default function Loading() { + return ( +
+ +
+ ); +} diff --git a/app/(authenticated)/(app)/overview/page.tsx b/app/(authenticated)/(app)/overview/page.tsx new file mode 100644 index 0000000..3cfd61f --- /dev/null +++ b/app/(authenticated)/(app)/overview/page.tsx @@ -0,0 +1,119 @@ +import Link from "next/link"; +import { notFound, redirect } from "next/navigation"; + +import { auth } from "@clerk/nextjs/app-beta"; +import { PageHeader } from "@/components/page-header"; +import { useUser } from "@clerk/clerk-react"; +import { Fragment } from "react"; +import { cn } from "@/lib/utils"; +import { getTenantId } from "@/lib/auth"; + +export default async function Page(_props: { + params: { tenantSlug: string }; +}) { + const tenantId = getTenantId(); + + const stats: { + label: string; + value: string; + }[] = [ + { + label: "Total Channels", + value: '0', + }, + { + label: "Total Events (7 days)", + value: '0', + }, + ]; + return ( +
+
+ {/* Stats */} +
+
+
+
+ {/*
+
+
*/} +

+ + {"Personal Account"} + +

+
+ {/*

{channel.description}

*/} +
+
+ test +
+
+
= 4, + }, + )} + > + {" "} + {stats.map((stat, statIdx) => ( +
+
{stat.label}
+ {/*
+ {stat.change} +
*/} +
+ {stat.value} +
+
+ ))} +
+
+
+ +
+ {/* Recent activity table */} +
+
+

+ Recent events +

+
+
+
+
+ + + + + + + + + + + +
EventContentMore details
+
+
+
+
+
+
+ ); +} From 46059c13a10d1c0eeff55c41960df2d9790c9c82 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 8 Jun 2023 00:39:48 +0200 Subject: [PATCH 14/17] refactor: Add CSS imports --- app/(landing)/layout.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/app/(landing)/layout.tsx b/app/(landing)/layout.tsx index 249748e..b681a8a 100644 --- a/app/(landing)/layout.tsx +++ b/app/(landing)/layout.tsx @@ -4,6 +4,7 @@ import { useEffect } from "react"; import AOS from "aos"; import "aos/dist/aos.css"; +import "./css/style.css"; import { Header } from "@/components/landing/ui/header"; import Link from "next/link"; From 7c4d41106698ded1df53cb09ff782df1eb38c2e2 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 8 Jun 2023 00:46:10 +0200 Subject: [PATCH 15/17] refactor: Disable `exhaustive-deps` ESLint rule --- components/landing/particles.tsx | 1 + 1 file changed, 1 insertion(+) diff --git a/components/landing/particles.tsx b/components/landing/particles.tsx index cb38c7c..c18c3a6 100644 --- a/components/landing/particles.tsx +++ b/components/landing/particles.tsx @@ -1,3 +1,4 @@ +/* eslint-disable react-hooks/exhaustive-deps */ "use client"; import React, { useRef, useEffect } from "react"; From 85ce4ce692d6e65938281c89efd5d91461261289 Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 8 Jun 2023 00:47:07 +0200 Subject: [PATCH 16/17] deps: Added `@radix-ui/react-label` --- package.json | 1 + yarn.lock | 8 ++++++++ 2 files changed, 9 insertions(+) diff --git a/package.json b/package.json index 7f6107e..c5bdb1a 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "@radix-ui/react-avatar": "^1.0.3", "@radix-ui/react-dialog": "^1.0.4", "@radix-ui/react-dropdown-menu": "^2.0.5", + "@radix-ui/react-label": "^2.0.2", "@radix-ui/react-scroll-area": "^1.0.4", "@radix-ui/react-toast": "^1.1.4", "@tailwindcss/forms": "^0.5.3", diff --git a/yarn.lock b/yarn.lock index bb0b1cb..04dc2ce 100644 --- a/yarn.lock +++ b/yarn.lock @@ -439,6 +439,14 @@ "@babel/runtime" "^7.13.10" "@radix-ui/react-use-layout-effect" "1.0.1" +"@radix-ui/react-label@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@radix-ui/react-label/-/react-label-2.0.2.tgz#9c72f1d334aac996fdc27b48a8bdddd82108fb6d" + integrity sha512-N5ehvlM7qoTLx7nWPodsPYPgMzA5WM8zZChQg8nyFJKnDO5WHdba1vv5/H6IO5LtJMfD2Q3wh1qHFGNtK0w3bQ== + dependencies: + "@babel/runtime" "^7.13.10" + "@radix-ui/react-primitive" "1.0.3" + "@radix-ui/react-menu@2.0.5": version "2.0.5" resolved "https://registry.yarnpkg.com/@radix-ui/react-menu/-/react-menu-2.0.5.tgz#a7d78b0808c4d38269240bf5d5c7ffea3e225e16" From ec88017291821b1a69c06aa615ff340c96453e0a Mon Sep 17 00:00:00 2001 From: Bart van der Braak Date: Thu, 8 Jun 2023 01:01:44 +0200 Subject: [PATCH 17/17] fix: Remove duplicated components --- components/landing/ui/button.tsx | 47 --------------------------- components/landing/ui/scroll-area.tsx | 46 -------------------------- 2 files changed, 93 deletions(-) delete mode 100644 components/landing/ui/button.tsx delete mode 100644 components/landing/ui/scroll-area.tsx diff --git a/components/landing/ui/button.tsx b/components/landing/ui/button.tsx deleted file mode 100644 index ba96182..0000000 --- a/components/landing/ui/button.tsx +++ /dev/null @@ -1,47 +0,0 @@ -import * as React from "react"; -import { VariantProps, cva } from "class-variance-authority"; - -import { cn } from "@/lib/utils"; - -const buttonVariants = cva( - "inline-flex items-center justify-center rounded-md text-sm font-medium transition-colors focus:outline-none dark:hover:bg-zinc-800 dark:hover:text-zinc-100 disabled:opacity-50 disabled:pointer-events-none data-[state=open]:bg-zinc-100 dark:data-[state=open]:bg-zinc-800", - { - variants: { - variant: { - default: "bg-zinc-900 text-white hover:bg-zinc-700 dark:bg-zinc-50 dark:text-zinc-900", - destructive: "bg-red-500 text-white hover:bg-red-600 dark:hover:bg-red-600", - outline: - "bg-transparent border border-zinc-200 hover:bg-zinc-100 dark:border-zinc-700 dark:text-zinc-100", - subtle: "bg-zinc-100 text-zinc-900 hover:bg-zinc-200 dark:bg-zinc-800 dark:text-zinc-100", - ghost: - "bg-transparent hover:bg-zinc-100 dark:hover:bg-zinc-800 dark:text-zinc-100 dark:hover:text-zinc-100 data-[state=open]:bg-transparent dark:data-[state=open]:bg-transparent", - link: "bg-transparent dark:bg-transparent underline-offset-4 hover:underline text-zinc-900 dark:text-zinc-100 hover:bg-transparent dark:hover:bg-transparent", - }, - size: { - square: "h-10 w-10", - default: "h-10 py-2 px-4", - sm: "h-9 px-2 rounded-md", - lg: "h-11 px-8 rounded-md", - }, - }, - defaultVariants: { - variant: "default", - size: "default", - }, - }, -); - -export interface ButtonProps - extends React.ButtonHTMLAttributes, - VariantProps {} - -const Button = React.forwardRef( - ({ className, variant, size, ...props }, ref) => { - return ( -