Skip to content

Commit

Permalink
chore: add skeleton widget to nextjs example
Browse files Browse the repository at this point in the history
  • Loading branch information
Nathan Richards committed May 13, 2024
1 parent 489a58b commit e2e53d5
Show file tree
Hide file tree
Showing 3 changed files with 600 additions and 3,918 deletions.
30 changes: 17 additions & 13 deletions examples/nextjs/app/components/Widget.tsx
Original file line number Diff line number Diff line change
@@ -1,25 +1,29 @@
'use client';

import { LiFiWidget } from '@lifi/widget';
import type { WidgetConfig } from '@lifi/widget';
import { LiFiWidget, WidgetSkeleton } from '@lifi/widget';
import { useEffect, useState } from 'react';

export function Widget() {
const [mounted, setMounted] = useState(false);
useEffect(() => setMounted(true), []);

const config = {
appearance: 'light',
theme: {
container: {
boxShadow: '0px 8px 32px rgba(0, 0, 0, 0.08)',
borderRadius: '16px',
},
},
} as Partial<WidgetConfig>;

return (
<main>
{mounted && (
<LiFiWidget
config={{
theme: {
container: {
boxShadow: '0px 8px 32px rgba(0, 0, 0, 0.08)',
borderRadius: '16px',
},
},
}}
integrator="nextjs-example"
/>
{mounted ? (
<LiFiWidget config={config} integrator="nextjs-example" />
) : (
<WidgetSkeleton config={config} />
)}
</main>
);
Expand Down
4 changes: 2 additions & 2 deletions examples/nextjs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@
"lint": "next lint"
},
"dependencies": {
"@lifi/sdk": "^3.0.0-alpha.58",
"@lifi/widget": "^3.0.0-alpha.37",
"@lifi/sdk": "^3.0.0-alpha.61",
"@lifi/widget": "^3.0.0-alpha.40",
"next": "14.2.1",
"react": "^18.2.0",
"react-dom": "^18.2.0"
Expand Down
Loading

0 comments on commit e2e53d5

Please sign in to comment.