Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@P-Gill97
Copy link
Contributor

@P-Gill97 P-Gill97 commented May 5, 2025

@TomWoodward TomWoodward temporarily deployed to rex-web-image-preview-wka1pcen May 5, 2025 07:34 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-image-preview-9dvhbja3 June 12, 2025 22:20 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-image-preview-9dvhbja3 June 12, 2025 22:30 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-image-preview-9dvhbja3 June 13, 2025 15:09 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-image-preview-9dvhbja3 June 13, 2025 15:45 Inactive
overlay={true}
zIndex={theme.zIndex.highlightSummaryPopup}
/>
<ModalWrapper aria-modal='true'>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should this also have role=dialog?


export function MediaModalPortal(): React.ReactPortal | null {
const [isOpen, setIsOpen] = React.useState(false);
const [modalContent, setModalContent] = React.useState<ReactNode>(null);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

needs to handle esc to close

const setClosed = React.useCallback(() => setIsOpen(false), [setIsOpen]);
useOnEsc(isOpen, setClosed);

`;

// tslint:disable-next-line:variable-name
const ModalWrapper = styled.div`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this sorta needs to be taking up the whole screen so that it can center things properly, but its gobbling click events so clicking on the overlay isn't closing things. i think you can set a css prop on here to allow click events to pass through and that'll fix it

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this whole MediaModalManger setup is pretty convoluted, can you look at the highlightManager and try to share some of the patterns?

don't need the singleton class. stylistically, would be more consistent if it was a function and not a class. PageComponent can construct the manager and store the manager reference

PageComponent should orchestrate managers but there shouldn't be any business logic in there, move all the event listeners into the manager, you can bind your listener to the page component element instead of each individual image so that you don't have to re-apply the listeners when the content changes

return <MinPageHeight>
<this.highlightManager.CardList />
<PT />
<MediaModalPortal />
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you look above, the CardList is coming from the manager so that you don't need all the wonky binding logic. if you prefer, you could leave the component separate and pass the manager into it as a prop here, but either of those approaches would be more clear than the singleton binding its doing now

@TomWoodward TomWoodward temporarily deployed to rex-web-image-preview-9dvhbja3 June 13, 2025 16:22 Inactive
@TomWoodward TomWoodward temporarily deployed to rex-web-image-preview-9dvhbja3 June 17, 2025 01:17 Inactive
Copy link
Member

@TomWoodward TomWoodward left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

my github ui seemed to be messed up and i was seeing the old code, sorry about that, not sure what happened

@TomWoodward
Copy link
Member

i have an interest in merging this in case we want to use it for the math too @P-Gill97

@P-Gill97
Copy link
Contributor Author

@TomWoodward Is it ok if we merge this before the assessment-components PR is reviewed and approved? If so I can merge it now.

@TomWoodward
Copy link
Member

@TomWoodward Is it ok if we merge this before the assessment-components PR is reviewed and approved? If so I can merge it now.

yea i think thats ok, as long as we don't discover some UI/UX/Accessibility issues that we want to make in both places, and we can refine that later if necessary. i think we can merge this now

@P-Gill97
Copy link
Contributor Author

Ok i'll merge it.

@P-Gill97 P-Gill97 merged commit f2d701c into main Nov 13, 2025
7 of 8 checks passed
@P-Gill97 P-Gill97 deleted the image-preview branch November 13, 2025 21:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants