Skip to content

Commit

Permalink
Form Label Changes and Minor UI fixes (#221)
Browse files Browse the repository at this point in the history
* remove chainid and eas etwork id check

* form label changes
  • Loading branch information
Rashmi-278 authored Apr 3, 2024
1 parent c2a3757 commit 6cd71d2
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 13 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -328,19 +328,19 @@ function validateAll(fields) {
let registrationContract = chain.id === 11155420 ? '0xF124Aca94e664Bfd5373feA9E2410FD799a8a08B' : '0xb35AA0cB89eC35f04c30E19B736b8ae1904EC26b';

const fields = [
{ name: 'networkID', value: easNetworkID, type: 'uint256', errorMessage: "Network ID must be provided" },
{ name: 'daoName', value: daoName, type: 'string', errorMessage: "DAO must have a name" },
{ name: 'daoURI', value: daoURI, type: 'string', validator: validator.isURL, errorMessage: "DAO URI must be a valid URI" },
{ name: 'contractAddress', value: contractAddress, validator: validator.isEthereumAddress, type: 'address', errorMessage: "Contract address must be a valid Ethereum address" },
{ name: 'issuerName', value: issuerName, type: 'string', errorMessage: "Issuer name must be provided" },
{ name: 'issuerDescription', value: issuerDescription, type: 'string', errorMessage: "Issuer description must be provided" },
{ name: 'DAO NetworkID', value: easNetworkID, type: 'uint256', errorMessage: "Network ID of Contract Address must be provided" },
{ name: 'DAO Name', value: daoName, type: 'string', errorMessage: "DAO must have a name" },
{ name: 'DAO URI', value: daoURI, type: 'string', validator: validator.isURL, errorMessage: "DAO URI must be a valid URI" },
{ name: 'Contract Address', value: contractAddress, validator: validator.isEthereumAddress, type: 'address', errorMessage: "Contract address must be a valid Ethereum address" },
{ name: 'Issuer Name', value: issuerName, type: 'string', errorMessage: "Issuer name must be provided" },
{ name: 'Issuer Description', value: issuerDescription, type: 'string', errorMessage: "Issuer description must be provided" },
];

validationErrors = validateAll(fields);

if (!isConnected) validationErrors.push(`Please connect wallet`);
if (!(easNetworkID === chain.id && (chain.id === 10 || chain.id === 11155420))) {
validationErrors.push(`Switch to Optimism mainnet or testnet`);
if (!isConnected) validationErrors.push(`Please connect your wallet to Optimism Mainnet`);
if (!(chain.id === 10 || chain.id === 11155420)) {
validationErrors.push(`Switch to Optimism Mainnet`);
}
if (validationErrors.length > 0) {
setErrors(validationErrors);
Expand Down Expand Up @@ -616,7 +616,7 @@ function validateAll(fields) {
{registerByEAS && !showEASRegisterDialog && (
<div style={{width:'100%'}}>
<div className="wizard-row wizard-row-flex">
<FormGroup label="Network">
<FormGroup label="DAO Network ID">
<HTMLSelect
style={{ minWidth: 140 }}
iconProps={{ icon: "caret-down", color: "#fff" }}
Expand Down Expand Up @@ -653,7 +653,7 @@ function validateAll(fields) {
</FormGroup>
</div>
<div className="wizard-row">
<FormGroup label="Contract Address" labelFor="contract-address" fill>
<FormGroup label="DAO Contract Address" labelFor="contract-address" fill>
<InputGroup
fill
id="contract-address"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,12 @@ const DisplayRegistration = ({
)}
<Divider />
<div className="card-metadata">
<p className="bp4-text-small wizard-no-margin">
<span className="bp4-text-muted">Registration Contract: </span>
{renderNetworkLink(network, id)}
</p>
<p className="bp4-text-small wizard-no-margin">
<span className="bp4-text-muted">Contract address: </span>
<span className="bp4-text-muted">Contract Owner: </span>
{renderNetworkLink(network, contractAddress)}
</p>
<p className="bp4-text-small wizard-no-margin">
Expand All @@ -108,7 +112,7 @@ const DisplayRegistration = ({
</span>
</p>
<p className="bp4-text-small wizard-no-margin">
<span className="bp4-text-muted">Manager address: </span>
<span className="bp4-text-muted">Manager Address: </span>
{managerAddress ? (
renderNetworkLink(network, managerAddress)
) : (
Expand Down

0 comments on commit 6cd71d2

Please sign in to comment.