Skip to content

Commit

Permalink
💚 (smpl): Fix build with node 21
Browse files Browse the repository at this point in the history
  • Loading branch information
jdabbech-ledger committed Nov 22, 2024
1 parent 0e68d3b commit db8e9d5
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 5 deletions.
9 changes: 8 additions & 1 deletion apps/sample/src/app/device-actions/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,15 @@
"use client";
import React from "react";
import dynamic from "next/dynamic";

import { AllDeviceActions } from "@/components/DeviceActionsView/AllDeviceActions";
import { SessionIdWrapper } from "@/components/SessionIdWrapper";
const AllDeviceActions = dynamic(
() =>
import("@/components/DeviceActionsView/AllDeviceActions").then(
(mod) => mod.AllDeviceActions,
),
{ ssr: false },
);

const DeviceActions: React.FC = () => {
return <SessionIdWrapper ChildComponent={AllDeviceActions} />;
Expand Down
6 changes: 5 additions & 1 deletion apps/sample/src/app/signer/ethereum/page.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
"use client";
import React from "react";
import dynamic from "next/dynamic";

import { SessionIdWrapper } from "@/components/SessionIdWrapper";
import { SignerEthView } from "@/components/SignerEthView";
const SignerEthView = dynamic(
() => import("@/components/SignerEthView").then((mod) => mod.SignerEthView),
{ ssr: false },
);

const Signer: React.FC = () => {
return <SessionIdWrapper ChildComponent={SignerEthView} />;
Expand Down
8 changes: 6 additions & 2 deletions apps/sample/src/app/signer/solana/page.tsx
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
"use client";
import React from "react";
import dynamic from "next/dynamic";

import { SessionIdWrapper } from "@/components/SessionIdWrapper";
import { SignerSolanaView } from "@/components/SignerSolanaView";

const SignerSolanaView = dynamic(
() =>
import("@/components/SignerSolanaView").then((mod) => mod.SignerSolanaView),
{ ssr: false },
);
const Signer: React.FC = () => {
return <SessionIdWrapper ChildComponent={SignerSolanaView} />;
};
Expand Down
2 changes: 1 addition & 1 deletion apps/sample/src/components/SessionIdWrapper.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { useDeviceSessionsContext } from "@/providers/DeviceSessionsProvider";
* If there is no selected sessionId, it renders a message and a button to go to the home page.
*/
export const SessionIdWrapper: React.FC<{
ChildComponent: React.FC<{ sessionId: string }>;
ChildComponent: React.ComponentType<{ sessionId: string }>;
}> = ({ ChildComponent }) => {
const {
state: { selectedId: sessionId },
Expand Down

0 comments on commit db8e9d5

Please sign in to comment.