Skip to content

Commit

Permalink
fix(trackers): fix bottom margin for speed dial button
Browse files Browse the repository at this point in the history
  • Loading branch information
Clm-Roig committed Oct 3, 2022
1 parent 762d246 commit b4ecd5d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/components/DefaultPageLayout/DefaultPageLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { Box, BoxProps } from '@mui/material';
import { motion } from 'framer-motion';
import { FC } from 'react';

Expand All @@ -18,15 +19,16 @@ const pageAnimation = {
}
};

interface AnimatedPageProps {
interface DefaultPageLayoutProps {
children: React.ReactNode;
}
const AnimatedPage: FC<AnimatedPageProps> = ({ children }) => {
const DefaultPageLayout: FC<DefaultPageLayoutProps & BoxProps> = (props) => {
const { children, ...boxProps } = props;
return (
<motion.div initial="initial" animate="animate" exit="exit" variants={pageAnimation}>
{children}
<Box {...boxProps}>{children}</Box>
</motion.div>
);
};

export default AnimatedPage;
export default DefaultPageLayout;
7 changes: 4 additions & 3 deletions src/pages/Trackers/Trackers.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,8 @@ function Trackers() {

return (
<>
<DefaultPageLayout>
{/* Add a little margin to avoid the speed dial button to overlap the last tracker card */}
<DefaultPageLayout sx={{ mb: 10 }}>
<DateSelector date={selectedDate} setDate={handleSetDate} />

{doneTrackers.length + hiddenTrackers.length + todoTrackers.length === 0 && (
Expand Down Expand Up @@ -120,9 +121,9 @@ function Trackers() {
)}
</DefaultPageLayout>
<SpeedDial
direction="down"
direction="up"
ariaLabel="SuiVie SpeedDial menu"
sx={{ position: 'fixed', top: 16 + 64, right: 16 }}
sx={{ position: 'fixed', bottom: 16, right: 16 }}
icon={<SpeedDialIcon icon={<MoreVertIcon />} openIcon={<CloseIcon />} />}>
{actions.map((action) => (
<SpeedDialAction
Expand Down

0 comments on commit b4ecd5d

Please sign in to comment.