-
Notifications
You must be signed in to change notification settings - Fork 0
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
Showing
7 changed files
with
38 additions
and
63 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -64,7 +64,4 @@ | |
} | ||
.taskSection { | ||
margin: 0px 0px 46px 0px; | ||
&:last-child { | ||
margin-bottom: 0px; | ||
} | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,22 +1,21 @@ | ||
import React, { useEffect, useState } from "react"; | ||
import React, { useEffect, useRef } from "react"; | ||
|
||
export const useMenuPosition = ( | ||
elementRef: React.MutableRefObject<HTMLElement | HTMLDivElement | null> | ||
elementRef: React.RefObject<HTMLDivElement>, | ||
offsetTop: number, | ||
offsetLeft: number | ||
) => { | ||
const [menuPosition, setMenuPosition] = useState({ | ||
top: 0, | ||
left: 0, | ||
}); | ||
const menuRef = useRef<HTMLMenuElement>(null); | ||
|
||
useEffect(() => { | ||
if (elementRef.current) { | ||
const elementNode = elementRef.current; | ||
setMenuPosition({ | ||
top: elementNode.offsetTop, | ||
left: elementNode.offsetLeft, | ||
}); | ||
if (elementRef.current && menuRef.current) { | ||
const top = elementRef.current.offsetTop; | ||
const left = elementRef.current.offsetLeft; | ||
|
||
menuRef.current.style.top = top + offsetTop + "px"; | ||
menuRef.current.style.left = left + offsetLeft + "px"; | ||
} | ||
}, [elementRef]); | ||
}, [elementRef.current?.offsetTop, elementRef.current?.offsetLeft]); | ||
|
||
return menuPosition; | ||
return menuRef; | ||
}; |
This file was deleted.
Oops, something went wrong.