mirror of
https://github.com/docmost/docmost.git
synced 2025-11-16 22:51:10 +10:00
updates and fixes
* seo friendly urls * custom client serve-static module * database fixes * fix recent pages * other fixes
This commit is contained in:
@ -1,5 +1,5 @@
|
||||
import { Text, Tabs, Space } from "@mantine/core";
|
||||
import { IconClockHour3, IconStar } from "@tabler/icons-react";
|
||||
import { IconClockHour3 } from "@tabler/icons-react";
|
||||
import RecentChanges from "@/features/home/components/recent-changes";
|
||||
|
||||
export default function HomeTabs() {
|
||||
@ -16,7 +16,7 @@ export default function HomeTabs() {
|
||||
<Space my="md" />
|
||||
|
||||
<Tabs.Panel value="recent">
|
||||
<div>Recent</div>
|
||||
<RecentChanges />
|
||||
</Tabs.Panel>
|
||||
</Tabs>
|
||||
);
|
||||
|
||||
@ -1,9 +1,10 @@
|
||||
import { Text, Group, Stack, UnstyledButton, Divider } from '@mantine/core';
|
||||
import { format } from 'date-fns';
|
||||
import classes from './home.module.css';
|
||||
import { Link } from 'react-router-dom';
|
||||
import PageListSkeleton from '@/features/home/components/page-list-skeleton';
|
||||
import { useRecentChangesQuery } from '@/features/page/queries/page-query';
|
||||
import { Text, Group, Stack, UnstyledButton, Divider } from "@mantine/core";
|
||||
import { format } from "date-fns";
|
||||
import classes from "./home.module.css";
|
||||
import { Link } from "react-router-dom";
|
||||
import PageListSkeleton from "@/features/home/components/page-list-skeleton";
|
||||
import { useRecentChangesQuery } from "@/features/page/queries/page-query";
|
||||
import { buildPageSlug } from "@/features/page/page.utils.ts";
|
||||
|
||||
function RecentChanges() {
|
||||
const { data, isLoading, isError } = useRecentChangesQuery();
|
||||
@ -18,21 +19,23 @@ function RecentChanges() {
|
||||
|
||||
return (
|
||||
<div>
|
||||
{data
|
||||
.map((page) => (
|
||||
{data.items.map((page) => (
|
||||
<div key={page.id}>
|
||||
<UnstyledButton component={Link} to={`/p/${page.id}`}
|
||||
className={classes.page} p="xs">
|
||||
<UnstyledButton
|
||||
component={Link}
|
||||
to={buildPageSlug(page.slugId, page.title)}
|
||||
className={classes.page}
|
||||
p="xs"
|
||||
>
|
||||
<Group wrap="nowrap">
|
||||
|
||||
<Stack gap="xs" style={{ flex: 1 }}>
|
||||
<Text fw={500} size="md" lineClamp={1}>
|
||||
{page.title || 'Untitled'}
|
||||
{page.title || "Untitled"}
|
||||
</Text>
|
||||
</Stack>
|
||||
|
||||
<Text c="dimmed" size="xs" fw={500}>
|
||||
{format(new Date(page.updatedAt), 'PP')}
|
||||
{format(new Date(page.updatedAt), "PP")}
|
||||
</Text>
|
||||
</Group>
|
||||
</UnstyledButton>
|
||||
|
||||
Reference in New Issue
Block a user