From 3db21e7e95b3f5379e300a8b31f318c39e7a791f Mon Sep 17 00:00:00 2001 From: Sanster Date: Mon, 7 Feb 2022 22:25:24 +0800 Subject: [PATCH] add keyboard shortcuts --- lama_cleaner/app/src/App.tsx | 7 ++- lama_cleaner/app/src/components/Button.tsx | 8 +++- lama_cleaner/app/src/components/Modal.tsx | 35 ++++++++++++-- .../app/src/components/ShortcutsModal.tsx | 47 +++++++++++++++++++ 4 files changed, 91 insertions(+), 6 deletions(-) create mode 100644 lama_cleaner/app/src/components/ShortcutsModal.tsx diff --git a/lama_cleaner/app/src/App.tsx b/lama_cleaner/app/src/App.tsx index 2f269e0..162bfc3 100644 --- a/lama_cleaner/app/src/App.tsx +++ b/lama_cleaner/app/src/App.tsx @@ -1,12 +1,14 @@ import { ArrowLeftIcon } from '@heroicons/react/outline' import React, { useState } from 'react' -import { useWindowSize } from 'react-use' +import { useToggle, useWindowSize } from 'react-use' import Button from './components/Button' import FileSelect from './components/FileSelect' +import ShortcutsModal from './components/ShortcutsModal' import Editor from './Editor' function App() { const [file, setFile] = useState() + const [showShortcuts, toggleShowShortcuts] = useToggle(false) const windowSize = useWindowSize() return ( @@ -27,6 +29,7 @@ function App() { {file ? (