mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-09 20:29:36 +02:00
Add styles to base page
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
import type { ReactNode } from 'react';
|
import type { ReactNode, Ref } from 'react';
|
||||||
|
import { forwardRef } from 'react';
|
||||||
import { motion } from 'framer-motion';
|
import { motion } from 'framer-motion';
|
||||||
import styled from 'styled-components';
|
import styled from 'styled-components';
|
||||||
|
|
||||||
@@ -7,8 +8,12 @@ interface AnimatedPageProps {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const StyledAnimatedPage = styled(motion.div)`
|
const StyledAnimatedPage = styled(motion.div)`
|
||||||
|
position: relative;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
width: 100%;
|
width: 100%;
|
||||||
height: 100%;
|
height: 100%;
|
||||||
|
overflow: hidden;
|
||||||
`;
|
`;
|
||||||
|
|
||||||
const variants = {
|
const variants = {
|
||||||
@@ -17,9 +22,11 @@ const variants = {
|
|||||||
initial: { opacity: 0 },
|
initial: { opacity: 0 },
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AnimatedPage = ({ children }: AnimatedPageProps) => {
|
export const AnimatedPage = forwardRef(
|
||||||
|
({ children }: AnimatedPageProps, ref: Ref<HTMLDivElement>) => {
|
||||||
return (
|
return (
|
||||||
<StyledAnimatedPage
|
<StyledAnimatedPage
|
||||||
|
ref={ref}
|
||||||
animate="animate"
|
animate="animate"
|
||||||
exit="exit"
|
exit="exit"
|
||||||
initial="initial"
|
initial="initial"
|
||||||
@@ -29,4 +36,5 @@ export const AnimatedPage = ({ children }: AnimatedPageProps) => {
|
|||||||
{children}
|
{children}
|
||||||
</StyledAnimatedPage>
|
</StyledAnimatedPage>
|
||||||
);
|
);
|
||||||
};
|
},
|
||||||
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user