-
Notifications
You must be signed in to change notification settings - Fork 28
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add the idea of collections to posts (#313)
* add the idea of collections to posts adds the TreeList view, postType selector on create, and some other initial aspects * fix: hydration error * fix: add types * fix: space * fix: types * edit post skeleton * fix: package lock * feat: You can now add lessons to a course. * feat: Adds a toggle to look at all posts or just my posts. * fix: m3eh * promises * pkg
- Loading branch information
Showing
26 changed files
with
2,403 additions
and
193 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,7 +5,7 @@ | |
"type": "module", | ||
"scripts": { | ||
"dev": "concurrently --kill-others-on-fail \"npm:dev:*\"", | ||
"dev:next": "next dev", | ||
"dev:next": "NODE_OPTIONS='--inspect' next dev --turbo", | ||
"dev:inngest": "pnpx inngest-cli@latest dev --no-discovery -u http://localhost:3000/api/inngest", | ||
"dev:party": "pnpx partykit dev", | ||
"tunnel": "ngrok http --domain=neatly-diverse-goldfish.ngrok-free.app 3000", | ||
|
@@ -21,6 +21,11 @@ | |
"coupons": "dotenv tsx src/scripts/bootstrap-basic-coupons.ts" | ||
}, | ||
"dependencies": { | ||
"@atlaskit/pragmatic-drag-and-drop": "^1.1.3", | ||
"@atlaskit/pragmatic-drag-and-drop-flourish": "^1.0.4", | ||
"@atlaskit/pragmatic-drag-and-drop-hitbox": "^1.0.3", | ||
"@atlaskit/pragmatic-drag-and-drop-live-region": "^1.0.3", | ||
"@atlaskit/tokens": "^1.42.1", | ||
"@auth/core": "^0.37.2", | ||
"@aws-sdk/client-s3": "^3.525.0", | ||
"@aws-sdk/s3-request-presigner": "^3.441.0", | ||
|
@@ -72,6 +77,7 @@ | |
"inngest": "^3.22.5", | ||
"lodash": "^4.17.21", | ||
"lucide-react": "^0.288.0", | ||
"memoize-one": "^6.0.0", | ||
"nanoid": "^5.0.2", | ||
"next": "15.0.3", | ||
"next-auth": "5.0.0-beta.25", | ||
|
@@ -99,6 +105,8 @@ | |
"tailwind-merge": "^1.14.0", | ||
"tailwind-scrollbar": "^3.0.0", | ||
"tailwindcss-animate": "^1.0.7", | ||
"tailwindcss-radix": "^2.8.0", | ||
"tiny-invariant": "^1.3.1", | ||
"typesense": "^1.8.2", | ||
"uploadthing": "6.13.2", | ||
"uuid": "^9.0.1", | ||
|
@@ -112,6 +120,7 @@ | |
"@types/pg": "^8.11.6", | ||
"@types/pluralize": "^0.0.33", | ||
"@types/react": "npm:[email protected]", | ||
"@types/react-dom": "npm:[email protected]", | ||
"@types/react-gravatar": "^2.6.13", | ||
"concurrently": "^8.2.2", | ||
"dotenv-cli": "^7.3.0", | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
apps/egghead/src/app/(content)/posts/_components/posts-filter-toggle.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
'use client' | ||
|
||
import { useRouter, useSearchParams } from 'next/navigation' | ||
|
||
import { Button } from '@coursebuilder/ui' | ||
|
||
export function PostsFilterToggle({ canManageAll }: { canManageAll: boolean }) { | ||
const router = useRouter() | ||
const searchParams = useSearchParams() | ||
const showingAll = searchParams.get('view') === 'all' | ||
|
||
if (!canManageAll) return null | ||
|
||
const handleToggle = () => { | ||
const newPath = showingAll ? '/posts' : '/posts?view=all' | ||
router.push(newPath) | ||
} | ||
|
||
return ( | ||
<Button | ||
variant="ghost" | ||
size="sm" | ||
onClick={handleToggle} | ||
className="text-muted-foreground hover:text-foreground" | ||
> | ||
{showingAll ? '👤 Show My Posts' : '👥 Show All Posts'} | ||
</Button> | ||
) | ||
} |
Oops, something went wrong.