Skip to content

Commit

Permalink
move footer to home page
Browse files Browse the repository at this point in the history
  • Loading branch information
ibastawisi committed Aug 7, 2024
1 parent 570a7bc commit 908a971
Show file tree
Hide file tree
Showing 6 changed files with 7 additions and 15 deletions.
8 changes: 0 additions & 8 deletions src/app/globals.css
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,6 @@ header {
background-color: #fff;
}

footer {
z-index: 1000;
}

.splash-screen {
position: fixed;
inset: 0;
Expand Down Expand Up @@ -129,10 +125,6 @@ body:has(#app-toolbar) .editor-container [id] {
scroll-margin-top: calc(56px + 1rem);
}

body:has(.editor-input)>footer {
visibility: hidden;
}

.editor-container:has(.editor-input) {
display: flex;
flex-direction: column;
Expand Down
2 changes: 1 addition & 1 deletion src/components/Documents.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ const DocumentsGrid: React.FC<{ documents: UserDocument[], user?: User, initiali
const handlePageChange = (_: any, value: number) => dispatch(actions.setPage(value));
const pageDocuments = documents.slice((page - 1) * pageSize, page * pageSize);

return <Grid container spacing={2}>
return <Grid container spacing={2} sx={{ mb: 2 }}>
{showSkeletons && Array.from({ length: 6 }).map((_, i) => <Grid item key={i} xs={12} sm={6} md={4}><DocumentCard /></Grid>)}
{showEmpty && <Grid item xs={12} sx={{ display: 'flex', flexDirection: "column", alignItems: "center", my: 5, gap: 2 }}>
<Pageview sx={{ width: 64, height: 64, fontSize: 64 }} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Cached } from '@mui/icons-material';
import packageJson from '../../../package.json';
import packageJson from '../../package.json';
import { Box, Typography, Link, IconButton } from '@mui/material';
import RouterLink from "next/link";

Expand All @@ -8,7 +8,7 @@ const Footer: React.FC = () => {
const commitHash: string | undefined = process.env.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA;
const href = `https://github.com/ibastawisi/matheditor${commitHash ? '/commit/' + commitHash.substring(0, 7) : '/'}`;
return (
<Box component="footer" sx={{ display: "flex", displayPrint: "none", mt: "auto", p: 1, gap: 1 }}>
<Box component="footer" sx={{ display: "flex", displayPrint: "none", mt: "auto", gap: 1, zIndex: 1000 }}>
<Typography variant="button" component={Link} href={href} target="_blank" sx={{ textDecoration: "none", display: "flex", alignItems: "center" }}>
v{version} {commitHash?.substring(0, 7)}
</Typography>
Expand Down
2 changes: 2 additions & 0 deletions src/components/Home.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import useLocalStorage from "../hooks/useLocalStorage";
import Documents from "./Documents";
import { Button, Dialog, DialogActions, DialogContent, DialogContentText, DialogTitle } from '@mui/material';
import { UserDocument } from '@/types';
import Footer from './Footer';


const Home: React.FC<{ staticDocuments: UserDocument[] }> = ({ staticDocuments }) => {
Expand Down Expand Up @@ -34,6 +35,7 @@ const Home: React.FC<{ staticDocuments: UserDocument[] }> = ({ staticDocuments }
</DialogActions>
</Dialog>
)}
<Footer />
</>
);
};
Expand Down
2 changes: 0 additions & 2 deletions src/components/Layout/AppLayout.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import AlertDialog from "./Alert";
import Announcer from "./Announcer";
import PwaUpdater from "./PwaUpdater";
import ProgressBar from "./ProgressBar";
import Footer from "./Footer";
import { Container } from "@mui/material";
import { Suspense } from "react";

Expand All @@ -16,7 +15,6 @@ const AppLayout = ({ children }: { children: React.ReactNode; }) => {
<StoreProvider>
<TopAppBar />
<Container className='editor-container'>{children}</Container>
<Footer />
<AlertDialog />
<Announcer />
<PwaUpdater />
Expand Down
4 changes: 2 additions & 2 deletions src/components/User/UserDocuments.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const UserDocuments: React.FC<{ documents?: UserDocument[] }> = ({ documents })
const sortedDocuments = sortDocuments(documents ?? [], sort);
const pageDocuments = sortedDocuments.slice((page - 1) * pageSize, page * pageSize);

return <>
return (
<Box sx={{ mt: 2 }}>
<Box sx={{ display: "flex", flexWrap: "wrap", justifyContent: 'space-between', alignItems: "center", gap: 1, mb: 1, minHeight: 40 }}>
<Typography variant="h6" component="h2" sx={{ whiteSpace: 'nowrap', overflow: 'hidden', textOverflow: 'ellipsis' }}>Published Documents</Typography>
Expand All @@ -34,7 +34,7 @@ const UserDocuments: React.FC<{ documents?: UserDocument[] }> = ({ documents })
<Typography variant="overline" component="p">No documents found</Typography>
</Box>}
</Box>
</>
);
}

export default UserDocuments;

0 comments on commit 908a971

Please sign in to comment.