-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8439c72
commit 367af21
Showing
10 changed files
with
127 additions
and
48 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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
import { | ||
Modal, | ||
ModalCloseButton, | ||
ModalContent, | ||
ModalHeader, | ||
useDisclosure, | ||
} from "@chakra-ui/react"; | ||
import { downloadBackupFile } from "@umami/state"; | ||
|
||
import { MasterPassword } from "../components/Onboarding/masterPassword/MasterPassword"; | ||
|
||
export const useSaveBackup = () => { | ||
const { isOpen, onClose, onOpen } = useDisclosure(); | ||
|
||
return { | ||
content: ( | ||
<Modal | ||
autoFocus={false} | ||
closeOnOverlayClick={false} | ||
isCentered | ||
isOpen={isOpen} | ||
onClose={onClose} | ||
> | ||
<ModalContent> | ||
<ModalHeader> | ||
<ModalCloseButton /> | ||
</ModalHeader> | ||
<MasterPassword | ||
onClose={onClose} | ||
onVerify={password => downloadBackupFile(password).then(onClose)} | ||
/> | ||
</ModalContent> | ||
</Modal> | ||
), | ||
onOpen, | ||
}; | ||
}; |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
import { useDynamicModalContext } from "@umami/components"; | ||
|
||
import { SetupPassword } from "../Onboarding/SetupPassword"; | ||
|
||
export const useSaveBackup = () => { | ||
const { openWith } = useDynamicModalContext(); | ||
|
||
return () => openWith(<SetupPassword mode="save_backup" />); | ||
}; |
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
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
367af21
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.