Skip to content

Commit

Permalink
Preview Hotkeys work consistently (#1740)
Browse files Browse the repository at this point in the history
* Add dependencies to hook

* fix lint
  • Loading branch information
FSM1 authored Nov 16, 2021
1 parent 3e86cfe commit 5b3a1e1
Showing 1 changed file with 5 additions and 5 deletions.
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])

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

0 comments on commit 5b3a1e1

Please sign in to comment.