Skip to content

Commit

Permalink
[Pwa] Adjust layout and margins. Fix initial data load trigger.
Browse files Browse the repository at this point in the history
  • Loading branch information
cvanem committed Nov 20, 2024
1 parent e1f4da7 commit f4fc94f
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/components/pwa/Pwa.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ export default function Pwa() {
<Grid item xs={12} sx={{ textAlign: 'center', fontSize: 32, color: 'primary.dark' }}>
{label}
</Grid>
<Grid item xs={12}>
<Grid item xs={12} sx={{ mt: 0.5 }}>
<Field onChange={onChange(index)} onNext={handleNext} options={options} value={value} />
</Grid>
</Grid>
Expand Down
4 changes: 1 addition & 3 deletions src/components/pwa/PwaApps.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,7 @@ export default function PwaApps() {
const { tablefooterheight } = layout;
//const tableHeight = height - headerHeight + tablefooterheight + 2 - 40;
const tableHeight = height - appBarHeight + tablefooterheight - headerHeight + 32;
const { filtered } = useAppTableData(); // Trigger data query

console.log({ headerHeight, appBarHeight, tablefooterheight, tableHeight });
const { filtered } = useAppTableData({ trigger: false }); // Don't re-trigger here as it causes a refresh

return <Tables.PwaApplicationsGrid data={filtered} height={tableHeight} />;
}
4 changes: 3 additions & 1 deletion src/components/pwa/PwaLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import createStyles from '@mui/styles/createStyles';
import { useAppBarHeight, useFooterHeight } from '../layout/hooks';
import ScrollElementProvider from '../layout/ScrollElementProvider';
import useHeight from '../layout/ViewPort/hooks/useHeight';
import useAppTableData from '../pages/useAppTableData';

const useStyles = makeStyles(({ breakpoints, palette }: any) =>
createStyles({
Expand Down Expand Up @@ -35,11 +36,12 @@ export function PwaLayout({ children }) {
const [appBarHeight] = useAppBarHeight();
const [footerHeight] = useFooterHeight();
const componentsOnPage = [appBarHeight, footerHeight];
const minHeight = height - appBarHeight - footerHeight - 1;
var contentHeight = height - componentsOnPage.reduce((t, c) => t + c, 0);

var [scrollElement, setScrollElement] = React.useState(null);

useAppTableData({ trigger: true });

const classes = useStyles({
leftDrawerOpen: false,
fullHeight: true,
Expand Down

0 comments on commit f4fc94f

Please sign in to comment.