Skip to content

Conversation

myjeong19
Copy link
Member

Description of Changes

Here is reference: #25


support 'custom your created image' block

Review point

  • Tooltip visibility when the scale input is focused.
  • Tooltip styling.

To reproduce

  • npm run story:start
  • click 'your created block' on the Storybook left side panel

Screenshot

Review Guide

Reviews are conducted based on priority levels, such as p0, p1, p2, p3, p4, and p5.
p0 ~ p2: If the author decides not to reflect a review for p0 to p2, it signals that a proper discussion with the reviewer is
necessary. It is expected that the review will be resolved either through incorporating the feedback or through further discussion.
p3: indicates that the reviewer has identified a significant issue, but either lacks a clear solution or the comment lacks sufficient context. Further explanation or additional discussion on the reviewer's concerns is needed.
p4, p5: p4 and p5 suggest low priority, and if the author does not deem them important, these comments can be disregarded.


useEffect(() => {
if (!isOpened) {
document.body.style.overflow = "visible";
Copy link
Contributor

Choose a reason for hiding this comment

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

p1: It cause layout shift (you know scroll bar has its own width)

Copy link
Contributor

Choose a reason for hiding this comment

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

p1: you'd better research other library
but don't use it. just copy code

transform: `scale(${scale})`,
transformOrigin: `${scaleOriginX * 100}% ${scaleOriginY * 100}%`,
cursor: getCursorStyle(scale),
cursor: isCursorVisible ? getCursorStyle(scale) : "none",
Copy link
Contributor

Choose a reason for hiding this comment

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

p1: cursor does not disappear on overlay (not image). you should fix it

}, [isOpened, currentImageIndex, setScale, setDisplayScale]);

useEffect(() => {
const notion = document.querySelector(".notion") as HTMLElement;
Copy link
Contributor

Choose a reason for hiding this comment

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

p1: scroll on .notion does not work

Copy link
Member Author

Choose a reason for hiding this comment

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

Is that still the case even when the image viewer is not open?

Copy link
Contributor

Choose a reason for hiding this comment

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

umm.. scrolling element is not .notion

it depends on user's layout


if (isOpened) {
document.body.style.overflow = "hidden";
notion.style.marginRight = "15px";
Copy link
Contributor

Choose a reason for hiding this comment

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

p1: margin '15px' is dangerous considering cross brouwsing

you should research 3rd libraries code

margin-right: 15px;
}

button {
Copy link
Contributor

Choose a reason for hiding this comment

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

p1: don't define global button style


export const useCursorVisibility = (isScaleFocus: boolean) => {
export const useCursorVisibility = () => {
const [isCursorVisible, setIsisCursorVisible] = useState(true);
Copy link
Contributor

Choose a reason for hiding this comment

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

p1: setIsis -> typo error

@Moon-DaeSeung
Copy link
Contributor

p3: you should give more detail info on pr title

@myjeong19 myjeong19 changed the title Fix/image fix addressing image block overlay layout shift problems Nov 5, 2024
@myjeong19
Copy link
Member Author

I used react-remove-scroll-bar and react-style-singleton as references to resolve the layout shift issues.


if (isOpened) {
document.body.setAttribute("data-scroll-locked", "true");
const gap = getGapWidth();
Copy link
Contributor

Choose a reason for hiding this comment

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

p2: you should capsulize this hook.

I suggest use-prevent-scroll

Copy link
Member Author

Choose a reason for hiding this comment

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

I checked this review.

Copy link
Contributor

@Moon-DaeSeung Moon-DaeSeung left a comment

Choose a reason for hiding this comment

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

GOOOD

@Moon-DaeSeung Moon-DaeSeung merged commit 5db5219 into main Nov 27, 2024
@Moon-DaeSeung Moon-DaeSeung deleted the fix/image branch November 27, 2024 10:24
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.

2 participants