mirror of
https://github.com/linsa-io/linsa.git
synced 2026-04-24 01:08:36 +02:00
fix(page): Add item scroll, fix display issues, refactor nav, and improve perf (#166)
* feat: add item scroll to active * fix: reset enterkey and scroll to view * fix: link item displayName * refactor: remove keyboard page nav * chore: fix scrolling, perf, keys, highlight active item etc * chore: use new hook for create a page * chore: disabled auto delete page
This commit is contained in:
@@ -21,14 +21,10 @@ export const PageItem = React.forwardRef<HTMLAnchorElement, PageItemProps>(({ pa
|
||||
<Link
|
||||
ref={ref}
|
||||
tabIndex={isActive ? 0 : -1}
|
||||
className={cn(
|
||||
"relative block cursor-default rounded-lg outline-none",
|
||||
"h-12 items-center gap-x-2 py-2 max-lg:px-4 sm:px-6",
|
||||
{
|
||||
"bg-muted-foreground/10": isActive,
|
||||
"hover:bg-muted/50": !isActive
|
||||
}
|
||||
)}
|
||||
className={cn("relative block cursor-default outline-none", "min-h-12 py-2 max-lg:px-4 sm:px-6", {
|
||||
"bg-muted-foreground/5": isActive,
|
||||
"hover:bg-muted/50": !isActive
|
||||
})}
|
||||
href={`/pages/${page.id}`}
|
||||
role="listitem"
|
||||
>
|
||||
@@ -38,14 +34,9 @@ export const PageItem = React.forwardRef<HTMLAnchorElement, PageItemProps>(({ pa
|
||||
</Column.Wrapper>
|
||||
|
||||
{!isTablet && (
|
||||
<>
|
||||
{/* <Column.Wrapper style={columnStyles.content}>
|
||||
<Column.Text className="text-[13px]">{page.slug}</Column.Text>
|
||||
</Column.Wrapper> */}
|
||||
<Column.Wrapper style={columnStyles.topic}>
|
||||
{page.topic && <Badge variant="secondary">{page.topic.prettyName}</Badge>}
|
||||
</Column.Wrapper>
|
||||
</>
|
||||
<Column.Wrapper style={columnStyles.topic}>
|
||||
{page.topic && <Badge variant="secondary">{page.topic.prettyName}</Badge>}
|
||||
</Column.Wrapper>
|
||||
)}
|
||||
|
||||
<Column.Wrapper style={columnStyles.updated} className="flex justify-end">
|
||||
|
||||
Reference in New Issue
Block a user