Skip to content

Commit

Permalink
Fixed version in styles debug components
Browse files Browse the repository at this point in the history
  • Loading branch information
Nadai2010 committed Aug 21, 2024
1 parent cc83b66 commit 8228537
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 10 deletions.
2 changes: 1 addition & 1 deletion packages/nextjs/app/debug/_components/DebugContracts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export function DebugContracts() {
}, [selectedContract, setSelectedContract]);

return (
<div className="flex flex-col gap-y-6 lg:gap-y-8 py-8 lg:py-12 justify-center items-center text-primary">
<div className="flex flex-col gap-y-6 lg:gap-y-8 py-8 lg:py-12 justify-center items-center">
{contractNames.length === 0 ? (
<p className="text-3xl mt-14">No contracts found!</p>
) : (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,11 @@ export const ContractInput = ({
<div className="flex flex-col gap-1.5 w-full">
<div className="flex items-center ml-2">
{paramType.name && (
<span className="text-xs font-medium mr-2 leading-none text-neutral">
<span className="text-xs font-medium mr-2 leading-none">
{paramType.name}
</span>
)}
<span className="block text-xs font-extralight leading-none text-neutral">
<span className="block text-xs font-extralight leading-none">
{displayType(paramType.type)}
</span>
</div>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Abi } from "abi-wan-kanabi";
import {
AbiFunction,
Contract,
ContractName,
GenericContract,
InheritedFunctions,
getFunctionsByStateMutability,
} from "~~/utils/scaffold-stark/contract";
import { ReadOnlyFunctionForm } from "./ReadOnlyFunctionForm";
Expand Down Expand Up @@ -29,7 +32,7 @@ export const ContractReadMethods = ({
};
});
if (!functionsToDisplay.length) {
return <span className="text-neutral">No read methods</span>;
return <>No read methods</>;
}
return (
<>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
import { Abi } from "abi-wan-kanabi";
import {
AbiFunction,
Contract,
ContractName,
GenericContract,
InheritedFunctions,
getFunctionsByStateMutability,
} from "~~/utils/scaffold-stark/contract";
import { DisplayVariable } from "./DisplayVariable";
Expand Down Expand Up @@ -31,7 +34,7 @@ export const ContractVariables = ({
};
});
if (!functionsToDisplay.length) {
return <span className="text-neutral">No contract variables</span>;
return <>No contract variables</>;
}

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const DisplayVariable = ({
{abiFunction.name}
</h3>
<button
className="btn btn-ghost btn-xs text-neutral"
className="btn btn-ghost btn-xs"
onClick={async () => await refetch()}
>
{!isLoading && isFetching ? (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,12 @@
"use client";

import { useEffect, useState } from "react";
// import { Abi, AbiFunction } from "abitype";
// import { Address, TransactionReceipt } from "viem";
// import { useContractWrite, useNetwork, useWaitForTransaction } from "wagmi";
import {
ContractInput,
// TxReceipt,
getFunctionInputKey,
getInitialFormState,
getParsedContractFunctionArgs,
Expand All @@ -27,14 +31,16 @@ type WriteOnlyFunctionFormProps = {
abiFunction: AbiFunction;
onChange: () => void;
contractAddress: Address;
// inheritedFrom?: string;
};

export const WriteOnlyFunctionForm = ({
abi,
abiFunction,
onChange,
contractAddress,
}: WriteOnlyFunctionFormProps) => {
}: // inheritedFrom,
WriteOnlyFunctionFormProps) => {
const [form, setForm] = useState<Record<string, any>>(() =>
getInitialFormState(abiFunction),
);
Expand Down Expand Up @@ -129,11 +135,12 @@ export const WriteOnlyFunctionForm = ({
>
<p className="font-medium my-0 break-words text-function">
{abiFunction.name}
{/* <InheritanceTooltip inheritedFrom={undefined} /> */}
</p>
{inputs}
<div className="flex justify-between gap-2">
{!zeroInputs && (
<div className="flex-grow basis-0 text-neutral-content">
<div className="flex-grow basis-0">
{displayedTxResult ? (
<TxReceipt txResult={displayedTxResult} />
) : null}
Expand All @@ -160,7 +167,7 @@ export const WriteOnlyFunctionForm = ({
</div>
</div>
{zeroInputs && txResult ? (
<div className="flex-grow basis-0 ">
<div className="flex-grow basis-0">
<TxReceipt txResult={txResult} />
</div>
) : null}
Expand Down
4 changes: 3 additions & 1 deletion packages/snfoundry/contracts/src/Staker.cairo
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,9 @@ pub mod Staker {
// This function should be called after the deadline has passed and the staked amount is greater than or equal to the threshold
// You have to call/use this function in the above `execute` function
// This function should call the `complete` function of the external contract and transfer the staked amount to the external contract
fn complete_transfer(ref self: ContractState, amount: u256) {// Note: Staker contract should approve to transfer the staked_amount to the external contract
fn complete_transfer(
ref self: ContractState, amount: u256
) { // Note: Staker contract should approve to transfer the staked_amount to the external contract
}
// ToDo Checkpoint 3: Implement your not_completed function here
fn not_completed(ref self: ContractState) {}
Expand Down

0 comments on commit 8228537

Please sign in to comment.