Skip to content

Commit

Permalink
[QuickSignPDF] Add a quick date button (#79)
Browse files Browse the repository at this point in the history
  • Loading branch information
mkhatib authored Dec 15, 2022
1 parent c5ec736 commit d68f907
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 1 deletion.
28 changes: 28 additions & 0 deletions src/QuickSignPDF/QuickSignPDF.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import {
ArrowLeftCircleIcon,
ArrowRightCircleIcon,
ArrowUpTrayIcon,
CalendarDaysIcon,
LanguageIcon,
MagnifyingGlassMinusIcon,
MagnifyingGlassPlusIcon,
Expand Down Expand Up @@ -300,6 +301,8 @@ const QuickSignPDF = (): JSX.Element => {
hasControls: false,
width: 400,
fill: rgbColorToCssRgba(color),
top: 100,
left: 100,
});
editorRef.current.canvas.add(text);

Expand All @@ -308,6 +311,31 @@ const QuickSignPDF = (): JSX.Element => {
>
<LanguageIcon className="w-5" />
</button>
<button
className=" text-gray-500 px-3 py-2 hover:text-green-700 mr-2"
onClick={() => {
if (!editorRef.current) return;
setIsDrawingMode(false);
const text = new fabric.fabric.Textbox(
new Date().toLocaleDateString(),
{
fontFamily: 'Helvetica',
fontSize,
hasControls: false,
width: 400,
fill: rgbColorToCssRgba(color),
top: 100,
left: 100,
}
);
editorRef.current.canvas.add(text);

updatePageObjects();
}}
>
<CalendarDaysIcon className="w-5" />
</button>

<button
className=" text-gray-500 px-1 hover:text-green-700 mr-2"
onClick={() => {
Expand Down
2 changes: 1 addition & 1 deletion src/ToolsNav/ToolsNav.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ const ToolsNav = ({
activeClassName={activeClassName}
to="/quick-sign-pdf"
>
Quick Sign
Quick Sign PDF
</NavLink>
<NavLink
exact
Expand Down

0 comments on commit d68f907

Please sign in to comment.