-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
2481d21
commit 776a8cc
Showing
9 changed files
with
197 additions
and
42 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
31 changes: 31 additions & 0 deletions
31
code/client/src/ui/components/sidebar/components/CreateResourcePopup.tsx
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,31 @@ | ||
import { ResourceType } from '@notespace/shared/src/workspace/types/resource'; | ||
import { BsFileEarmarkPlusFill } from 'react-icons/bs'; | ||
import { MdCreateNewFolder } from 'react-icons/md'; | ||
|
||
type CreateResourcePopupProps = { | ||
position: { top: number; left: number }; | ||
onCreate: (type: ResourceType) => void; | ||
}; | ||
|
||
function CreateResourcePopup({ position, onCreate }: CreateResourcePopupProps) { | ||
return ( | ||
<div | ||
className="popup" | ||
style={{ | ||
top: position.top, | ||
left: position.left, | ||
}} | ||
> | ||
<button onClick={() => onCreate(ResourceType.FOLDER)}> | ||
<MdCreateNewFolder /> | ||
Folder | ||
</button> | ||
<button onClick={() => onCreate(ResourceType.DOCUMENT)}> | ||
<BsFileEarmarkPlusFill /> | ||
Document | ||
</button> | ||
</div> | ||
); | ||
} | ||
|
||
export default CreateResourcePopup; |
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
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
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