From 4a420da4520727ed47bc34387d9cc455d34fcdb5 Mon Sep 17 00:00:00 2001 From: Sajad Mirjalili Date: Mon, 29 Sep 2025 13:47:45 +0330 Subject: [PATCH] fix: account active sessions styles --- .../profile/routes/ActiveDevicesPage.tsx | 145 +++++++----------- 1 file changed, 58 insertions(+), 87 deletions(-) diff --git a/src/features/profile/routes/ActiveDevicesPage.tsx b/src/features/profile/routes/ActiveDevicesPage.tsx index b5fc335..037f2d8 100644 --- a/src/features/profile/routes/ActiveDevicesPage.tsx +++ b/src/features/profile/routes/ActiveDevicesPage.tsx @@ -1,11 +1,10 @@ -import React, { useState, useEffect } from 'react'; +import { useState, useEffect } from 'react'; import { Box, Typography, Button, - useTheme, - useMediaQuery, CircularProgress, + Stack, } from '@mui/material'; import { useTranslation } from 'react-i18next'; import { DeviceMessage, Logout } from 'iconsax-react'; @@ -24,8 +23,6 @@ export function ActiveDevicesPage() { const { t, i18n } = useTranslation('setting'); const [devices, setDevices] = useState([]); const [loadingDeleteIds, setLoadingDeleteIds] = useState([]); - const theme = useTheme(); - const isXsup = useMediaQuery(theme.breakpoints.up('xs')); const showToast = useToast(); const { isLoadingProfile, refetchProfile } = useProfile(); @@ -132,7 +129,9 @@ export function ActiveDevicesPage() { flexGrow: 0, width: 'auto', }} - disabled={isLoadingProfile || isTerminating} + disabled={ + isLoadingProfile || isTerminating || devices.length === 1 + } > {isTerminating ? t('active.deleting') @@ -158,20 +157,23 @@ export function ActiveDevicesPage() { sx={{ mx: { xs: 2, sm: 3, md: 4 }, py: 2, - display: 'flex', - flexDirection: 'column', - gap: 2, bgcolor: 'background.paper', }} > {devices.map((device) => ( - + @@ -217,85 +219,54 @@ export function ActiveDevicesPage() { > {device.ip} - - - {device.current && ( - - )} - - - - - - {isXsup && ( - + {device.current && ( + )} - + + {!device.current && ( + + )} + ))} )}