Skip to content

Commit

Permalink
Limit example width to screen (#1314)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunichiSugiura authored Jan 22, 2025
1 parent 5905332 commit ae507b7
Show file tree
Hide file tree
Showing 6 changed files with 52 additions and 43 deletions.
2 changes: 1 addition & 1 deletion examples/next/src/app/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ import { Transfer } from "components/Transfer";

const Home: FC = () => {
return (
<main className="flex flex-col p-4 gap-4">
<main className="w-screen overflow-x-hidden flex flex-col p-4 gap-4">
<div className="flex justify-between">
<h2 className="text-3xl font-bold underline text-primary">
Controller Example (Next.js)
Expand Down
7 changes: 4 additions & 3 deletions examples/next/src/components/DelegateAccount.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,8 @@ export const DelegateAccount = () => {
return (
<div className="flex flex-col gap-2">
<h2>Delegate account</h2>
<p>

<div className="flex items-center gap-2">
Address:{" "}
{isDelegateSupported ? (
<>
Expand All @@ -73,9 +74,9 @@ export const DelegateAccount = () => {
) : (
"Not deployed"
)}
</p>
</div>

<div className="flex gap-2">
<div className="flex items-center gap-2">
<Input
className="max-w-40"
type="text"
Expand Down
3 changes: 2 additions & 1 deletion examples/next/src/components/InvalidTxn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ export function InvalidTxn() {
return (
<div>
<h2>Invalid Entry Point</h2>
<div>

<div className="flex flex-wrap gap-1">
<Button
onClick={() =>
account.execute([
Expand Down
39 changes: 21 additions & 18 deletions examples/next/src/components/ManualTransferEth.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,25 +50,28 @@ export const ManualTransferEth = () => {
return (
<div>
<h2>Manual Transfer Eth</h2>
<Button onClick={() => execute("0x0")} disabled={submitted}>
Transfer 0 ETH to self
</Button>
<Button onClick={() => execute("0x1C6BF52634000")} disabled={submitted}>
Transfer 0.005 ETH to self
</Button>
<Button
onClick={() => execute("1B1AE4D6E2EF500000")}
disabled={submitted}
>
Transfer 500 ETH to self
</Button>
{txnHash && (
<>
<p>Transaction: {txnHash}</p>

<p>Chain: {network}</p>
</>
)}
<div className="flex flex-wrap gap-1">
<Button onClick={() => execute("0x0")} disabled={submitted}>
Transfer 0 ETH to self
</Button>
<Button onClick={() => execute("0x1C6BF52634000")} disabled={submitted}>
Transfer 0.005 ETH to self
</Button>
<Button
onClick={() => execute("1B1AE4D6E2EF500000")}
disabled={submitted}
>
Transfer 500 ETH to self
</Button>
{txnHash && (
<>
<p>Transaction: {txnHash}</p>

<p>Chain: {network}</p>
</>
)}
</div>
</div>
);
};
9 changes: 5 additions & 4 deletions examples/next/src/components/Profile.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,11 @@ export function Profile() {
}

return (
<div>
<div className="">
<h2>Open Profile</h2>

<div className="flex flex-col gap-1">
<div className="flex gap-1">
<div className="flex flex-wrap gap-1">
<Button onClick={() => ctrlConnector.controller.openProfile()}>
Inventory
</Button>
Expand All @@ -52,7 +53,7 @@ export function Profile() {
Activity
</Button>
</div>
<div className="flex gap-1">
<div className="flex flex-wrap gap-1">
<Button
onClick={() =>
ctrlConnector.controller.openProfileTo(
Expand All @@ -72,7 +73,7 @@ export function Profile() {
Open to Token ETH Send
</Button>
</div>
<div className="flex gap-1">
<div className="flex flex-wrap gap-1">
<Button
onClick={() =>
ctrlConnector.controller.openProfileAt(
Expand Down
35 changes: 19 additions & 16 deletions examples/next/src/components/Transfer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,22 +50,25 @@ export const Transfer = () => {
return (
<div>
<h2>Session Transfer STRK</h2>
<Button onClick={() => execute("0x0")}>Transfer 0 STRK to self</Button>
<Button onClick={() => execute("0x1C6BF52634000")} disabled={submitted}>
Transfer 0.005 STRK to self
</Button>
<Button
onClick={() => execute("1B1AE4D6E2EF500000")}
disabled={submitted}
>
Transfer 500 STRK to self
</Button>
{txnHash && (
<>
<p>Transaction: {txnHash}</p>
<p>Chain: {network}</p>
</>
)}

<div className="flex flex-wrap gap-1">
<Button onClick={() => execute("0x0")}>Transfer 0 STRK to self</Button>
<Button onClick={() => execute("0x1C6BF52634000")} disabled={submitted}>
Transfer 0.005 STRK to self
</Button>
<Button
onClick={() => execute("1B1AE4D6E2EF500000")}
disabled={submitted}
>
Transfer 500 STRK to self
</Button>
{txnHash && (
<>
<p>Transaction: {txnHash}</p>
<p>Chain: {network}</p>
</>
)}
</div>
</div>
);
};

0 comments on commit ae507b7

Please sign in to comment.