Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
54 commits
Select commit Hold shift + click to select a range
c3d1a9f
feat: keyboard nav
Aslam97 Aug 26, 2024
ab65f73
fix: link update
Aslam97 Aug 26, 2024
1471784
feat: reusable learning state
Aslam97 Aug 26, 2024
031b69d
chore: use new learning state
Aslam97 Aug 26, 2024
e668f59
feat: add to my profile
Aslam97 Aug 26, 2024
9073dc3
.
nikivdev Aug 26, 2024
9c2bc35
.
nikivdev Aug 26, 2024
e4b6ab7
feat: on enter open the link
Aslam97 Aug 27, 2024
2664eb0
fix: lint
Aslam97 Aug 27, 2024
4d9432a
fix: use eslint v8 instead of v9
Aslam97 Aug 27, 2024
25bdd32
fix: add to my profile
Aslam97 Aug 27, 2024
ceffa62
chore: update personal link schema
Aslam97 Aug 27, 2024
ac847e7
chore: update personal page schema
Aslam97 Aug 27, 2024
c6dc8a7
fix: update detail wrapper
Aslam97 Aug 27, 2024
46f199b
fix: update page section
Aslam97 Aug 27, 2024
6c1d14c
removing option for learning status
olyamrshn Aug 27, 2024
4f19729
removing option for learning status for topic
olyamrshn Aug 27, 2024
6f7c456
feat: add createdAt and updatedAt for personal Page
Aslam97 Aug 27, 2024
1eeebd3
chore: update page section component
Aslam97 Aug 27, 2024
0e54d82
Merge branch 'fix/topics' of github.com:learn-anything/learn-anything…
Aslam97 Aug 27, 2024
7554cf7
chore: remove chevron from sub menu
Aslam97 Aug 27, 2024
1d90846
fix: sidebar
Aslam97 Aug 27, 2024
b9a1e31
chore: add focus and disable toast
Aslam97 Aug 27, 2024
dc72911
feat: la editor add execption for no command class
Aslam97 Aug 27, 2024
4277647
fix: la editor style and fix page detail
Aslam97 Aug 27, 2024
f0306e2
fix: title
Aslam97 Aug 27, 2024
ab3be64
fix: topic learning state
Aslam97 Aug 27, 2024
0c9a877
chore: add showSearch for learning state
Aslam97 Aug 27, 2024
f0c8f4a
fix: bunch stuff
Aslam97 Aug 27, 2024
7a527e7
chore: link list and item handle learning state
Aslam97 Aug 27, 2024
1841186
chore: set expand to false
Aslam97 Aug 28, 2024
3e89d26
feat: personal link for topic detail
Aslam97 Aug 28, 2024
f9c03a9
chore: hook use topic data
Aslam97 Aug 28, 2024
13cad2e
chore: go to list
Aslam97 Aug 28, 2024
fcd643a
fix: link and topic
Aslam97 Aug 28, 2024
73b4951
feat(utils): new keyboard utils
Aslam97 Aug 28, 2024
8f10a90
feat(store): add linkOpenPopoverForIdAtom for link
Aslam97 Aug 28, 2024
9fded19
chore: using memo for use topic data
Aslam97 Aug 28, 2024
15db61e
fix: remove duplicate component
Aslam97 Aug 28, 2024
c3b1ecd
chore: performance for topic detail lint item
Aslam97 Aug 28, 2024
b6ce4cd
refactor: remove LinkOptions component
Aslam97 Aug 28, 2024
4ce1346
chore: improve performance for list
Aslam97 Aug 28, 2024
61dc2f0
feat: added LinkRoute copmonent
Aslam97 Aug 28, 2024
5dec7fe
chore: link manage
Aslam97 Aug 28, 2024
baaa3c1
feat: bottom bar
Aslam97 Aug 28, 2024
50d0c9e
fix: link
Aslam97 Aug 28, 2024
54cec33
fix: page wrapper
Aslam97 Aug 28, 2024
58fcda6
fix: import thing
Aslam97 Aug 28, 2024
f29e7aa
chore: added a displayname
Aslam97 Aug 28, 2024
bf22d0f
refactor: page detail
Aslam97 Aug 28, 2024
c963ddf
refactor: page detail
Aslam97 Aug 28, 2024
4ac9bca
fix: add topic to personal link form link
Aslam97 Aug 28, 2024
b523cd7
fix: only show page count if more than zero
Aslam97 Aug 28, 2024
3e76891
fix: sidebar topic section
Aslam97 Aug 28, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions web/app/(pages)/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import AuthHomeRoute from "@/components/routes/AuthHomeRoute"
import { LinkRoute } from "@/components/routes/link/LinkRoute"

export default function HomePage() {
return <AuthHomeRoute />
return <LinkRoute />
}
4 changes: 2 additions & 2 deletions web/app/(pages)/pages/[id]/page.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { DetailPageWrapper } from "@/components/routes/page/detail/wrapper"
import { PageDetailRoute } from "@/components/routes/page/detail/PageDetailRoute"

export default function DetailPage({ params }: { params: { id: string } }) {
return <DetailPageWrapper pageId={params.id} />
return <PageDetailRoute pageId={params.id} />
}
3 changes: 1 addition & 2 deletions web/app/layout.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import type { Metadata } from "next"
import { Inter as FontSans } from "next/font/google"
import { Inter } from "next/font/google"
import { cn } from "@/lib/utils"
import { ThemeProvider } from "@/lib/providers/theme-provider"
import "./globals.css"
Expand Down Expand Up @@ -32,7 +31,7 @@ export default function RootLayout({
<JotaiProvider>
<ConfirmProvider>
{children}
<Toaster />
<Toaster expand={false} />
</ConfirmProvider>
</JotaiProvider>
</ThemeProvider>
Expand Down
25 changes: 0 additions & 25 deletions web/components/LinkOptions.tsx

This file was deleted.

107 changes: 107 additions & 0 deletions web/components/custom/learning-state-selector.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,107 @@
import React, { useMemo } from "react"
import { useAtom } from "jotai"
import { Button } from "@/components/ui/button"
import { Popover, PopoverTrigger, PopoverContent } from "@/components/ui/popover"
import { cn } from "@/lib/utils"
import { LaIcon } from "@/components/custom/la-icon"
import { LEARNING_STATES, LearningStateValue } from "@/lib/constants"
import { linkLearningStateSelectorAtom } from "@/store/link"
import { Command, CommandInput, CommandList, CommandItem, CommandGroup } from "@/components/ui/command"
import { ScrollArea } from "@/components/ui/scroll-area"

interface LearningStateSelectorProps {
showSearch?: boolean
defaultLabel?: string
searchPlaceholder?: string
value?: string
onChange: (value: LearningStateValue) => void
className?: string
}

export const LearningStateSelector: React.FC<LearningStateSelectorProps> = ({
showSearch = true,
defaultLabel = "Select state",
searchPlaceholder = "Search state...",
value,
onChange,
className
}) => {
const [isLearningStateSelectorOpen, setIsLearningStateSelectorOpen] = useAtom(linkLearningStateSelectorAtom)
const selectedLearningState = useMemo(() => LEARNING_STATES.find(ls => ls.value === value), [value])

const handleSelect = (selectedValue: string) => {
onChange(selectedValue as LearningStateValue)
setIsLearningStateSelectorOpen(false)
}

return (
<Popover open={isLearningStateSelectorOpen} onOpenChange={setIsLearningStateSelectorOpen}>
<PopoverTrigger asChild>
<Button
size="sm"
type="button"
role="combobox"
variant="secondary"
className={cn("gap-x-2 text-sm", className)}
>
{selectedLearningState?.icon && (
<LaIcon name={selectedLearningState.icon} className={cn(selectedLearningState.className)} />
)}
<span className={cn("truncate", selectedLearningState?.className || "")}>
{selectedLearningState?.label || defaultLabel}
</span>
<LaIcon name="ChevronDown" />
</Button>
</PopoverTrigger>
<PopoverContent
className="w-52 rounded-lg p-0"
side="bottom"
align="end"
onCloseAutoFocus={e => e.preventDefault()}
>
<LearningStateSelectorContent
showSearch={showSearch}
searchPlaceholder={searchPlaceholder}
value={value}
onSelect={handleSelect}
/>
</PopoverContent>
</Popover>
)
}

interface LearningStateSelectorContentProps {
showSearch: boolean
searchPlaceholder: string
value?: string
onSelect: (value: string) => void
}

export const LearningStateSelectorContent: React.FC<LearningStateSelectorContentProps> = ({
showSearch,
searchPlaceholder,
value,
onSelect
}) => {
return (
<Command>
{showSearch && <CommandInput placeholder={searchPlaceholder} className="h-9" />}
<CommandList>
<ScrollArea>
<CommandGroup>
{LEARNING_STATES.map(ls => (
<CommandItem key={ls.value} value={ls.value} onSelect={onSelect}>
<LaIcon name={ls.icon} className={cn("mr-2", ls.className)} />
<span className={ls.className}>{ls.label}</span>
<LaIcon
name="Check"
className={cn("absolute right-3", ls.value === value ? "text-primary" : "text-transparent")}
/>
</CommandItem>
))}
</CommandGroup>
</ScrollArea>
</CommandList>
</Command>
)
}
Loading