first commit

This commit is contained in:
Mateusz Gruszczyński 2025-03-07 18:28:29 +01:00
parent 7facd84b99
commit 2242bf1142
4 changed files with 44 additions and 2 deletions

View File

@ -0,0 +1,14 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<link rel="icon" href="%PUBLIC_URL%/favicon.ico" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="theme-color" content="#000000" />
<title>Donation Frontend</title>
</head>
<body>
<noscript>You need to enable JavaScript to run this app.</noscript>
<div id="root"></div>
</body>
</html>

View File

@ -10,10 +10,11 @@ function Login() {
const handleLogin = (e) => {
e.preventDefault();
console.log('Wysyłane dane logowania:', { login, password });
fetch('http://localhost:4000/api/login', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify({ login, password }),
body: JSON.stringify({ login: login.trim(), password: password.trim() }),
})
.then((res) => {
if (!res.ok) throw new Error('Błąd logowania');

View File

@ -0,0 +1,16 @@
import React from 'react';
import './App.css';
function ProgressBar({ value, max }) {
const percentage = max ? Math.min((value / max) * 100, 100) : 0;
return (
<div className="progress-container">
<div className="progress-bar" style={{ width: `${percentage}%` }}>
{Math.round(percentage)}%
</div>
</div>
);
}
export default ProgressBar;

11
frontend/src/index.js Normal file
View File

@ -0,0 +1,11 @@
import React from 'react';
import ReactDOM from 'react-dom/client';
import App from './App';
import './App.css'; // lub możesz utworzyć osobny plik index.css
const root = ReactDOM.createRoot(document.getElementById('root'));
root.render(
<React.StrictMode>
<App />
</React.StrictMode>
);