Skip to content

Commit

Permalink
perf(LandingLayout): remove React spring in landing page
Browse files Browse the repository at this point in the history
  • Loading branch information
sabertazimi committed Aug 10, 2021
1 parent 51e88d8 commit 8de6dfa
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions src/layouts/LandingLayout.tsx
Original file line number Diff line number Diff line change
@@ -1,33 +1,25 @@
import landingImage from '@images/landing.jpg';
import classNames from 'classnames';
import React, { ReactNode } from 'react';
import { animated, useSpring } from 'react-spring';

interface Props {
children: ReactNode;
}

const LandingLayout = ({ children }: Props): JSX.Element => {
const props = useSpring({
from: { opacity: 0, transform: 'translateY(-200px)' },
to: { opacity: 1, transform: 'translateY(0)' },
delay: 500,
});

return (
<animated.div
<div
className={classNames(
'flex-col w-full h-screen p-0 m-0 overflow-x-hidden overflow-y-auto',
'bg-center bg-no-repeat bg-cover text-light ',
'flex-container'
)}
style={{
...props,
backgroundImage: `url("${landingImage}")`,
}}
>
{children}
</animated.div>
</div>
);
};

Expand Down

0 comments on commit 8de6dfa

Please sign in to comment.