-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[#179] enables loading local backup via drag and drop
- Loading branch information
1 parent
a9d29c8
commit 3416796
Showing
15 changed files
with
325 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
6.3.0 | ||
6.4.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18 changes: 18 additions & 0 deletions
18
src/client/backup/local/StopDefaultDragAndDropBehaviourHook.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import {useEffect} from 'react' | ||
|
||
/** This stops the browser allowing files to be dropped anywhere in the window to open them */ | ||
export function useStopDefaultDragAndDropBehaviour(): void { | ||
useEffect(() => { | ||
const listener = (evt: DragEvent) => { | ||
evt.preventDefault() | ||
} | ||
|
||
window.addEventListener('dragover', listener) | ||
window.addEventListener('drop', listener) | ||
|
||
return () => { | ||
window.removeEventListener('dragover', listener) | ||
window.removeEventListener('drop', listener) | ||
} | ||
}, []) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
@import '../../common/layout'; | ||
@import './local-backup'; | ||
|
||
.saveFile, | ||
.copy { | ||
@extend %blocking; | ||
|
||
@include respond-to(tablet, desktop) { | ||
width: $button-size; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,42 @@ | ||
@import '../../common/layout'; | ||
@import '../../common/variables'; | ||
@import '../../common/accessibility'; | ||
@import '../../common/forms/button'; | ||
@import '../../common/fonts/icon-font.scss'; | ||
@import './local-backup'; | ||
|
||
.import { | ||
@extend %blocking; | ||
|
||
@include respond-to(tablet, desktop) { | ||
width: $button-size; | ||
} | ||
} | ||
|
||
.openFile { | ||
@include interactive(); | ||
|
||
@extend .secondary; | ||
@extend .icon-folder-open; | ||
|
||
box-shadow: $shadow; | ||
cursor: pointer; | ||
transition: box-shadow 0.1s ease-in; | ||
|
||
&::before { | ||
margin-right: 0.5em; | ||
} | ||
|
||
@include respond-to(tablet, desktop) { | ||
margin: $margin-top 0 0 0; | ||
width: $button-size; | ||
} | ||
} | ||
|
||
.openFileInput { | ||
@extend %visually-hidden; | ||
|
||
&:focus + label { | ||
@include focus(); | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,7 @@ | ||
@import '../../common/responsive'; | ||
|
||
$button-size: 220px; | ||
|
||
.container { | ||
column-gap: 1em; | ||
display: grid; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.