Skip to content

Commit

Permalink
fix: remove innerLogic
Browse files Browse the repository at this point in the history
  • Loading branch information
rin-st committed Sep 28, 2024
1 parent e4575c4 commit 724e639
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions templates/base/packages/nextjs/app/page.tsx.template.mjs
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
import { withDefaults } from "../../../../utils.js";

const contents = ({ importsAndOptionalUseClient, innerLogic, externalExtensionName, description }) => {
const contents = ({ imports, externalExtensionName, description }) => {
return `
${importsAndOptionalUseClient}
"use client";
import { useAccount } from "wagmi";
import { Address } from "~~/components/scaffold-eth";
import type { NextPage } from "next";
import Link from "next/link";
import { BugAntIcon, MagnifyingGlassIcon } from "@heroicons/react/24/outline";
${imports}
const Home: NextPage = () => {
${innerLogic}
const { address: connectedAddress } = useAccount();
return (
<>
Expand All @@ -17,8 +21,12 @@ const Home: NextPage = () => {
<h1 className="text-center">
<span className="block text-2xl mb-2">Welcome to</span>
<span className="block text-4xl font-bold">Scaffold-ETH 2</span>
${externalExtensionName[0] ? `<span className="mt-2 block text-xl font-bold">(${externalExtensionName[0]} extension)</span>` : ''}
${externalExtensionName[0] ? `<span className="block text-xl font-bold">(${externalExtensionName[0]} extension)</span>` : ''}
</h1>
<div className="flex justify-center items-center space-x-2 flex-col sm:flex-row">
<p className="my-2 font-medium">Connected Address:</p>
<Address address={connectedAddress} />
</div>
${description}
</div>
Expand Down Expand Up @@ -56,18 +64,8 @@ export default Home;
};

export default withDefaults(contents, {
importsAndOptionalUseClient: `
"use client";
import { useAccount } from "wagmi";
import { Address } from "~~/components/scaffold-eth";
`,
innerLogic: "const { address: connectedAddress } = useAccount();",
imports: ``,
description: `
<div className="flex justify-center items-center space-x-2 flex-col sm:flex-row">
<p className="my-2 font-medium">Connected Address:</p>
<Address address={connectedAddress} />
</div>
<p className="text-center text-lg">
Get started by editing{" "}
<code className="italic bg-base-300 text-base font-bold max-w-full break-words break-all inline-block">
Expand Down

0 comments on commit 724e639

Please sign in to comment.