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 Hotkeys work consistently #1740

Merged
merged 3 commits into from
Nov 16, 2021
Merged
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
10 changes: 5 additions & 5 deletions packages/files-ui/src/Components/Modules/FilePreviewModal.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ const useStyles = makeStyles(
position: "absolute"
}
},
focusVisible:{
focusVisible: {
backgroundColor: "transparent !important"
},
menuWrapper: {
Expand All @@ -185,7 +185,7 @@ interface Props {
const FilePreviewModal = ({ file, nextFile, previousFile, closePreview, filePath }: Props) => {
const classes = useStyles()
const { downloadFile } = useFiles()
const [fileContent, setFileContent] = useState<Blob |undefined>()
const [fileContent, setFileContent] = useState<Blob | undefined>()
const { bucket } = useFileBrowser()
const { buckets } = useFiles()
const { desktop } = useThemeSwitcher()
Expand Down Expand Up @@ -241,11 +241,11 @@ const FilePreviewModal = ({ file, nextFile, previousFile, closePreview, filePath

useHotkeys("Left,ArrowLeft", () => {
previousFile && previousFile()
})
}, [previousFile])

useHotkeys("Right,ArrowRight", () => {
nextFile && nextFile()
})
}, [nextFile])
Copy link
Contributor

Choose a reason for hiding this comment

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

ffs 😂

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That was pretty much my attitude as well 😂


const handleDownload = useCallback(() => {
if (!name || !cid || !bucket) return
Expand Down Expand Up @@ -296,7 +296,7 @@ const FilePreviewModal = ({ file, nextFile, previousFile, closePreview, filePath
</Typography>
<Menu
testId='preview-kebab'
icon={<MoreIcon className={classes.dropdownIcon}/>}
icon={<MoreIcon className={classes.dropdownIcon} />}
options={menuItems}
style={{
focusVisible: classes.focusVisible,
Expand Down