Skip to content

Try fix #153

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 0 additions & 9 deletions components/gallery/Photo.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,7 @@ import React from 'react';
import Image from 'next/image';
import PropTypes from 'prop-types';

const imgWithClick = { cursor: 'pointer' };

const Photo = ({ index, onClick, photo, margin, direction, top, left, key }) => {
const imgStyle = { margin: margin, display: 'block' };
if (direction === 'column') {
imgStyle.position = 'absolute';
imgStyle.left = left;
imgStyle.top = top;
}

const handleClick = event => {
onClick(event, { photo, index });
Expand All @@ -19,7 +11,6 @@ const Photo = ({ index, onClick, photo, margin, direction, top, left, key }) =>
return (
<Image
key={key}
style={onClick ? { ...imgStyle, ...imgWithClick } : imgStyle}
{...photo}
onClick={onClick ? handleClick : null}
quality={100}
Expand Down
Loading