resolve issues with new features

This commit is contained in:
Matthias Hochmeister
2026-03-12 18:09:59 +01:00
parent dc33d388a9
commit d1fed74f3b
7 changed files with 69 additions and 55 deletions

View File

@@ -7,7 +7,6 @@ import {
InputAdornment,
Chip,
Avatar,
Fab,
Tooltip,
Alert,
CircularProgress,
@@ -33,7 +32,7 @@ import {
} from '@mui/icons-material';
import { useNavigate } from 'react-router-dom';
import DashboardLayout from '../components/dashboard/DashboardLayout';
import { useLayout } from '../contexts/LayoutContext';
import ChatAwareFab from '../components/shared/ChatAwareFab';
import { useAuth } from '../contexts/AuthContext';
import { membersService } from '../services/members';
import {
@@ -74,8 +73,7 @@ function useDebounce<T>(value: T, delay: number): T {
// ----------------------------------------------------------------
function Mitglieder() {
const navigate = useNavigate();
const { user } = useAuth();
const { chatPanelOpen } = useLayout(); const canWrite = useCanWrite();
const { user } = useAuth(); const canWrite = useCanWrite();
// --- redirect non-admin/non-kommando users to their own profile ---
useEffect(() => {
@@ -428,20 +426,13 @@ function Mitglieder() {
{/* FAB — only visible to Kommandant/Admin */}
{canWrite && (
<Tooltip title="Neues Mitglied anlegen">
<Fab
color="primary"
<ChatAwareFab
aria-label="Neues Mitglied anlegen"
onClick={() => navigate('/mitglieder/neu')}
sx={{
position: 'fixed',
bottom: 32,
right: chatPanelOpen ? 376 : 80,
transition: 'right 225ms cubic-bezier(0.4, 0, 0.6, 1)',
zIndex: (theme) => theme.zIndex.speedDial,
}}
sx={{ zIndex: (theme) => theme.zIndex.speedDial }}
>
<AddIcon />
</Fab>
</ChatAwareFab>
</Tooltip>
)}
</DashboardLayout>