fix: lottie import logic (#1526)
This commit is contained in:
@@ -1,8 +1,6 @@
|
|||||||
import React, { cloneElement, HTMLAttributes, useState } from 'react';
|
import React, { cloneElement, HTMLAttributes, useState } from 'react';
|
||||||
import Lottie from 'react-lottie';
|
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';
|
import { StyledSwitchItem } from './style';
|
||||||
|
|
||||||
type HoverAnimateControllerProps = {
|
type HoverAnimateControllerProps = {
|
||||||
@@ -49,7 +47,7 @@ export const PageSwitchItem = (
|
|||||||
options={{
|
options={{
|
||||||
loop: false,
|
loop: false,
|
||||||
autoplay: false,
|
autoplay: false,
|
||||||
animationData: pageHoverAnimationData,
|
animationData: require('./animation-data/page-hover.json'),
|
||||||
rendererSettings: {
|
rendererSettings: {
|
||||||
preserveAspectRatio: 'xMidYMid slice',
|
preserveAspectRatio: 'xMidYMid slice',
|
||||||
},
|
},
|
||||||
@@ -68,7 +66,7 @@ export const EdgelessSwitchItem = (
|
|||||||
options={{
|
options={{
|
||||||
loop: false,
|
loop: false,
|
||||||
autoplay: false,
|
autoplay: false,
|
||||||
animationData: edgelessHoverAnimationData,
|
animationData: require('./animation-data/edgeless-hover.json'),
|
||||||
rendererSettings: {
|
rendererSettings: {
|
||||||
preserveAspectRatio: 'xMidYMid slice',
|
preserveAspectRatio: 'xMidYMid slice',
|
||||||
},
|
},
|
||||||
|
|||||||
Reference in New Issue
Block a user