diff --git a/components/cryptForm.js b/components/cryptForm.js index 9a52511..6ecee91 100644 --- a/components/cryptForm.js +++ b/components/cryptForm.js @@ -15,8 +15,11 @@ import { } from '@chakra-ui/react'; import { FaDownload, FaEdit } from 'react-icons/fa'; import { useRef, useState } from 'react'; +import dynamic from 'next/dynamic'; import crypto from 'crypto'; +const Editor = dynamic(() => import('./editor'), { ssr: false }); + function isGzip(data) { return data[0] == 0x1F && data[1] == 0x8B; } @@ -45,6 +48,7 @@ export default function CryptForm({ isEncryption, isLoading, setIsLoading, passw const [shouldGzip, setShouldGzip] = useState(false); const [isEncryptionWarning, setIsEncryptionWarning] = useState(false); const { isOpen, onOpen: _onOpen, onClose: _onClose } = useDisclosure(); + const { isOpen: isEditorOpen, onOpen: onEditorOpen, onClose: onEditorClose } = useDisclosure(); const onOpen = (encryption) => { if (encryption) @@ -113,7 +117,7 @@ export default function CryptForm({ isEncryption, isLoading, setIsLoading, passw
{!isEncryption && ( - + )} + + + + + ); +} diff --git a/components/footer.js b/components/footer.js new file mode 100644 index 0000000..2d739e3 --- /dev/null +++ b/components/footer.js @@ -0,0 +1,14 @@ +import { Box, Link, Text } from '@chakra-ui/react'; +import NextLink from 'next/link'; + +export default function Footer({ left }) { + const offset = left ? '10px' : '5px'; + + return ( + + Terms of Service + Privacy Policy + Made with by Alex Tușinean + + ); +} diff --git a/package.json b/package.json index 9af7e2c..546634d 100644 --- a/package.json +++ b/package.json @@ -15,6 +15,7 @@ "@emotion/styled": "11", "crypto-browserify": "^3.12.0", "framer-motion": "6", + "jsoneditor": "^10.1.0", "next": "13.0.7", "react": "18.2.0", "react-dom": "18.2.0", diff --git a/pages/_app.js b/pages/_app.js index f9488a3..9ce6678 100644 --- a/pages/_app.js +++ b/pages/_app.js @@ -1,5 +1,6 @@ import { ChakraProvider, Alert, AlertIcon, AlertTitle, AlertDescription, Link, Box } from '@chakra-ui/react'; import Head from 'next/head'; +import './editor.css'; export default function App({ Component, pageProps }) { return ( diff --git a/pages/editor.css b/pages/editor.css new file mode 100644 index 0000000..d915dea --- /dev/null +++ b/pages/editor.css @@ -0,0 +1,10 @@ +.jsoneditor-outer > .jsoneditor-tree { + overflow: scroll; + min-height: 70vh; + max-height: 70vh; +} + +.jsoneditor-search > div > input { + background-color: #fff; +} + diff --git a/pages/index.js b/pages/index.js index 9fa6668..c73b59f 100644 --- a/pages/index.js +++ b/pages/index.js @@ -24,6 +24,7 @@ import NextLink from 'next/link'; import Head from 'next/head'; import CryptForm from '../components/cryptForm'; +import Footer from '../components/footer'; import passwords from '../passwords'; export default function Home() { @@ -85,11 +86,7 @@ export default function Home() { - - Terms of Service - Privacy Policy - Made with by Alex Tușinean - +