fix: lottie import logic (#1526)

This commit is contained in:
Himself65 2023-03-10 12:06:27 -06:00 committed by GitHub
parent 9043081b8d
commit 1239957446
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,8 +1,6 @@
import React, { cloneElement, HTMLAttributes, useState } from 'react';
import Lottie from 'react-lottie';
import * as edgelessHoverAnimationData from './animation-data/edgeless-hover.json';
import * as pageHoverAnimationData from './animation-data/page-hover.json';
import { StyledSwitchItem } from './style';
type HoverAnimateControllerProps = {
@ -49,7 +47,7 @@ export const PageSwitchItem = (
options={{
loop: false,
autoplay: false,
animationData: pageHoverAnimationData,
animationData: require('./animation-data/page-hover.json'),
rendererSettings: {
preserveAspectRatio: 'xMidYMid slice',
},
@ -68,7 +66,7 @@ export const EdgelessSwitchItem = (
options={{
loop: false,
autoplay: false,
animationData: edgelessHoverAnimationData,
animationData: require('./animation-data/edgeless-hover.json'),
rendererSettings: {
preserveAspectRatio: 'xMidYMid slice',
},