-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #15 from premieroctet/feat/3-insert-block-access
Insert a block displayed in DnD list
- Loading branch information
Showing
4 changed files
with
47 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
import { useState } from 'react'; | ||
import { PlusCircleIcon } from '@heroicons/react/24/solid'; | ||
import AddTextBlockDialog from './dialog/AddTextBlockDialog'; | ||
import { useParams } from 'next/navigation'; | ||
import { useTeam } from '@/contexts/TeamContext'; | ||
|
||
const AddTextBlockButton = ({ position }: { position: number }) => { | ||
const params = useParams(); | ||
const [isAddTextDialogOpen, setIsAddTextDialogOpen] = useState(false); | ||
const { id: teamId } = useTeam(); | ||
|
||
return ( | ||
<div> | ||
<div className="group w-full cursor-pointer"> | ||
<div className="block group-hover:hidden h-6" /> | ||
<div className="hidden group-hover:block"> | ||
<div | ||
className="flex items-center" | ||
onClick={() => setIsAddTextDialogOpen(true)} | ||
> | ||
<div className="bg-violet-500 w-full h-0.5 flex-1"></div> | ||
<PlusCircleIcon className="h-6 w-6 text-violet-500" /> | ||
<div className="bg-violet-500 w-full h-0.5 flex-1"></div> | ||
</div> | ||
</div> | ||
</div> | ||
|
||
<AddTextBlockDialog | ||
isOpen={isAddTextDialogOpen} | ||
setIsOpen={setIsAddTextDialogOpen} | ||
digestId={params?.digestId as string} | ||
teamId={teamId} | ||
position={position + 1} | ||
/> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AddTextBlockButton; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5ef35a0
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.
Successfully deployed to the following URLs:
digestclub – ./
digestclub-premieroctet.vercel.app
digestclub-git-main-premieroctet.vercel.app
digestclub.vercel.app