diff --git a/frontend/src/pages/Dashboard.tsx b/frontend/src/pages/Dashboard.tsx index ddb0b96..65726a9 100644 --- a/frontend/src/pages/Dashboard.tsx +++ b/frontend/src/pages/Dashboard.tsx @@ -6,7 +6,7 @@ import { DialogActions, CircularProgress, Paper, Chip, Table, TableBody, TableCell, TableContainer, TableHead, TableRow, Switch, FormControlLabel, Divider, List, ListItem, ListItemText, ListItemSecondaryAction, - Tabs, Tab, Select, MenuItem, FormControl, InputLabel + Select, MenuItem, FormControl, InputLabel } from '@mui/material'; import SearchIcon from '@mui/icons-material/Search'; import AddIcon from '@mui/icons-material/Add'; @@ -20,7 +20,6 @@ import LockResetIcon from '@mui/icons-material/LockReset'; import SettingsIcon from '@mui/icons-material/Settings'; import ShareIcon from '@mui/icons-material/Share'; import GroupAddIcon from '@mui/icons-material/GroupAdd'; -import PublicIcon from '@mui/icons-material/Public'; import ShieldIcon from '@mui/icons-material/Shield'; import GppBadIcon from '@mui/icons-material/GppBad'; import PeopleIcon from '@mui/icons-material/People'; @@ -34,9 +33,8 @@ import NebulaBanner from '../components/NebulaBanner'; const Dashboard: React.FC = () => { const { currentTheme, setTheme } = useAppTheme(); const { - accounts, isLoading, isSyncing, serverConfig, addAccount, deleteAccount, - switchAccount, openSteamLogin, updateServerConfig, loginToServer, - getCommunityAccounts, syncNow + accounts, isLoading, isSyncing, serverConfig, deleteAccount, + switchAccount, openSteamLogin, updateServerConfig, loginToServer, syncNow } = useAccounts(); const [searchTerm, setSearchTerm] = useState(''); @@ -159,6 +157,98 @@ const Dashboard: React.FC = () => { {/* Settings Dialog */} + setIsSettingsOpen(false)} maxWidth="sm" fullWidth> + Settings & Customization + + THEME SELECTION + + Active Theme + + + + + + BACKEND CONFIGURATION + setServerUrl(e.target.value)} + placeholder="https://ultimate-ban-tracker.narl.io" + margin="dense" + sx={{ mb: 2 }} + InputProps={{ + endAdornment: ( + + + + ), + }} + /> + + + + COMMUNITY AUTHENTICATION + + + + {serverConfig?.token ? "Connected to Server" : "Not Authenticated"} + + + {serverConfig?.token ? "Your accounts can now be shared with others." : "Login to share and sync with your community."} + + + + {serverConfig?.token && ( + + )} + + + + + updateServerConfig({ enabled: e.target.checked })} + disabled={!serverConfig?.token} + /> + } + label="Enable Community Sync" + sx={{ mt: 2 }} + /> + + + + + + + ); +}; // --- Sub-Component: AccountRow --- @@ -204,7 +294,8 @@ const AccountRow: React.FC<{ (window as any).electronAPI.getServerUserInfo() ]); const filtered = (Array.isArray(users) ? users : []).filter(u => - u.steamId !== selfInfo.steamId && u.steamId !== account.steamId + u.steamId !== selfInfo.steamId && + u.steamId !== account.steamId ); setServerUsers(filtered); } catch (e) {} @@ -237,9 +328,7 @@ const AccountRow: React.FC<{ // Primary account check const isPrimaryAccount = serverConfig?.serverSteamId === account.steamId; - // Refined Shared Logic: - // 1. It was shared WITH you (starts with shared_) - // 2. OR you are the owner but you have shared it with at least one person + // Refined Shared Logic const isSharedWithYou = account?._id.startsWith('shared_'); const hasSharedMembers = (account as any).sharedWith && (account as any).sharedWith.length > 0; const showCommunityIcon = isSharedWithYou || hasSharedMembers;