Skip to content

Commit

Permalink
Delete lottie
Browse files Browse the repository at this point in the history
  • Loading branch information
mcclowes committed Nov 22, 2024
1 parent ae6956b commit 0598397
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 19 deletions.
3 changes: 2 additions & 1 deletion docs/using-the-api/push.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ description: "Understand how to add, modify, and delete data in Codat's integrat

import Tabs from "@theme/Tabs";
import TabItem from "@theme/TabItem";

import Lottie from '@components/Lottie'
import webhooks from '../../static/animations/webhooks.json'

<Lottie animation={webhooks}/>

Codat offers the ability to create, update, and delete records in the source platforms of our integrations using our standard data models.
We support the following write operations:
Expand Down
39 changes: 21 additions & 18 deletions src/components/Lottie/index.js
Original file line number Diff line number Diff line change
@@ -1,29 +1,32 @@
import React, { Suspense } from "react";
import Lottie from "lottie-react";

import React, { Suspense, lazy } from "react";
import BrowserOnly from "@docusaurus/BrowserOnly";

import styles from "./styles.module.scss";

// Dynamically import the Lottie component
const Lottie = lazy(() => import("lottie-react"));

const App = (props) => {
const {
animation,
loop=true,
loop = true,
...rest
} = props
} = props;

return <BrowserOnly>
{
() => <Suspense>
<Lottie
className={styles.wrapper}
animationData={animation}
loop={loop}
{...rest}
/>
</Suspense>
}
</BrowserOnly>
return (
<BrowserOnly>
{() => (
<Suspense fallback={<div>Loading...</div>}>
<Lottie
className={styles.wrapper}
animationData={animation}
loop={loop}
{...rest}
/>
</Suspense>
)}
</BrowserOnly>
);
};

export default App;
export default App;

0 comments on commit 0598397

Please sign in to comment.