feat: report issue popup (#261)

* feat: report issue popup

* style: modified styles in feedback form

* chore: minor UI fixes

* chore: update useEffect

* chore: change width to 400px

---------

Co-authored-by: doprz <52579214+doprz@users.noreply.github.com>
Co-authored-by: Isaiah David Rodriguez <51803892+IsaDavRod@users.noreply.github.com>
This commit is contained in:
Sriram Hariharan
2024-10-12 20:31:26 -05:00
committed by GitHub
parent bd17e33537
commit 65ff6bfbbf
14 changed files with 1855 additions and 989 deletions

View File

@@ -0,0 +1,28 @@
/**
* Open the report window relative centered to the current window.
*/
export function openReportWindow() {
chrome.windows.getCurrent({ populate: false }, currentWindow => {
const width = 400;
const height = 600;
// Calculate the new window's position to center it relative to the current window
const left =
currentWindow.left && currentWindow.width
? Math.round(currentWindow.left + (currentWindow.width - width) / 2)
: undefined;
const top =
currentWindow.top && currentWindow.height
? Math.round(currentWindow.top + (currentWindow.height - height) / 2)
: undefined;
chrome.windows.create({
url: chrome.runtime.getURL(`report.html`),
type: 'popup',
width,
height,
left,
top,
});
});
}