Skip to content

Commit

Permalink
Michael/perf 1699 (#270)
Browse files Browse the repository at this point in the history
* Updated Request tool to get it online

* Removed unused component

* Updates to remove lint errors
  • Loading branch information
blonde-mike authored Nov 27, 2024
1 parent 1712aa9 commit 319f9d5
Show file tree
Hide file tree
Showing 6 changed files with 302 additions and 140 deletions.
56 changes: 53 additions & 3 deletions guide/results-viewer-react/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions guide/results-viewer-react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"homepage": "https://github.com/FamilySearch/pewpew/tree/master/lib/config-wasm#readme",
"dependencies": {
"@fs/hdr-histogram-wasm": "file:./lib/hdr-histogram-wasm",
"axios": "^1.7.8",
"chart.js": "~4.4.0",
"chartjs-adapter-date-fns": "^3.0.0",
"date-fns": "^3.0.0",
Expand Down
19 changes: 13 additions & 6 deletions guide/results-viewer-react/src/components/Modal/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,7 @@ interface ModalProps {
submitText?: string;
children?: React.ReactNode;
isReady?: boolean;
scrollable?: boolean;
}

export interface ModalObject {
Expand Down Expand Up @@ -134,7 +135,8 @@ export const Modal = forwardRef(({
onSubmit,
submitText = "submit",
children,
isReady
isReady,
scrollable
}: ModalProps, ref: Ref<ModalObject>) => {
const [display, setDisplay] = useState(false);
let windowOffset: number = 0;
Expand Down Expand Up @@ -177,10 +179,15 @@ export const Modal = forwardRef(({
};

const submit = (event?: React.MouseEvent<HTMLButtonElement>) => {
const scrollY = document.getElementById("root")!.style.top;
document.getElementById("root")!.style.position = "";
document.getElementById("root")!.style.top = "";
window.scrollTo(0, parseInt(scrollY || "0", 10) * -1);
const root = document.getElementById("root");
if (root) {
const scrollY = root.style.top;
root.style.position = "";
root.style.top = "";
window.scrollTo(0, parseInt(scrollY || "0", 10) * -1);
} else {
log("Cannot find element #root", LogLevel.DEBUG);
}
if (onSubmit) {
onSubmit(event).finally(() => setDisplay(false));
} else {
Expand All @@ -195,7 +202,7 @@ export const Modal = forwardRef(({
<ModalStyle>
<ModalDiv id="modal">
{title && <ModalTitle>{title}</ModalTitle>}
<ModalContent>{children}</ModalContent>{/* Any elements that are children of modal will be rendered here */}
<ModalContent style={!scrollable ? {overflow: "unset"} : {}}>{children}</ModalContent>{/* Any elements that are children of modal will be rendered here */}
<ModalActions>
{onSubmit &&
<button className="toggle-button" id="submitBtn" onClick={submit} disabled={!isReady}>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ const QuestionBubbleStyling = styled.span`
export function QuestionBubble ({ text, href }: QuestionBubbleProps) {
return (
<QuestionBubbleStyling>
{href && <span style={{marginRight: "8px"}} className="questionHover"><a href={href} target="_blank"><i style={{fontFamily: "Arial"}}>?</i></a><span className="questionHoverText">{text}</span></span>}
{!href && <span style={{marginRight: "8px"}} className="questionHover"><i style={{fontFamily: "Arial"}}>?</i><span className="questionHoverText">{text}</span></span>}
{href && <span style={{marginRight: "8px"}} className="questionHover"><a href={href} target="_blank"><i style={{fontFamily: "Arial", fontSize: "14px"}}>?</i></a><span className="questionHoverText">{text}</span></span>}
{!href && <span style={{marginRight: "8px"}} className="questionHover"><i style={{fontFamily: "Arial", fontSize: "14px"}}>?</i><span className="questionHoverText">{text}</span></span>}
</QuestionBubbleStyling>
);
}
Expand Down
Loading

0 comments on commit 319f9d5

Please sign in to comment.