mirror of
https://github.com/dat515-2025/Group-8.git
synced 2026-03-22 15:12:08 +01:00
fix(frontend): fixed exchange rates and app name
This commit is contained in:
@@ -1,2 +1,5 @@
|
|||||||
export const BACKEND_URL: string =
|
export const BACKEND_URL: string =
|
||||||
import.meta.env.VITE_BACKEND_URL ?? '';
|
import.meta.env.VITE_BACKEND_URL ?? '';
|
||||||
|
|
||||||
|
export const VITE_UNIRATE_API_KEY: string =
|
||||||
|
import.meta.env.VITE_UNIRATE_API_KEY ?? 'wYXMiA0bz8AVRHtiS9hbKIr4VP3k5Qff8XnQdKQM45YM3IwFWP6y73r3KMkv1590';
|
||||||
|
|||||||
@@ -6,7 +6,7 @@ import BalanceChart from './BalanceChart';
|
|||||||
import ManualManagement from './ManualManagement';
|
import ManualManagement from './ManualManagement';
|
||||||
import CategoryPieChart from './CategoryPieChart';
|
import CategoryPieChart from './CategoryPieChart';
|
||||||
import MockBankModal, { type MockGenerationOptions } from './MockBankModal';
|
import MockBankModal, { type MockGenerationOptions } from './MockBankModal';
|
||||||
import { BACKEND_URL } from '../config';
|
import { BACKEND_URL, VITE_UNIRATE_API_KEY } from '../config';
|
||||||
|
|
||||||
function formatAmount(n: number) {
|
function formatAmount(n: number) {
|
||||||
return new Intl.NumberFormat(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(n);
|
return new Intl.NumberFormat(undefined, { minimumFractionDigits: 2, maximumFractionDigits: 2 }).format(n);
|
||||||
@@ -45,7 +45,7 @@ function CurrencyRates() {
|
|||||||
setLoading(true);
|
setLoading(true);
|
||||||
setError(null);
|
setError(null);
|
||||||
|
|
||||||
const API_KEY = import.meta.env.VITE_UNIRATE_API_KEY;
|
const API_KEY = VITE_UNIRATE_API_KEY;
|
||||||
|
|
||||||
// We need to get the CZK rate as well, to use it for conversion
|
// We need to get the CZK rate as well, to use it for conversion
|
||||||
const allSymbols = [...TARGET_CURRENCIES, 'CZK'].join(',');
|
const allSymbols = [...TARGET_CURRENCIES, 'CZK'].join(',');
|
||||||
@@ -355,7 +355,7 @@ export default function Dashboard({ onLogout }: { onLogout: () => void }) {
|
|||||||
<div className={`app-layout ${sidebarOpen ? 'sidebar-open' : ''}`}>
|
<div className={`app-layout ${sidebarOpen ? 'sidebar-open' : ''}`}>
|
||||||
<aside className="sidebar" style={{ display: 'flex', flexDirection: 'column' }}>
|
<aside className="sidebar" style={{ display: 'flex', flexDirection: 'column' }}>
|
||||||
<div>
|
<div>
|
||||||
<div className="logo">7Project</div>
|
<div className="logo">Finance Tracker</div>
|
||||||
<nav className="nav" onClick={() => setSidebarOpen(false)}>
|
<nav className="nav" onClick={() => setSidebarOpen(false)}>
|
||||||
<button className={current === 'home' ? 'active' : ''} onClick={() => setCurrent('home')}>Home</button>
|
<button className={current === 'home' ? 'active' : ''} onClick={() => setCurrent('home')}>Home</button>
|
||||||
<button className={current === 'manual' ? 'active' : ''} onClick={() => setCurrent('manual')}>Manual management</button>
|
<button className={current === 'manual' ? 'active' : ''} onClick={() => setCurrent('manual')}>Manual management</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user