fix: minor pages ui (#700)

This commit is contained in:
Aaryan Khandelwal
2023-04-04 18:31:28 +05:30
committed by GitHub
parent 7f7ceec24c
commit 0036ac6afb
3 changed files with 15 additions and 28 deletions

View File

@@ -148,15 +148,15 @@ export const CreateUpdateBlockInline: React.FC<Props> = ({
useEffect(() => {
window.addEventListener("keydown", (e: KeyboardEvent) => {
if (e.key === "Escape") onClose();
if (e.key === "Escape") handleClose();
});
return () => {
window.removeEventListener("keydown", (e: KeyboardEvent) => {
if (e.key === "Escape") onClose();
if (e.key === "Escape") handleClose();
});
};
}, [onClose]);
}, [handleClose]);
return (
<div className="border rounded-[10px] p-2 ml-6">

View File

@@ -50,9 +50,9 @@ export const SinglePageDetailedItem: React.FC<TSingleStatProps> = ({
const { workspaceSlug, projectId } = router.query;
return (
<Link href={`/${workspaceSlug}/projects/${projectId}/pages/${page.id}`}>
<a>
<div className="relative rounded border p-4">
<div className="relative first:rounded-t last:rounded-b border">
<Link href={`/${workspaceSlug}/projects/${projectId}/pages/${page.id}`}>
<a className="block p-4">
<div className="flex items-center justify-between gap-2">
<div className="flex items-center gap-2">
<p className="mr-2 truncate text-sm font-medium">{truncateText(page.name, 75)}</p>
@@ -157,26 +157,13 @@ export const SinglePageDetailedItem: React.FC<TSingleStatProps> = ({
</CustomMenu>
</div>
</div>
<div className="relative mt-6 space-y-2 text-sm text-gray-600">
<div className="page-block-section -m-4 -mt-6">
{page.blocks.length > 0 ? (
<RemirrorRichTextEditor
value={
!page.blocks[0].description ||
(typeof page.blocks[0].description === "object" &&
Object.keys(page.blocks[0].description).length === 0)
? page.blocks[0].description_html
: page.blocks[0].description
}
editable={false}
customClassName="text-gray-500"
noBorder
/>
) : null}
</div>
<div className="relative mt-2 space-y-2 text-sm text-gray-600">
{page.blocks.length > 0
? page.blocks.slice(0, 3).map((block) => <h4>{block.name}</h4>)
: null}
</div>
</div>
</a>
</Link>
</a>
</Link>
</div>
);
};