Skip to content

Commit

Permalink
[core] Disable prefetch of footer links
Browse files Browse the repository at this point in the history
This is unecessary, no need to waste bandwidth with prefetch on viewport.
  • Loading branch information
oliviertassinari committed Dec 31, 2022
1 parent d6a6c96 commit 6205492
Showing 1 changed file with 7 additions and 15 deletions.
22 changes: 7 additions & 15 deletions docs/src/modules/components/AppLayoutDocsFooter.js
Original file line number Diff line number Diff line change
Expand Up @@ -22,12 +22,6 @@ import PageContext from 'docs/src/modules/components/PageContext';
import Link from 'docs/src/modules/components/Link';
import { useUserLanguage, useTranslate } from 'docs/src/modules/utils/i18n';

const Footer = styled('footer')(({ theme }) => {
return {
marginTop: theme.spacing(12),
};
});

const PaginationDiv = styled('div')(({ theme }) => {
return {
margin: theme.spacing(3, 0, 4),
Expand All @@ -39,13 +33,9 @@ const PaginationDiv = styled('div')(({ theme }) => {
};
});

const PageLinkButton = styled(Button)(({ theme }) => {
return {
textTransform: 'none',
fontWeight: 500,
color: theme.palette.mode === 'dark' ? theme.palette.primary[300] : theme.palette.primary[500],
};
});
const PageLinkButton = styled(Button)(({ theme }) => ({
fontWeight: theme.typography.fontWeightMedium,
}));

const FeedbackGrid = styled(Grid)(({ theme }) => {
return {
Expand Down Expand Up @@ -382,7 +372,7 @@ export default function AppLayoutDocsFooter(props) {

return (
<React.Fragment>
<Footer>
<Box component="footer" sx={{ mt: 12 }}>
{hidePagePagination ? null : (
<React.Fragment>
<Divider />
Expand All @@ -391,6 +381,7 @@ export default function AppLayoutDocsFooter(props) {
<PageLinkButton
component={Link}
noLinkStyle
prefetch={false}
href={prevPage.pathname}
{...prevPage.linkProps}
size="medium"
Expand Down Expand Up @@ -434,6 +425,7 @@ export default function AppLayoutDocsFooter(props) {
<PageLinkButton
component={Link}
noLinkStyle
prefetch={false}
href={nextPage.pathname}
{...nextPage.linkProps}
size="medium"
Expand Down Expand Up @@ -511,7 +503,7 @@ export default function AppLayoutDocsFooter(props) {
</Box>
</form>
</Collapse>
</Footer>
</Box>
<Snackbar
open={snackbarOpen}
autoHideDuration={3000}
Expand Down

0 comments on commit 6205492

Please sign in to comment.