Skip to content
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

Preview #1

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open

Preview #1

wants to merge 7 commits into from

Conversation

Dinu-Loredana
Copy link
Contributor

No description provided.

<button
type="button"
title="Next"
onClick={() => setShowPreviewModal(showPreviewModal - 1)}>
Copy link
Member

Choose a reason for hiding this comment

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

you will need some validation I think, to stop people clicking outside the range of history items. Try adding a 'hasNextItem' function and disable the next button if its false. then disable the previous button if the current index is 0

{leftIcon && (
<ChevronDoubleLeftIcon
aria-hidden="true"
className="absolute -mt-60 ml-10 h-8 w-8 text-stone-400 cursor-not-allowed"
Copy link
Member

Choose a reason for hiding this comment

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

something that is probably worth looking into is the ‘top, left, right, bottom’ attributes for css. They are used with absolute (and static/fixed/sticky) positioned elements rather than using margin

<ChevronDoubleRightIcon
aria-hidden="true"
className="absolute -mt-60 h-8 w-8 text-stone-400 cursor-not-allowed"
style={{ marginLeft: '50rem' }}
Copy link
Member

Choose a reason for hiding this comment

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

generally, if you find yourself reaching for margin of more than 2 or 3 em you should look for a different way to do it. Also with tailwind you shouldn't use 'style' unless you really need to, because its less efficient

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