but device data in scrollable body

This commit is contained in:
Proddy
2023-04-29 16:26:20 +02:00
parent 6f681aa451
commit 5fe9049537

View File

@@ -11,7 +11,6 @@ import StarIcon from '@mui/icons-material/Star';
import UnfoldMoreOutlinedIcon from '@mui/icons-material/UnfoldMoreOutlined'; import UnfoldMoreOutlinedIcon from '@mui/icons-material/UnfoldMoreOutlined';
import { import {
Button, Button,
Typography,
Dialog, Dialog,
DialogTitle, DialogTitle,
DialogContent, DialogContent,
@@ -21,7 +20,8 @@ import {
ListItem, ListItem,
ListItemText, ListItemText,
FormControlLabel, FormControlLabel,
Checkbox Checkbox,
Box
} from '@mui/material'; } from '@mui/material';
import { useRowSelect } from '@table-library/react-table-library/select'; import { useRowSelect } from '@table-library/react-table-library/select';
import { useSort, SortToggleType } from '@table-library/react-table-library/sort'; import { useSort, SortToggleType } from '@table-library/react-table-library/sort';
@@ -47,6 +47,9 @@ import { AuthenticatedContext } from 'contexts/authentication';
import { useI18nContext } from 'i18n/i18n-react'; import { useI18nContext } from 'i18n/i18n-react';
import { extractErrorMessage } from 'utils'; import { extractErrorMessage } from 'utils';
const topOffset = () => document.getElementById('devices-window')?.getBoundingClientRect().bottom || 0;
const leftOffset = () => document.getElementById('devices-window')?.getBoundingClientRect().left || 0;
const DashboardDevices: FC = () => { const DashboardDevices: FC = () => {
const { me } = useContext(AuthenticatedContext); const { me } = useContext(AuthenticatedContext);
const { LL } = useI18nContext(); const { LL } = useI18nContext();
@@ -416,10 +419,18 @@ const DashboardDevices: FC = () => {
); );
return ( return (
<> <Box
<Typography sx={{ pt: 2, pb: 1 }} variant="h6" color="secondary"> sx={{
{deviceData.label} backgroundColor: 'black',
</Typography> overflowY: 'scroll',
position: 'absolute',
right: 18,
bottom: 18,
left: () => leftOffset(),
top: () => topOffset(),
p: 1
}}
>
<FormControlLabel <FormControlLabel
control={<Checkbox size="small" name="onlyFav" checked={onlyFav} onChange={() => setOnlyFav(!onlyFav)} />} control={<Checkbox size="small" name="onlyFav" checked={onlyFav} onChange={() => setOnlyFav(!onlyFav)} />}
label={ label={
@@ -488,12 +499,12 @@ const DashboardDevices: FC = () => {
</> </>
)} )}
</Table> </Table>
</> </Box>
); );
}; };
return ( return (
<SectionContent title={LL.DEVICE_DATA()} titleGutter> <SectionContent title={LL.DEVICE_DATA()} titleGutter id="devices-window">
{renderCoreData()} {renderCoreData()}
{renderDeviceData()} {renderDeviceData()}
{renderDeviceDetails()} {renderDeviceDetails()}