Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
kairoski03 committed May 27, 2024
2 parents dabe3df + 446ffd8 commit f10441b
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 18 deletions.
7 changes: 5 additions & 2 deletions src/components/arbitrum/Activate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,8 @@ interface InterfaceProps {
abi: AbiItem[];
setContractName: Dispatch<React.SetStateAction<string>>;
addNewContract: (contract: InterfaceContract) => void; // for SmartContracts
isActivated: boolean;
setIsActivated: Dispatch<React.SetStateAction<boolean>>;
}

export const Activate: React.FunctionComponent<InterfaceProps> = ({
Expand All @@ -41,8 +43,9 @@ export const Activate: React.FunctionComponent<InterfaceProps> = ({
abi,
setContractName,
addNewContract,
isActivated,
setIsActivated,
}) => {
const [isActivated, setIsActivated] = useState<boolean>(false);
const [isLoading, setIsLoading] = useState<boolean>(false);

const onActivate = async () => {
Expand Down Expand Up @@ -186,7 +189,7 @@ export const Activate: React.FunctionComponent<InterfaceProps> = ({
<Button
variant="primary"
onClick={onActivate}
disabled={isActivated}
disabled={isActivated || isLoading}
className="btn btn-primary btn-block d-block w-100 text-break remixui_disabled mb-1 mt-3"
>
<span>Activate</span>
Expand Down
9 changes: 7 additions & 2 deletions src/components/arbitrum/Compiler.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,8 @@ interface InterfaceProps {
setContractName: Dispatch<React.SetStateAction<string>>;
addNewContract: (contract: InterfaceContract) => void; // for SmartContracts
setSelected: (select: InterfaceContract) => void; // for At Address
isActivated: boolean;
setIsActivated: Dispatch<React.SetStateAction<boolean>>;
}

const RCV_EVENT_LOG_PREFIX = `[==> EVENT_RCV]`;
Expand All @@ -66,11 +68,12 @@ export const Compiler: React.FunctionComponent<InterfaceProps> = ({
providerNetwork,
abi,
setAbi,
contractAddr,
setContractAddr,
setContractName,
addNewContract,
setSelected,
isActivated,
setIsActivated,
}) => {
const [iconSpin, setIconSpin] = useState<string>('');
const [deploymentTx, setDeploymentTx] = useState<string>('');
Expand Down Expand Up @@ -99,6 +102,7 @@ export const Compiler: React.FunctionComponent<InterfaceProps> = ({
const init = () => {
setDeploymentTx('');
setIsReadToActivate(false);
setIsActivated(false);
setDataFee('');
setFileName('');
setTxHash('');
Expand Down Expand Up @@ -612,12 +616,13 @@ export const Compiler: React.FunctionComponent<InterfaceProps> = ({
providerNetwork={providerNetwork}
isReadyToActivate={isReadyToActivate}
dataFee={dataFee}
contractAddr={contractAddr}
setContractAddr={setContractAddr}
setContractName={setContractName}
addNewContract={addNewContract}
abi={abi}
uploadCodeChecked={uploadCodeChecked}
isActivated={isActivated}
setIsActivated={setIsActivated}
/>
) : null}
</>
Expand Down
1 change: 0 additions & 1 deletion src/components/arbitrum/Connect.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ export const Connect: React.FunctionComponent<InterfaceProps> = ({ client }) =>
/>
{providerNetwork === STYLUS_TESTNET_V2_CHAIN_ID ? (
<Project
wallet={wallet}
account={account}
injectedProvider={injectedProvider}
client={client}
Expand Down
8 changes: 6 additions & 2 deletions src/components/arbitrum/Deploy.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,13 @@ interface InterfaceProps {
providerNetwork: string;
isReadyToActivate: boolean;
dataFee: string;
contractAddr: string;
setContractAddr: Dispatch<React.SetStateAction<string>>;
setContractName: Dispatch<React.SetStateAction<string>>;
addNewContract: (contract: InterfaceContract) => void; // for SmartContracts
abi: AbiItem[];
uploadCodeChecked: boolean;
isActivated: boolean;
setIsActivated: Dispatch<React.SetStateAction<boolean>>;
}

export const Deploy: React.FunctionComponent<InterfaceProps> = ({
Expand All @@ -50,12 +51,13 @@ export const Deploy: React.FunctionComponent<InterfaceProps> = ({
account,
isReadyToActivate,
dataFee,
contractAddr,
setContractAddr,
setContractName,
addNewContract,
abi,
uploadCodeChecked,
isActivated,
setIsActivated,
}) => {
const [isLoading, setIsLoading] = useState<boolean>(false);
const [deployedContractAddress, setDeployedContractAddress] = useState<string>('');
Expand Down Expand Up @@ -223,6 +225,8 @@ export const Deploy: React.FunctionComponent<InterfaceProps> = ({
setContractName={setContractName}
abi={abi}
addNewContract={addNewContract}
isActivated={isActivated}
setIsActivated={setIsActivated}
></Activate>
) : null}
</Form>
Expand Down
25 changes: 14 additions & 11 deletions src/components/arbitrum/Project.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,13 @@ import Web3 from 'web3';
import { AbiItem } from 'web3-utils';

interface InterfaceProps {
wallet: string;
account: string;
client: Client<Api, Readonly<IRemixApi>>;
injectedProvider: any;
providerNetwork: string;
}

export const Project: React.FunctionComponent<InterfaceProps> = ({
wallet,
account,
injectedProvider,
providerNetwork,
Expand All @@ -44,6 +42,7 @@ export const Project: React.FunctionComponent<InterfaceProps> = ({
const [contractAddr, setContractAddr] = React.useState<string>('');
const [contracts, setContracts] = React.useState<InterfaceContract[]>([]);
const [selected, setSelected] = React.useState<InterfaceContract | null>(null);
const [isActivated, setIsActivated] = React.useState<boolean>(false);

const templateList = ['hello-world'];

Expand Down Expand Up @@ -272,6 +271,8 @@ export const Project: React.FunctionComponent<InterfaceProps> = ({
setContractName={setContractName}
addNewContract={addNewContract}
setSelected={setSelected}
isActivated={isActivated}
setIsActivated={setIsActivated}
/>
{/*<p className="text-center mt-3">*/}
{/* <small>OR</small>*/}
Expand Down Expand Up @@ -311,15 +312,17 @@ export const Project: React.FunctionComponent<InterfaceProps> = ({
{/* </OverlayTrigger>*/}
{/*</InputGroup>*/}
<hr />
<SmartContracts
dapp={injectedProvider}
account={account}
busy={busy}
setBusy={setBusy}
contracts={contracts}
client={client}
web3={new Web3(injectedProvider)}
/>
{isActivated ? (
<SmartContracts
dapp={injectedProvider}
account={account}
busy={busy}
setBusy={setBusy}
contracts={contracts}
client={client}
web3={new Web3(injectedProvider)}
/>
) : null}
</div>
);
};
Expand Down

0 comments on commit f10441b

Please sign in to comment.