mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-25 06:18:45 +08:00
feat: add publish workspace page list and workspace page
This commit is contained in:
@@ -67,10 +67,12 @@ export const PageList = ({
|
||||
pageList,
|
||||
showFavoriteTag = false,
|
||||
isTrash = false,
|
||||
isPublic = false,
|
||||
}: {
|
||||
pageList: PageMeta[];
|
||||
showFavoriteTag?: boolean;
|
||||
isTrash?: boolean;
|
||||
isPublic?: boolean;
|
||||
}) => {
|
||||
const router = useRouter();
|
||||
const { currentWorkspace } = useAppState();
|
||||
@@ -98,9 +100,15 @@ export const PageList = ({
|
||||
<StyledTableRow
|
||||
key={`${pageMeta.id}-${index}`}
|
||||
onClick={() => {
|
||||
router.push(
|
||||
`/workspace/${currentWorkspace?.id}/${pageMeta.id}`
|
||||
);
|
||||
if (isPublic) {
|
||||
router.push(
|
||||
`/public-workspace/${router.query.workspaceId}/${pageMeta.id}`
|
||||
);
|
||||
} else {
|
||||
router.push(
|
||||
`/workspace/${currentWorkspace?.id}/${pageMeta.id}`
|
||||
);
|
||||
}
|
||||
}}
|
||||
>
|
||||
<TableCell>
|
||||
@@ -124,19 +132,21 @@ export const PageList = ({
|
||||
dateKey={isTrash ? 'trashDate' : 'updatedDate'}
|
||||
backupKey={isTrash ? 'trashDate' : 'createDate'}
|
||||
/>
|
||||
<TableCell
|
||||
style={{ padding: 0 }}
|
||||
data-testid={`more-actions-${pageMeta.id}`}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
>
|
||||
{isTrash ? (
|
||||
<TrashOperationCell pageMeta={pageMeta} />
|
||||
) : (
|
||||
<OperationCell pageMeta={pageMeta} />
|
||||
)}
|
||||
</TableCell>
|
||||
{!isPublic ? (
|
||||
<TableCell
|
||||
style={{ padding: 0 }}
|
||||
data-testid={`more-actions-${pageMeta.id}`}
|
||||
onClick={e => {
|
||||
e.stopPropagation();
|
||||
}}
|
||||
>
|
||||
{isTrash ? (
|
||||
<TrashOperationCell pageMeta={pageMeta} />
|
||||
) : (
|
||||
<OperationCell pageMeta={pageMeta} />
|
||||
)}
|
||||
</TableCell>
|
||||
) : null}
|
||||
</StyledTableRow>
|
||||
);
|
||||
})}
|
||||
|
||||
Reference in New Issue
Block a user