-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add pages and page blocks #495
Conversation
iamsahebgiri
commented
Mar 22, 2023
- Created the page UI as per design.
- Implemented add page to favorite and remove page from favorite.
- Can able to update and delete page
- Can able to create, update and delete page blocks.
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
}; | ||
|
||
const createPage = async (payload: IPageForm) => { | ||
payload = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we need this line?
.createPage(workspaceSlug as string, projectId as string, payload) | ||
.then(() => { | ||
mutate(PAGE_LIST(projectId as string)); | ||
handleClose(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change this to onClose()
const handleDeletion = async () => { | ||
setIsDeleteLoading(true); | ||
if (!data || !workspaceSlug) return; | ||
console.log(data); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Remove this console.log
}); | ||
}) | ||
.catch((error) => { | ||
console.log(error); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add a toast alert to handle this error
query: { workspaceSlug, projectId, pageId }, | ||
} = useRouter(); | ||
|
||
const handleMouseEnter = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use tailwind group to handle the hover events.
apps/app/services/pages.service.ts
Outdated
workspaceSlug: string, | ||
projectId: string, | ||
pageId: string, | ||
data: IPageForm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data needs to be Partial for the patch request
apps/app/services/pages.service.ts
Outdated
projectId: string, | ||
pageId: string, | ||
pageBlockId: string, | ||
data: IPageBlockForm |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
data needs to be Partial for the patch request
- used tailwind for hover events - add error toast alert - used partial for patch request
className="border-none bg-transparent outline-none" | ||
/> | ||
|
||
<div className="absolute top-[50%] right-0 z-20 mr-2 hidden translate-y-[-50%] group-hover:block"> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't need to use absolute positioning, just flex justify between would be fine
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah I have fixed it