From 1239957446d2583d9258bd1d3d2587affdb75f99 Mon Sep 17 00:00:00 2001 From: Himself65 Date: Fri, 10 Mar 2023 12:06:27 -0600 Subject: [PATCH] fix: lottie import logic (#1526) --- .../blocksuite/header/editor-mode-switch/switch-items.tsx | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/web/src/components/blocksuite/header/editor-mode-switch/switch-items.tsx b/apps/web/src/components/blocksuite/header/editor-mode-switch/switch-items.tsx index dbf8a616a2..b191e93dc4 100644 --- a/apps/web/src/components/blocksuite/header/editor-mode-switch/switch-items.tsx +++ b/apps/web/src/components/blocksuite/header/editor-mode-switch/switch-items.tsx @@ -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', },