Skip to content

Commit

Permalink
refactor(SLB-405): adjust framer-motion config
Browse files Browse the repository at this point in the history
  • Loading branch information
Luqmaan Essop committed Jun 5, 2024
1 parent 0257920 commit c881d78
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
9 changes: 2 additions & 7 deletions packages/ui/src/components/Molecules/FadeUp.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
'use client';
import clsx from 'clsx';
import { motion, useReducedMotion } from 'framer-motion';
import React, { PropsWithChildren } from 'react';

Expand All @@ -10,15 +9,11 @@ export function FadeUp({
}: PropsWithChildren<{ yGap: number; className?: string }>) {
const reducedMotion = useReducedMotion();

console.log('reducedMotion:', reducedMotion);
return (
<motion.div
className={clsx(
className,
reducedMotion ? 'reducedMotion: On' : 'reducedMotion: Off',
)}
className={className}
transition={{ duration: 0.8 }}
style={{ opacity: reducedMotion ? 1 : 0, y: reducedMotion ? 0 : yGap }}
initial={{ opacity: reducedMotion ? 1 : 0, y: reducedMotion ? 0 : yGap }}
viewport={{ once: true }}
whileInView={{ opacity: 1, y: 0 }}
>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import { FadeUp } from '../../Molecules/FadeUp';

export function BlockImageTeasers(props: BlockImageTeasersFragment) {
return (
<FadeUp yGap={50}>
<section className="my-10 block-background-image-cards">
<FadeUp yGap={50} className="my-10 block-background-image-cards">
<section>
<div className="text-center">
<div
className={clsx('grid gap-2', {
Expand Down

0 comments on commit c881d78

Please sign in to comment.