diff --git a/frontend/src/App.css b/frontend/src/App.css index 1195051..e8a1386 100644 --- a/frontend/src/App.css +++ b/frontend/src/App.css @@ -41,6 +41,13 @@ button { margin-top: 20px; } +.container { + display: flex; + justify-content: space-between; + align-items: center; + width: 100%; +} + @keyframes App-logo-spin { from { transform: rotate(0deg); diff --git a/frontend/src/components/MainComponent.js b/frontend/src/components/MainComponent.js index d0ec8b4..38c3d67 100644 --- a/frontend/src/components/MainComponent.js +++ b/frontend/src/components/MainComponent.js @@ -1,9 +1,22 @@ -import React, { useState } from 'react'; +import React, { useState, useRef } from 'react'; const TextAreaComponent = () => { const [textAreaValue, setTextAreaValue] = useState(''); const [password, setPassword] = useState(''); + const fileInputRef = useRef(null); + + const handleFileUpload = (event) => { + const file = event.target.files[0]; + if (file) { + console.log('Selected file:', file); + } + }; + + const openFileDialog = () => { + fileInputRef.current.click(); + }; + const handleSave = () => { window.api.filesSave({ password: password, content: textAreaValue }) .then(() => alert('Text saved successfully')) @@ -17,14 +30,25 @@ const TextAreaComponent = () => { return (