synor/apps/desktop-wallet/src/components/TitleBar.tsx
Gulshan Yadav 6b5a232a5e feat: Desktop wallet, gas estimator UI, and 30-day monitoring stack
Security (Desktop Wallet):
- Implement BIP39 mnemonic generation with cryptographic RNG
- Add Argon2id password-based key derivation (64MB, 3 iterations)
- Add ChaCha20-Poly1305 authenticated encryption for seed storage
- Add mnemonic auto-clear (60s timeout) and clipboard auto-clear (30s)
- Add sanitized error logging to prevent credential leaks
- Strengthen CSP with object-src, base-uri, form-action, frame-ancestors
- Clear sensitive state on component unmount

Explorer (Gas Estimator):
- Add Gas Estimation page with from/to/amount/data inputs
- Add bech32 address validation (synor1/tsynor1 prefix)
- Add BigInt-based amount parsing to avoid floating point errors
- Add production guard for mock mode (cannot enable in prod builds)

Monitoring (30-day Testnet):
- Add Prometheus config with 30-day retention
- Add comprehensive alert rules for node health, consensus, network, mempool
- Add Alertmanager with severity-based routing and inhibition rules
- Add Grafana with auto-provisioned datasource and dashboard
- Add Synor testnet dashboard with uptime SLA tracking

Docker:
- Update docker-compose.testnet.yml with monitoring profile
- Fix node-exporter for macOS Docker Desktop compatibility
- Change Grafana port to 3001 to avoid conflict
2026-01-10 04:38:09 +05:30

53 lines
1.7 KiB
TypeScript

import { getCurrentWindow } from '@tauri-apps/api/window';
import { Minus, Square, X } from 'lucide-react';
/**
* Custom title bar for frameless window mode.
* Provides drag region and window controls.
*/
export default function TitleBar() {
const appWindow = getCurrentWindow();
return (
<div
data-tauri-drag-region
className="h-8 flex items-center justify-between bg-gray-900 border-b border-gray-800 select-none"
>
{/* App title / drag region */}
<div
data-tauri-drag-region
className="flex-1 h-full flex items-center px-4"
>
<div className="flex items-center gap-2">
<div className="w-4 h-4 rounded bg-gradient-to-br from-synor-400 to-synor-600" />
<span className="text-xs font-medium text-gray-400">Synor Wallet</span>
</div>
</div>
{/* Window controls (Windows/Linux style) */}
<div className="flex items-center h-full">
<button
onClick={() => appWindow.minimize()}
className="h-full px-4 hover:bg-gray-800 text-gray-400 hover:text-white transition-colors"
aria-label="Minimize"
>
<Minus size={14} />
</button>
<button
onClick={() => appWindow.toggleMaximize()}
className="h-full px-4 hover:bg-gray-800 text-gray-400 hover:text-white transition-colors"
aria-label="Maximize"
>
<Square size={12} />
</button>
<button
onClick={() => appWindow.close()}
className="h-full px-4 hover:bg-red-600 text-gray-400 hover:text-white transition-colors"
aria-label="Close"
>
<X size={14} />
</button>
</div>
</div>
);
}