From ff877266b0ff60f956254d634dd5b814eb9bdf8b Mon Sep 17 00:00:00 2001 From: "gpt-engineer-app[bot]" <159125892+gpt-engineer-app[bot]@users.noreply.github.com> Date: Fri, 19 Dec 2025 01:54:13 +0000 Subject: [PATCH] Changes --- package-lock.json | 791 +++++++++++++++++++++++++++++- package.json | 5 + src/App.tsx | 8 + src/components/AppLayout.tsx | 246 ++++++++++ src/components/RichTextEditor.tsx | 209 ++++++++ src/lib/format.ts | 78 +++ src/pages/Bootcamp.tsx | 197 ++++---- src/pages/Checkout.tsx | 164 ++++--- src/pages/Dashboard.tsx | 176 ++++++- src/pages/Events.tsx | 130 +++++ src/pages/ProductDetail.tsx | 261 ++++++++-- src/pages/Products.tsx | 43 +- src/pages/admin/AdminEvents.tsx | 463 +++++++++++++++++ 13 files changed, 2540 insertions(+), 231 deletions(-) create mode 100644 src/components/AppLayout.tsx create mode 100644 src/components/RichTextEditor.tsx create mode 100644 src/lib/format.ts create mode 100644 src/pages/Events.tsx create mode 100644 src/pages/admin/AdminEvents.tsx diff --git a/package-lock.json b/package-lock.json index f83588b..655c25d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,11 @@ "@radix-ui/react-tooltip": "^1.2.7", "@supabase/supabase-js": "^2.88.0", "@tanstack/react-query": "^5.83.0", + "@tiptap/extension-image": "^3.13.0", + "@tiptap/extension-link": "^3.13.0", + "@tiptap/extension-placeholder": "^3.13.0", + "@tiptap/react": "^3.13.0", + "@tiptap/starter-kit": "^3.13.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.1.1", @@ -2267,6 +2272,12 @@ "integrity": "sha512-HPwpGIzkl28mWyZqG52jiqDJ12waP11Pa1lGoiyUkIEuMLBP0oeK/C89esbXrxsky5we7dfd8U58nm0SgAWpVw==", "license": "MIT" }, + "node_modules/@remirror/core-constants": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@remirror/core-constants/-/core-constants-3.0.0.tgz", + "integrity": "sha512-42aWfPrimMfDKDi4YegyS7x+/0tlzaqwPQCULLanv3DMIlu96KTJR0fM5isWX2UViOqlGnX6YFgqWepcX+XMNg==", + "license": "MIT" + }, "node_modules/@remix-run/router": { "version": "1.23.0", "resolved": "https://registry.npmjs.org/@remix-run/router/-/router-1.23.0.tgz", @@ -2868,6 +2879,466 @@ "react": "^18 || ^19" } }, + "node_modules/@tiptap/core": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/core/-/core-3.13.0.tgz", + "integrity": "sha512-iUelgiTMgPVMpY5ZqASUpk8mC8HuR9FWKaDzK27w9oWip9tuB54Z8mePTxNcQaSPb6ErzEaC8x8egrRt7OsdGQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/pm": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-blockquote": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-blockquote/-/extension-blockquote-3.13.0.tgz", + "integrity": "sha512-K1z/PAIIwEmiWbzrP//4cC7iG1TZknDlF1yb42G7qkx2S2X4P0NiqX7sKOej3yqrPjKjGwPujLMSuDnCF87QkQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-bold": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bold/-/extension-bold-3.13.0.tgz", + "integrity": "sha512-VYiDN9EEwR6ShaDLclG8mphkb/wlIzqfk7hxaKboq1G+NSDj8PcaSI9hldKKtTCLeaSNu6UR5nkdu/YHdzYWTw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-bubble-menu": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bubble-menu/-/extension-bubble-menu-3.13.0.tgz", + "integrity": "sha512-qZ3j2DBsqP9DjG2UlExQ+tHMRhAnWlCKNreKddKocb/nAFrPdBCtvkqIEu+68zPlbLD4ukpoyjUklRJg+NipFg==", + "license": "MIT", + "optional": true, + "dependencies": { + "@floating-ui/dom": "^1.0.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0", + "@tiptap/pm": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-bullet-list": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-bullet-list/-/extension-bullet-list-3.13.0.tgz", + "integrity": "sha512-fFQmmEUoPzRGiQJ/KKutG35ZX21GE+1UCDo8Q6PoWH7Al9lex47nvyeU1BiDYOhcTKgIaJRtEH5lInsOsRJcSA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-list": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-code": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code/-/extension-code-3.13.0.tgz", + "integrity": "sha512-sF5raBni6iSVpXWvwJCAcOXw5/kZ+djDHx1YSGWhopm4+fsj0xW7GvVO+VTwiFjZGKSw+K5NeAxzcQTJZd3Vhw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-code-block": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-code-block/-/extension-code-block-3.13.0.tgz", + "integrity": "sha512-kIwfQ4iqootsWg9e74iYJK54/YMIj6ahUxEltjZRML5z/h4gTDcQt2eTpnEC8yjDjHeUVOR94zH9auCySyk9CQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0", + "@tiptap/pm": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-document": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-document/-/extension-document-3.13.0.tgz", + "integrity": "sha512-RjU7hTJwjKXIdY57o/Pc+Yr8swLkrwT7PBQ/m+LCX5oO/V2wYoWCjoBYnK5KSHrWlNy/aLzC33BvLeqZZ9nzlQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-dropcursor": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-dropcursor/-/extension-dropcursor-3.13.0.tgz", + "integrity": "sha512-m7GPT3c/83ni+bbU8c+3dpNa8ug+aQ4phNB1Q52VQG3oTonDJnZS7WCtn3lB/Hi1LqoqMtEHwhepU2eD+JeXqQ==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extensions": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-floating-menu": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-floating-menu/-/extension-floating-menu-3.13.0.tgz", + "integrity": "sha512-OsezV2cMofZM4c13gvgi93IEYBUzZgnu8BXTYZQiQYekz4bX4uulBmLa1KOA9EN71FzS+SoLkXHU0YzlbLjlxA==", + "license": "MIT", + "optional": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@floating-ui/dom": "^1.0.0", + "@tiptap/core": "^3.13.0", + "@tiptap/pm": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-gapcursor": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-gapcursor/-/extension-gapcursor-3.13.0.tgz", + "integrity": "sha512-KVxjQKkd964nin+1IdM2Dvej/Jy4JTMcMgq5seusUhJ9T9P8F9s2D5Iefwgkps3OCzub/aF+eAsZe+1P5KSIgA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extensions": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-hard-break": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-hard-break/-/extension-hard-break-3.13.0.tgz", + "integrity": "sha512-nH1OBaO+/pakhu+P1jF208mPgB70IKlrR/9d46RMYoYbqJTNf4KVLx5lHAOHytIhjcNg+MjyTfJWfkK+dyCCyg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-heading": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-heading/-/extension-heading-3.13.0.tgz", + "integrity": "sha512-8VKWX8waYPtUWN97J89em9fOtxNteh6pvUEd0htcOAtoxjt2uZjbW5N4lKyWhNKifZBrVhH2Cc2NUPuftCVgxw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-horizontal-rule": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-horizontal-rule/-/extension-horizontal-rule-3.13.0.tgz", + "integrity": "sha512-ZUFyORtjj22ib8ykbxRhWFQOTZjNKqOsMQjaAGof30cuD2DN5J5pMz7Haj2fFRtLpugWYH+f0Mi+WumQXC3hCw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0", + "@tiptap/pm": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-image": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-image/-/extension-image-3.13.0.tgz", + "integrity": "sha512-223uzLUkIa1rkK7aQK3AcIXe6LbCtmnpVb7sY5OEp+LpSaSPyXwyrZ4A0EO1o98qXG68/0B2OqMntFtA9c5Fbw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-italic": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-italic/-/extension-italic-3.13.0.tgz", + "integrity": "sha512-XbVTgmzk1kgUMTirA6AGdLTcKHUvEJoh3R4qMdPtwwygEOe7sBuvKuLtF6AwUtpnOM+Y3tfWUTNEDWv9AcEdww==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-link": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-link/-/extension-link-3.13.0.tgz", + "integrity": "sha512-LuFPJ5GoL12GHW4A+USsj60O90pLcwUPdvEUSWewl9USyG6gnLnY/j5ZOXPYH7LiwYW8+lhq7ABwrDF2PKyBbA==", + "license": "MIT", + "dependencies": { + "linkifyjs": "^4.3.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0", + "@tiptap/pm": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-list": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list/-/extension-list-3.13.0.tgz", + "integrity": "sha512-MMFH0jQ4LeCPkJJFyZ77kt6eM/vcKujvTbMzW1xSHCIEA6s4lEcx9QdZMPpfmnOvTzeoVKR4nsu2t2qT9ZXzAw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0", + "@tiptap/pm": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-list-item": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list-item/-/extension-list-item-3.13.0.tgz", + "integrity": "sha512-63NbcS/XeQP2jcdDEnEAE3rjJICDj8y1SN1h/MsJmSt1LusnEo8WQ2ub86QELO6XnD3M04V03cY6Knf6I5mTkw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-list": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-list-keymap": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-list-keymap/-/extension-list-keymap-3.13.0.tgz", + "integrity": "sha512-P+HtIa1iwosb1feFc8B/9MN5EAwzS+/dZ0UH0CTF2E4wnp5Z9OMxKl1IYjfiCwHzZrU5Let+S/maOvJR/EmV0g==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-list": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-ordered-list": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-ordered-list/-/extension-ordered-list-3.13.0.tgz", + "integrity": "sha512-QuDyLzuK/3vCvx9GeKhgvHWrGECBzmJyAx6gli2HY+Iil7XicbfltV4nvhIxgxzpx3LDHLKzJN9pBi+2MzX60g==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extension-list": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-paragraph": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-paragraph/-/extension-paragraph-3.13.0.tgz", + "integrity": "sha512-9csQde1i0yeZI5oQQ9e1GYNtGL2JcC2d8Fwtw9FsGC8yz2W0h+Fmk+3bc2kobbtO5LGqupSc1fKM8fAg5rSRDg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-placeholder": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-placeholder/-/extension-placeholder-3.13.0.tgz", + "integrity": "sha512-Au4ktRBraQktX9gjSzGWyJV6kPof7+kOhzE8ej+rOMjIrHbx3DCHy1CJWftSO9BbqIyonjsFmm4nE+vjzZ3Z5Q==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/extensions": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-strike": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-strike/-/extension-strike-3.13.0.tgz", + "integrity": "sha512-VHhWNqTAMOfrC48m2FcPIZB0nhl6XHQviAV16SBc+EFznKNv9tQUsqQrnuQ2y6ZVfqq5UxvZ3hKF/JlN/Ff7xw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-text": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-text/-/extension-text-3.13.0.tgz", + "integrity": "sha512-VcZIna93rixw7hRkHGCxDbL3kvJWi80vIT25a2pXg0WP1e7Pi3nBYvZIL4SQtkbBCji9EHrbZx3p8nNPzfazYw==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0" + } + }, + "node_modules/@tiptap/extension-underline": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extension-underline/-/extension-underline-3.13.0.tgz", + "integrity": "sha512-VDQi+UYw0tFnfghpthJTFmtJ3yx90kXeDwFvhmT8G+O+si5VmP05xYDBYBmYCix5jqKigJxEASiBL0gYOgMDEg==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0" + } + }, + "node_modules/@tiptap/extensions": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/extensions/-/extensions-3.13.0.tgz", + "integrity": "sha512-i7O0ptSibEtTy+2PIPsNKEvhTvMaFJg1W4Oxfnbuxvaigs7cJV9Q0lwDUcc7CPsNw2T1+44wcxg431CzTvdYoA==", + "license": "MIT", + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0", + "@tiptap/pm": "^3.13.0" + } + }, + "node_modules/@tiptap/pm": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/pm/-/pm-3.13.0.tgz", + "integrity": "sha512-WKR4ucALq+lwx0WJZW17CspeTpXorbIOpvKv5mulZica6QxqfMhn8n1IXCkDws/mCoLRx4Drk5d377tIjFNsvQ==", + "license": "MIT", + "dependencies": { + "prosemirror-changeset": "^2.3.0", + "prosemirror-collab": "^1.3.1", + "prosemirror-commands": "^1.6.2", + "prosemirror-dropcursor": "^1.8.1", + "prosemirror-gapcursor": "^1.3.2", + "prosemirror-history": "^1.4.1", + "prosemirror-inputrules": "^1.4.0", + "prosemirror-keymap": "^1.2.2", + "prosemirror-markdown": "^1.13.1", + "prosemirror-menu": "^1.2.4", + "prosemirror-model": "^1.24.1", + "prosemirror-schema-basic": "^1.2.3", + "prosemirror-schema-list": "^1.5.0", + "prosemirror-state": "^1.4.3", + "prosemirror-tables": "^1.6.4", + "prosemirror-trailing-node": "^3.0.0", + "prosemirror-transform": "^1.10.2", + "prosemirror-view": "^1.38.1" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + } + }, + "node_modules/@tiptap/react": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/react/-/react-3.13.0.tgz", + "integrity": "sha512-VqpqNZ9qtPr3pWK4NsZYxXgLSEiAnzl6oS7tEGmkkvJbcGSC+F7R13Xc9twv/zT5QCLxaHdEbmxHbuAIkrMgJQ==", + "license": "MIT", + "dependencies": { + "@types/use-sync-external-store": "^0.0.6", + "fast-equals": "^5.3.3", + "use-sync-external-store": "^1.4.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + }, + "optionalDependencies": { + "@tiptap/extension-bubble-menu": "^3.13.0", + "@tiptap/extension-floating-menu": "^3.13.0" + }, + "peerDependencies": { + "@tiptap/core": "^3.13.0", + "@tiptap/pm": "^3.13.0", + "@types/react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "@types/react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react": "^17.0.0 || ^18.0.0 || ^19.0.0", + "react-dom": "^17.0.0 || ^18.0.0 || ^19.0.0" + } + }, + "node_modules/@tiptap/starter-kit": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/@tiptap/starter-kit/-/starter-kit-3.13.0.tgz", + "integrity": "sha512-Ojn6sRub04CRuyQ+9wqN62JUOMv+rG1vXhc2s6DCBCpu28lkCMMW+vTe7kXJcEdbot82+5swPbERw9vohswFzg==", + "license": "MIT", + "dependencies": { + "@tiptap/core": "^3.13.0", + "@tiptap/extension-blockquote": "^3.13.0", + "@tiptap/extension-bold": "^3.13.0", + "@tiptap/extension-bullet-list": "^3.13.0", + "@tiptap/extension-code": "^3.13.0", + "@tiptap/extension-code-block": "^3.13.0", + "@tiptap/extension-document": "^3.13.0", + "@tiptap/extension-dropcursor": "^3.13.0", + "@tiptap/extension-gapcursor": "^3.13.0", + "@tiptap/extension-hard-break": "^3.13.0", + "@tiptap/extension-heading": "^3.13.0", + "@tiptap/extension-horizontal-rule": "^3.13.0", + "@tiptap/extension-italic": "^3.13.0", + "@tiptap/extension-link": "^3.13.0", + "@tiptap/extension-list": "^3.13.0", + "@tiptap/extension-list-item": "^3.13.0", + "@tiptap/extension-list-keymap": "^3.13.0", + "@tiptap/extension-ordered-list": "^3.13.0", + "@tiptap/extension-paragraph": "^3.13.0", + "@tiptap/extension-strike": "^3.13.0", + "@tiptap/extension-text": "^3.13.0", + "@tiptap/extension-underline": "^3.13.0", + "@tiptap/extensions": "^3.13.0", + "@tiptap/pm": "^3.13.0" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/ueberdosis" + } + }, "node_modules/@types/d3-array": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/@types/d3-array/-/d3-array-3.2.1.tgz", @@ -2945,6 +3416,28 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/@types/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-sVDA58zAw4eWAffKOaQH5/5j3XeayukzDk+ewSsnv3p4yJEZHCCzMDiZM8e0OUrRvmpGZ85jf4yDHkHsgBNr9Q==", + "license": "MIT" + }, + "node_modules/@types/markdown-it": { + "version": "14.1.2", + "resolved": "https://registry.npmjs.org/@types/markdown-it/-/markdown-it-14.1.2.tgz", + "integrity": "sha512-promo4eFwuiW+TfGxhi+0x3czqTYJkG8qB17ZUJiVF10Xm7NLVRSLUsfRTU/6h1e24VvRnXCx+hG7li58lkzog==", + "license": "MIT", + "dependencies": { + "@types/linkify-it": "^5", + "@types/mdurl": "^2" + } + }, + "node_modules/@types/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@types/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-RGdgjQUZba5p6QEFAVx2OGb8rQDL/cPRG7GiedRzMcJ1tYnUANBncjbSB1NRGwbvjcPeikRABz2nshyPk1bhWg==", + "license": "MIT" + }, "node_modules/@types/node": { "version": "22.16.5", "resolved": "https://registry.npmjs.org/@types/node/-/node-22.16.5.tgz", @@ -2988,6 +3481,12 @@ "@types/react": "^18.0.0" } }, + "node_modules/@types/use-sync-external-store": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/@types/use-sync-external-store/-/use-sync-external-store-0.0.6.tgz", + "integrity": "sha512-zFDAD+tlpf2r4asuHEj0XH6pY6i0g5NeAHPn+15wk3BV6JA69eERFXC1gyGThDkVa1zCyKr5jox1+2LbV/AMLg==", + "license": "MIT" + }, "node_modules/@types/ws": { "version": "8.18.1", "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.18.1.tgz", @@ -3370,7 +3869,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true, "license": "Python-2.0" }, "node_modules/aria-hidden": { @@ -3669,6 +4167,12 @@ "dev": true, "license": "MIT" }, + "node_modules/crelt": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/crelt/-/crelt-1.0.6.tgz", + "integrity": "sha512-VQ2MBenTq1fWZUH9DJNGti7kKv6EeAuYr3cLwxUWhIu1baTaXh4Ib5W2CqHVqib4/MqbYGJqiL3Zb8GJZr3l4g==", + "license": "MIT" + }, "node_modules/cross-spawn": { "version": "7.0.6", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", @@ -3943,6 +4447,18 @@ "dev": true, "license": "MIT" }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, "node_modules/esbuild": { "version": "0.21.5", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.21.5.tgz", @@ -3996,7 +4512,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "dev": true, "license": "MIT", "engines": { "node": ">=10" @@ -4197,9 +4712,9 @@ "license": "MIT" }, "node_modules/fast-equals": { - "version": "5.2.2", - "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.2.2.tgz", - "integrity": "sha512-V7/RktU11J3I36Nwq2JnZEM7tNm17eBJz+u25qdxBZeCKiX6BkVSZQjwWIr+IobgnZy+ag73tTZgZi7tr0LrBw==", + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/fast-equals/-/fast-equals-5.4.0.tgz", + "integrity": "sha512-jt2DW/aNFNwke7AUd+Z+e6pz39KO5rzdbbFCg2sGafS4mk13MI7Z8O5z9cADNn5lhGODIgLwug6TZO2ctf7kcw==", "license": "MIT", "engines": { "node": ">=6.0.0" @@ -4745,6 +5260,21 @@ "dev": true, "license": "MIT" }, + "node_modules/linkify-it": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-5.0.0.tgz", + "integrity": "sha512-5aHCbzQRADcdP+ATqnDuhhJ/MRIqDkZX5pyjFHRRysS8vZ5AbqGEoFIb6pYHPZ+L/OC2Lc+xT8uHVVR5CAK/wQ==", + "license": "MIT", + "dependencies": { + "uc.micro": "^2.0.0" + } + }, + "node_modules/linkifyjs": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/linkifyjs/-/linkifyjs-4.3.2.tgz", + "integrity": "sha512-NT1CJtq3hHIreOianA8aSXn6Cw0JzYOuDQbOrSPe7gqFnCpKP++MQe3ODgO3oh2GJFORkAAdqredOa60z63GbA==", + "license": "MIT" + }, "node_modules/locate-path": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", @@ -5259,6 +5789,29 @@ "react": "^16.5.1 || ^17.0.0 || ^18.0.0 || ^19.0.0-rc" } }, + "node_modules/markdown-it": { + "version": "14.1.0", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-14.1.0.tgz", + "integrity": "sha512-a54IwgWPaeBCAAsv13YgmALOF1elABB08FxO9i+r4VFk5Vl4pKokRPeX8u5TCgSsPi6ec1otfLjdOpVcgbpshg==", + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1", + "entities": "^4.4.0", + "linkify-it": "^5.0.0", + "mdurl": "^2.0.0", + "punycode.js": "^2.3.1", + "uc.micro": "^2.1.0" + }, + "bin": { + "markdown-it": "bin/markdown-it.mjs" + } + }, + "node_modules/mdurl": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-2.0.0.tgz", + "integrity": "sha512-Lf+9+2r+Tdp5wXDXC4PcIBjTDtq4UKjCPMQhKIuzpJNW0b96kVqSwW0bT7FhRSfmAiFYgP+SCRvdrDozfh0U5w==", + "license": "MIT" + }, "node_modules/merge2": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", @@ -5425,6 +5978,12 @@ "node": ">= 0.8.0" } }, + "node_modules/orderedmap": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/orderedmap/-/orderedmap-2.1.1.tgz", + "integrity": "sha512-TvAWxi0nDe1j/rtMcWcIj94+Ffe6n7zhow33h40SKxmsmozs6dz/e+EajymfoFcHd7sxNn8yHM8839uixMOV6g==", + "license": "MIT" + }, "node_modules/p-limit": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", @@ -5738,6 +6297,201 @@ "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==", "license": "MIT" }, + "node_modules/prosemirror-changeset": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/prosemirror-changeset/-/prosemirror-changeset-2.3.1.tgz", + "integrity": "sha512-j0kORIBm8ayJNl3zQvD1TTPHJX3g042et6y/KQhZhnPrruO8exkTgG8X+NRpj7kIyMMEx74Xb3DyMIBtO0IKkQ==", + "license": "MIT", + "dependencies": { + "prosemirror-transform": "^1.0.0" + } + }, + "node_modules/prosemirror-collab": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/prosemirror-collab/-/prosemirror-collab-1.3.1.tgz", + "integrity": "sha512-4SnynYR9TTYaQVXd/ieUvsVV4PDMBzrq2xPUWutHivDuOshZXqQ5rGbZM84HEaXKbLdItse7weMGOUdDVcLKEQ==", + "license": "MIT", + "dependencies": { + "prosemirror-state": "^1.0.0" + } + }, + "node_modules/prosemirror-commands": { + "version": "1.7.1", + "resolved": "https://registry.npmjs.org/prosemirror-commands/-/prosemirror-commands-1.7.1.tgz", + "integrity": "sha512-rT7qZnQtx5c0/y/KlYaGvtG411S97UaL6gdp6RIZ23DLHanMYLyfGBV5DtSnZdthQql7W+lEVbpSfwtO8T+L2w==", + "license": "MIT", + "dependencies": { + "prosemirror-model": "^1.0.0", + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.10.2" + } + }, + "node_modules/prosemirror-dropcursor": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/prosemirror-dropcursor/-/prosemirror-dropcursor-1.8.2.tgz", + "integrity": "sha512-CCk6Gyx9+Tt2sbYk5NK0nB1ukHi2ryaRgadV/LvyNuO3ena1payM2z6Cg0vO1ebK8cxbzo41ku2DE5Axj1Zuiw==", + "license": "MIT", + "dependencies": { + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.1.0", + "prosemirror-view": "^1.1.0" + } + }, + "node_modules/prosemirror-gapcursor": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/prosemirror-gapcursor/-/prosemirror-gapcursor-1.4.0.tgz", + "integrity": "sha512-z00qvurSdCEWUIulij/isHaqu4uLS8r/Fi61IbjdIPJEonQgggbJsLnstW7Lgdk4zQ68/yr6B6bf7sJXowIgdQ==", + "license": "MIT", + "dependencies": { + "prosemirror-keymap": "^1.0.0", + "prosemirror-model": "^1.0.0", + "prosemirror-state": "^1.0.0", + "prosemirror-view": "^1.0.0" + } + }, + "node_modules/prosemirror-history": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/prosemirror-history/-/prosemirror-history-1.5.0.tgz", + "integrity": "sha512-zlzTiH01eKA55UAf1MEjtssJeHnGxO0j4K4Dpx+gnmX9n+SHNlDqI2oO1Kv1iPN5B1dm5fsljCfqKF9nFL6HRg==", + "license": "MIT", + "dependencies": { + "prosemirror-state": "^1.2.2", + "prosemirror-transform": "^1.0.0", + "prosemirror-view": "^1.31.0", + "rope-sequence": "^1.3.0" + } + }, + "node_modules/prosemirror-inputrules": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/prosemirror-inputrules/-/prosemirror-inputrules-1.5.1.tgz", + "integrity": "sha512-7wj4uMjKaXWAQ1CDgxNzNtR9AlsuwzHfdFH1ygEHA2KHF2DOEaXl1CJfNPAKCg9qNEh4rum975QLaCiQPyY6Fw==", + "license": "MIT", + "dependencies": { + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.0.0" + } + }, + "node_modules/prosemirror-keymap": { + "version": "1.2.3", + "resolved": "https://registry.npmjs.org/prosemirror-keymap/-/prosemirror-keymap-1.2.3.tgz", + "integrity": "sha512-4HucRlpiLd1IPQQXNqeo81BGtkY8Ai5smHhKW9jjPKRc2wQIxksg7Hl1tTI2IfT2B/LgX6bfYvXxEpJl7aKYKw==", + "license": "MIT", + "dependencies": { + "prosemirror-state": "^1.0.0", + "w3c-keyname": "^2.2.0" + } + }, + "node_modules/prosemirror-markdown": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/prosemirror-markdown/-/prosemirror-markdown-1.13.2.tgz", + "integrity": "sha512-FPD9rHPdA9fqzNmIIDhhnYQ6WgNoSWX9StUZ8LEKapaXU9i6XgykaHKhp6XMyXlOWetmaFgGDS/nu/w9/vUc5g==", + "license": "MIT", + "dependencies": { + "@types/markdown-it": "^14.0.0", + "markdown-it": "^14.0.0", + "prosemirror-model": "^1.25.0" + } + }, + "node_modules/prosemirror-menu": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/prosemirror-menu/-/prosemirror-menu-1.2.5.tgz", + "integrity": "sha512-qwXzynnpBIeg1D7BAtjOusR+81xCp53j7iWu/IargiRZqRjGIlQuu1f3jFi+ehrHhWMLoyOQTSRx/IWZJqOYtQ==", + "license": "MIT", + "dependencies": { + "crelt": "^1.0.0", + "prosemirror-commands": "^1.0.0", + "prosemirror-history": "^1.0.0", + "prosemirror-state": "^1.0.0" + } + }, + "node_modules/prosemirror-model": { + "version": "1.25.4", + "resolved": "https://registry.npmjs.org/prosemirror-model/-/prosemirror-model-1.25.4.tgz", + "integrity": "sha512-PIM7E43PBxKce8OQeezAs9j4TP+5yDpZVbuurd1h5phUxEKIu+G2a+EUZzIC5nS1mJktDJWzbqS23n1tsAf5QA==", + "license": "MIT", + "dependencies": { + "orderedmap": "^2.0.0" + } + }, + "node_modules/prosemirror-schema-basic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/prosemirror-schema-basic/-/prosemirror-schema-basic-1.2.4.tgz", + "integrity": "sha512-ELxP4TlX3yr2v5rM7Sb70SqStq5NvI15c0j9j/gjsrO5vaw+fnnpovCLEGIcpeGfifkuqJwl4fon6b+KdrODYQ==", + "license": "MIT", + "dependencies": { + "prosemirror-model": "^1.25.0" + } + }, + "node_modules/prosemirror-schema-list": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/prosemirror-schema-list/-/prosemirror-schema-list-1.5.1.tgz", + "integrity": "sha512-927lFx/uwyQaGwJxLWCZRkjXG0p48KpMj6ueoYiu4JX05GGuGcgzAy62dfiV8eFZftgyBUvLx76RsMe20fJl+Q==", + "license": "MIT", + "dependencies": { + "prosemirror-model": "^1.0.0", + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.7.3" + } + }, + "node_modules/prosemirror-state": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/prosemirror-state/-/prosemirror-state-1.4.4.tgz", + "integrity": "sha512-6jiYHH2CIGbCfnxdHbXZ12gySFY/fz/ulZE333G6bPqIZ4F+TXo9ifiR86nAHpWnfoNjOb3o5ESi7J8Uz1jXHw==", + "license": "MIT", + "dependencies": { + "prosemirror-model": "^1.0.0", + "prosemirror-transform": "^1.0.0", + "prosemirror-view": "^1.27.0" + } + }, + "node_modules/prosemirror-tables": { + "version": "1.8.3", + "resolved": "https://registry.npmjs.org/prosemirror-tables/-/prosemirror-tables-1.8.3.tgz", + "integrity": "sha512-wbqCR/RlRPRe41a4LFtmhKElzBEfBTdtAYWNIGHM6X2e24NN/MTNUKyXjjphfAfdQce37Kh/5yf765mLPYDe7Q==", + "license": "MIT", + "dependencies": { + "prosemirror-keymap": "^1.2.3", + "prosemirror-model": "^1.25.4", + "prosemirror-state": "^1.4.4", + "prosemirror-transform": "^1.10.5", + "prosemirror-view": "^1.41.4" + } + }, + "node_modules/prosemirror-trailing-node": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/prosemirror-trailing-node/-/prosemirror-trailing-node-3.0.0.tgz", + "integrity": "sha512-xiun5/3q0w5eRnGYfNlW1uU9W6x5MoFKWwq/0TIRgt09lv7Hcser2QYV8t4muXbEr+Fwo0geYn79Xs4GKywrRQ==", + "license": "MIT", + "dependencies": { + "@remirror/core-constants": "3.0.0", + "escape-string-regexp": "^4.0.0" + }, + "peerDependencies": { + "prosemirror-model": "^1.22.1", + "prosemirror-state": "^1.4.2", + "prosemirror-view": "^1.33.8" + } + }, + "node_modules/prosemirror-transform": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/prosemirror-transform/-/prosemirror-transform-1.10.5.tgz", + "integrity": "sha512-RPDQCxIDhIBb1o36xxwsaeAvivO8VLJcgBtzmOwQ64bMtsVFh5SSuJ6dWSxO1UsHTiTXPCgQm3PDJt7p6IOLbw==", + "license": "MIT", + "dependencies": { + "prosemirror-model": "^1.21.0" + } + }, + "node_modules/prosemirror-view": { + "version": "1.41.4", + "resolved": "https://registry.npmjs.org/prosemirror-view/-/prosemirror-view-1.41.4.tgz", + "integrity": "sha512-WkKgnyjNncri03Gjaz3IFWvCAE94XoiEgvtr0/r2Xw7R8/IjK3sKLSiDoCHWcsXSAinVaKlGRZDvMCsF1kbzjA==", + "license": "MIT", + "dependencies": { + "prosemirror-model": "^1.20.0", + "prosemirror-state": "^1.0.0", + "prosemirror-transform": "^1.1.0" + } + }, "node_modules/punycode": { "version": "2.3.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", @@ -5748,6 +6502,15 @@ "node": ">=6" } }, + "node_modules/punycode.js": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode.js/-/punycode.js-2.3.1.tgz", + "integrity": "sha512-uxFIHU0YlHYhDQtV4R9J6a52SLx28BCjT+4ieh7IGbgwVJWO+km431c4yRlREUAsAmt/uMjQUyQHNEPf0M39CA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, "node_modules/queue-microtask": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", @@ -6102,6 +6865,12 @@ "fsevents": "~2.3.2" } }, + "node_modules/rope-sequence": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/rope-sequence/-/rope-sequence-1.3.4.tgz", + "integrity": "sha512-UT5EDe2cu2E/6O4igUr5PSFs23nvvukicWHx6GnOPlHAiiYbzNuCRQCuiUdHJQcqKalLKlrYJnjY0ySGsXNQXQ==", + "license": "MIT" + }, "node_modules/run-parallel": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", @@ -6546,6 +7315,12 @@ "typescript": ">=4.8.4 <5.9.0" } }, + "node_modules/uc.micro": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-2.1.0.tgz", + "integrity": "sha512-ARDJmphmdvUk6Glw7y9DQ2bFkKBHwQHLi2lsaH6PPmz/Ka9sFOBsBluozhDltWmnv9u/cF6Rt87znRTPV+yp/A==", + "license": "MIT" + }, "node_modules/undici-types": { "version": "6.21.0", "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", @@ -6747,6 +7522,12 @@ } } }, + "node_modules/w3c-keyname": { + "version": "2.2.8", + "resolved": "https://registry.npmjs.org/w3c-keyname/-/w3c-keyname-2.2.8.tgz", + "integrity": "sha512-dpojBhNsCNN7T82Tm7k26A6G9ML3NkhDsnw9n/eoxSRlVBB4CEtIQ/KTCLI2Fwf3ataSXRhYFkQi3SlnFwPvPQ==", + "license": "MIT" + }, "node_modules/which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", diff --git a/package.json b/package.json index 63a2f7e..062a408 100644 --- a/package.json +++ b/package.json @@ -41,6 +41,11 @@ "@radix-ui/react-tooltip": "^1.2.7", "@supabase/supabase-js": "^2.88.0", "@tanstack/react-query": "^5.83.0", + "@tiptap/extension-image": "^3.13.0", + "@tiptap/extension-link": "^3.13.0", + "@tiptap/extension-placeholder": "^3.13.0", + "@tiptap/react": "^3.13.0", + "@tiptap/starter-kit": "^3.13.0", "class-variance-authority": "^0.7.1", "clsx": "^2.1.1", "cmdk": "^1.1.1", diff --git a/src/App.tsx b/src/App.tsx index 134cb8c..6db4b56 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -13,6 +13,8 @@ import Checkout from "./pages/Checkout"; import Dashboard from "./pages/Dashboard"; import Admin from "./pages/Admin"; import Bootcamp from "./pages/Bootcamp"; +import Events from "./pages/Events"; +import AdminEvents from "./pages/admin/AdminEvents"; import NotFound from "./pages/NotFound"; const queryClient = new QueryClient(); @@ -32,7 +34,13 @@ const App = () => ( } /> } /> } /> + } /> + } /> + } /> + } /> } /> + } /> + } /> } /> } /> diff --git a/src/components/AppLayout.tsx b/src/components/AppLayout.tsx new file mode 100644 index 0000000..4ee5392 --- /dev/null +++ b/src/components/AppLayout.tsx @@ -0,0 +1,246 @@ +import { ReactNode, useState } from 'react'; +import { Link, useLocation, useNavigate } from 'react-router-dom'; +import { useAuth } from '@/hooks/useAuth'; +import { useCart } from '@/contexts/CartContext'; +import { Button } from '@/components/ui/button'; +import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet'; +import { cn } from '@/lib/utils'; +import { + LayoutDashboard, + Package, + BookOpen, + ShoppingCart, + Receipt, + User, + Settings, + Users, + Calendar, + LogOut, + Menu, + Home, + MoreHorizontal, + X, +} from 'lucide-react'; + +interface NavItem { + label: string; + href: string; + icon: React.ComponentType<{ className?: string }>; +} + +const userNavItems: NavItem[] = [ + { label: 'Dashboard', href: '/dashboard', icon: LayoutDashboard }, + { label: 'Produk', href: '/products', icon: Package }, + { label: 'Akses', href: '/access', icon: BookOpen }, + { label: 'Order', href: '/orders', icon: Receipt }, + { label: 'Profil', href: '/profile', icon: User }, +]; + +const adminNavItems: NavItem[] = [ + { label: 'Dashboard', href: '/admin', icon: LayoutDashboard }, + { label: 'Produk', href: '/admin/products', icon: Package }, + { label: 'Bootcamp', href: '/admin/bootcamp', icon: BookOpen }, + { label: 'Order', href: '/admin/orders', icon: Receipt }, + { label: 'Member', href: '/admin/members', icon: Users }, + { label: 'Kalender', href: '/admin/events', icon: Calendar }, + { label: 'Pengaturan', href: '/admin/settings', icon: Settings }, +]; + +const mobileUserNav: NavItem[] = [ + { label: 'Home', href: '/dashboard', icon: Home }, + { label: 'Kelas', href: '/access', icon: BookOpen }, + { label: 'Pesanan', href: '/orders', icon: Receipt }, + { label: 'Profil', href: '/profile', icon: User }, +]; + +const mobileAdminNav: NavItem[] = [ + { label: 'Dashboard', href: '/admin', icon: LayoutDashboard }, + { label: 'Produk', href: '/admin/products', icon: Package }, + { label: 'Pesanan', href: '/admin/orders', icon: Receipt }, + { label: 'Pengguna', href: '/admin/members', icon: Users }, +]; + +interface AppLayoutProps { + children: ReactNode; +} + +export function AppLayout({ children }: AppLayoutProps) { + const { user, isAdmin, signOut } = useAuth(); + const { items } = useCart(); + const location = useLocation(); + const navigate = useNavigate(); + const [moreOpen, setMoreOpen] = useState(false); + + const navItems = isAdmin ? adminNavItems : userNavItems; + const mobileNav = isAdmin ? mobileAdminNav : mobileUserNav; + + const handleSignOut = async () => { + await signOut(); + navigate('/'); + }; + + const isActive = (href: string) => { + if (href === '/dashboard' && location.pathname === '/dashboard') return true; + if (href === '/admin' && location.pathname === '/admin') return true; + if (href !== '/dashboard' && href !== '/admin') { + return location.pathname.startsWith(href); + } + return false; + }; + + // Get additional items for "More" menu + const moreItems = navItems.filter(item => !mobileNav.some(m => m.href === item.href)); + + if (!user) { + // Public layout for non-authenticated pages + return ( +
+
+
+ LearnHub + +
+
+
{children}
+
+ ); + } + + return ( +
+ {/* Desktop Sidebar */} + + + {/* Main content */} +
+ {/* Mobile Header */} +
+ LearnHub +
+ + + {items.length > 0 && ( + + {items.length} + + )} + +
+
+ +
{children}
+ + {/* Mobile Bottom Navigation */} + +
+
+ ); +} diff --git a/src/components/RichTextEditor.tsx b/src/components/RichTextEditor.tsx new file mode 100644 index 0000000..ceaa226 --- /dev/null +++ b/src/components/RichTextEditor.tsx @@ -0,0 +1,209 @@ +import { useEditor, EditorContent } from '@tiptap/react'; +import StarterKit from '@tiptap/starter-kit'; +import Link from '@tiptap/extension-link'; +import Image from '@tiptap/extension-image'; +import Placeholder from '@tiptap/extension-placeholder'; +import { Button } from '@/components/ui/button'; +import { + Bold, Italic, List, ListOrdered, Quote, Link as LinkIcon, + Image as ImageIcon, Heading1, Heading2, Undo, Redo +} from 'lucide-react'; +import { cn } from '@/lib/utils'; +import { useCallback } from 'react'; +import { supabase } from '@/integrations/supabase/client'; +import { toast } from '@/hooks/use-toast'; + +interface RichTextEditorProps { + content: string; + onChange: (html: string) => void; + placeholder?: string; + className?: string; +} + +export function RichTextEditor({ content, onChange, placeholder = 'Tulis konten...', className }: RichTextEditorProps) { + const editor = useEditor({ + extensions: [ + StarterKit, + Link.configure({ + openOnClick: false, + HTMLAttributes: { + class: 'text-primary underline', + }, + }), + Image.configure({ + HTMLAttributes: { + class: 'max-w-full h-auto rounded-md', + }, + }), + Placeholder.configure({ + placeholder, + }), + ], + content, + onUpdate: ({ editor }) => { + onChange(editor.getHTML()); + }, + }); + + const addLink = useCallback(() => { + if (!editor) return; + const url = window.prompt('Masukkan URL:'); + if (url) { + editor.chain().focus().extendMarkRange('link').setLink({ href: url }).run(); + } + }, [editor]); + + const handleImageUpload = useCallback(async (e: React.ChangeEvent) => { + const file = e.target.files?.[0]; + if (!file || !editor) return; + + // For now, convert to base64 data URL since storage bucket may not be configured + // In production, you would upload to Supabase Storage + const reader = new FileReader(); + reader.onload = () => { + const dataUrl = reader.result as string; + editor.chain().focus().setImage({ src: dataUrl }).run(); + }; + reader.readAsDataURL(file); + }, [editor]); + + const handlePaste = useCallback(async (e: React.ClipboardEvent) => { + const items = e.clipboardData?.items; + if (!items || !editor) return; + + for (const item of Array.from(items)) { + if (item.type.startsWith('image/')) { + e.preventDefault(); + const file = item.getAsFile(); + if (!file) continue; + + const reader = new FileReader(); + reader.onload = () => { + const dataUrl = reader.result as string; + editor.chain().focus().setImage({ src: dataUrl }).run(); + }; + reader.readAsDataURL(file); + break; + } + } + }, [editor]); + + if (!editor) return null; + + return ( +
+
+ + + + + + + + + +
+ + +
+
+ +
+
+ ); +} diff --git a/src/lib/format.ts b/src/lib/format.ts new file mode 100644 index 0000000..7b81380 --- /dev/null +++ b/src/lib/format.ts @@ -0,0 +1,78 @@ +/** + * Format duration in seconds to HH:mm:ss or mm:ss + */ +export function formatDuration(seconds: number | string | null | undefined): string { + if (seconds === null || seconds === undefined) return ''; + + // If it's already formatted (contains :), return as-is + if (typeof seconds === 'string' && seconds.includes(':')) { + return seconds; + } + + const numSeconds = typeof seconds === 'string' ? parseInt(seconds, 10) : seconds; + if (isNaN(numSeconds) || numSeconds < 0) return ''; + + const hours = Math.floor(numSeconds / 3600); + const minutes = Math.floor((numSeconds % 3600) / 60); + const secs = numSeconds % 60; + + if (hours > 0) { + return `${hours}:${minutes.toString().padStart(2, '0')}:${secs.toString().padStart(2, '0')}`; + } + return `${minutes}:${secs.toString().padStart(2, '0')}`; +} + +/** + * Format price in IDR + */ +export function formatIDR(amount: number): string { + return new Intl.NumberFormat('id-ID', { + style: 'currency', + currency: 'IDR', + minimumFractionDigits: 0, + maximumFractionDigits: 0, + }).format(amount).replace('IDR', 'Rp'); +} + +/** + * Parse duration string (HH:mm:ss or mm:ss) to seconds + */ +export function parseDurationToSeconds(duration: string): number { + if (!duration) return 0; + + // If it's already a number string, return as seconds + if (/^\d+$/.test(duration.trim())) { + return parseInt(duration, 10); + } + + const parts = duration.split(':').map(p => parseInt(p, 10)); + + if (parts.length === 3) { + // HH:mm:ss + return parts[0] * 3600 + parts[1] * 60 + parts[2]; + } else if (parts.length === 2) { + // mm:ss + return parts[0] * 60 + parts[1]; + } + + return 0; +} + +/** + * Format date to Indonesian locale + */ +export function formatDate(date: string | Date): string { + return new Intl.DateTimeFormat('id-ID', { + dateStyle: 'long', + }).format(new Date(date)); +} + +/** + * Format datetime to Indonesian locale + */ +export function formatDateTime(date: string | Date): string { + return new Intl.DateTimeFormat('id-ID', { + dateStyle: 'long', + timeStyle: 'short', + }).format(new Date(date)); +} diff --git a/src/pages/Bootcamp.tsx b/src/pages/Bootcamp.tsx index d139cc8..3e4028c 100644 --- a/src/pages/Bootcamp.tsx +++ b/src/pages/Bootcamp.tsx @@ -3,11 +3,13 @@ import { useParams, useNavigate } from 'react-router-dom'; import { supabase } from '@/integrations/supabase/client'; import { useAuth } from '@/hooks/useAuth'; import { Button } from '@/components/ui/button'; -import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'; +import { Card, CardContent } from '@/components/ui/card'; import { Skeleton } from '@/components/ui/skeleton'; import { toast } from '@/hooks/use-toast'; -import { ChevronLeft, ChevronRight, Check, Play, BookOpen } from 'lucide-react'; +import { formatDuration } from '@/lib/format'; +import { ChevronLeft, ChevronRight, Check, Play, BookOpen, Clock, Menu, X } from 'lucide-react'; import { cn } from '@/lib/utils'; +import { Sheet, SheetContent, SheetTrigger } from '@/components/ui/sheet'; interface Product { id: string; @@ -27,6 +29,7 @@ interface Lesson { title: string; content: string | null; video_url: string | null; + duration_seconds: number | null; position: number; release_at: string | null; } @@ -40,14 +43,14 @@ export default function Bootcamp() { const { slug } = useParams<{ slug: string }>(); const navigate = useNavigate(); const { user, loading: authLoading } = useAuth(); - + const [product, setProduct] = useState(null); const [modules, setModules] = useState([]); const [progress, setProgress] = useState([]); const [selectedLesson, setSelectedLesson] = useState(null); const [loading, setLoading] = useState(true); - const [hasAccess, setHasAccess] = useState(false); const [sidebarOpen, setSidebarOpen] = useState(true); + const [mobileMenuOpen, setMobileMenuOpen] = useState(false); useEffect(() => { if (!authLoading && !user) { @@ -58,7 +61,6 @@ export default function Bootcamp() { }, [user, authLoading, slug]); const checkAccessAndFetch = async () => { - // First get the product const { data: productData, error: productError } = await supabase .from('products') .select('id, title, slug') @@ -67,14 +69,13 @@ export default function Bootcamp() { .maybeSingle(); if (productError || !productData) { - toast({ title: 'Error', description: 'Bootcamp not found', variant: 'destructive' }); + toast({ title: 'Error', description: 'Bootcamp tidak ditemukan', variant: 'destructive' }); navigate('/dashboard'); return; } setProduct(productData); - // Check access const { data: accessData } = await supabase .from('user_access') .select('id') @@ -83,14 +84,11 @@ export default function Bootcamp() { .maybeSingle(); if (!accessData) { - toast({ title: 'Access denied', description: 'You don\'t have access to this bootcamp', variant: 'destructive' }); + toast({ title: 'Akses ditolak', description: 'Anda tidak memiliki akses ke bootcamp ini', variant: 'destructive' }); navigate('/dashboard'); return; } - setHasAccess(true); - - // Fetch modules with lessons const { data: modulesData } = await supabase .from('bootcamp_modules') .select(` @@ -102,6 +100,7 @@ export default function Bootcamp() { title, content, video_url, + duration_seconds, position, release_at ) @@ -116,13 +115,11 @@ export default function Bootcamp() { })); setModules(sortedModules); - // Select first lesson if (sortedModules.length > 0 && sortedModules[0].lessons.length > 0) { setSelectedLesson(sortedModules[0].lessons[0]); } } - // Fetch progress const { data: progressData } = await supabase .from('lesson_progress') .select('lesson_id, completed_at') @@ -148,23 +145,20 @@ export default function Bootcamp() { if (error) { if (error.code === '23505') { - toast({ title: 'Already completed', description: 'This lesson is already marked as completed' }); + toast({ title: 'Info', description: 'Pelajaran sudah ditandai selesai' }); } else { - toast({ title: 'Error', description: 'Failed to mark as completed', variant: 'destructive' }); + toast({ title: 'Error', description: 'Gagal menandai selesai', variant: 'destructive' }); } return; } setProgress([...progress, { lesson_id: selectedLesson.id, completed_at: new Date().toISOString() }]); - toast({ title: 'Completed!', description: 'Lesson marked as completed' }); - - // Auto-advance to next lesson + toast({ title: 'Selesai!', description: 'Pelajaran ditandai selesai' }); goToNextLesson(); }; const goToNextLesson = () => { if (!selectedLesson) return; - const allLessons = modules.flatMap(m => m.lessons); const currentIndex = allLessons.findIndex(l => l.id === selectedLesson.id); if (currentIndex < allLessons.length - 1) { @@ -174,7 +168,6 @@ export default function Bootcamp() { const goToPrevLesson = () => { if (!selectedLesson) return; - const allLessons = modules.flatMap(m => m.lessons); const currentIndex = allLessons.findIndex(l => l.id === selectedLesson.id); if (currentIndex > 0) { @@ -183,27 +176,70 @@ export default function Bootcamp() { }; const getVideoEmbed = (url: string) => { - // Handle YouTube URLs const youtubeMatch = url.match(/(?:youtube\.com\/(?:watch\?v=|embed\/)|youtu\.be\/)([^&\s]+)/); - if (youtubeMatch) { - return `https://www.youtube.com/embed/${youtubeMatch[1]}`; - } - // Handle Vimeo URLs + if (youtubeMatch) return `https://www.youtube.com/embed/${youtubeMatch[1]}`; const vimeoMatch = url.match(/vimeo\.com\/(\d+)/); - if (vimeoMatch) { - return `https://player.vimeo.com/video/${vimeoMatch[1]}`; - } + if (vimeoMatch) return `https://player.vimeo.com/video/${vimeoMatch[1]}`; return url; }; const completedCount = progress.length; const totalLessons = modules.reduce((sum, m) => sum + m.lessons.length, 0); + const renderSidebarContent = () => ( +
+ {modules.map((module) => ( +
+

+ {module.title} +

+
+ {module.lessons.map((lesson) => { + const isCompleted = isLessonCompleted(lesson.id); + const isSelected = selectedLesson?.id === lesson.id; + const isReleased = !lesson.release_at || new Date(lesson.release_at) <= new Date(); + + return ( + + ); + })} +
+
+ ))} +
+ ); + if (authLoading || loading) { return (
-
+
{[...Array(5)].map((_, i) => ( @@ -221,94 +257,77 @@ export default function Bootcamp() { return (
{/* Header */} -
+
-

{product?.title}

+

{product?.title}

- - {completedCount} / {totalLessons} completed + + {completedCount} / {totalLessons} selesai -
-
+
0 ? (completedCount / totalLessons) * 100 : 0}%` }} />
+ {/* Mobile menu trigger */} + + + + + +
Kurikulum
+
+ {renderSidebarContent()} +
+
+
- {/* Sidebar */} + {/* Desktop Sidebar */} {/* Toggle sidebar button */} {/* Main content */} -
+
{selectedLesson ? (
-

{selectedLesson.title}

+
+

{selectedLesson.title}

+ {selectedLesson.duration_seconds && ( + + + {formatDuration(selectedLesson.duration_seconds)} + + )} +
{selectedLesson.video_url && ( -
+