Skip to content

Conversation

@mannynotfound
Copy link
Contributor

Description

We have several places in our app where we have an input for FLOW addresses which we want to validate against the FLOW blockchain and sometimes run additional validation logic on it. This PR moves all those custom <input> to use our shared <InputAddress> so styling is consistent and to minimize places to update.

Demo / Test Result

image
image
image

@linear
Copy link

linear bot commented Oct 3, 2022

VSL-194

isValid,
onChange,
className = "",
readOnly = false,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

add className to add classes needed for situational positioning/styling and readOnly to render a disabled input

<input
style={{ height: 48 }}
className="border-light rounded-sm column is-full p-2 mt-2"
className="border-light rounded-sm column is-full p-4"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

moved p-2 => p-4 to match designs closer / be consistent throughout app

<div style={{ position: "absolute", right: 17, top: 20 }}>
<div
className="is-flex is-align-items-center"
style={{ position: "absolute", right: 15, top: 0, height: "100%" }}>
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

use a container with 100% height thats align-items: center which should be more flexible than fixed absolute positioning

)}
</div>
<InputAddress
className={addressValidClass}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like this addressValidClass depends if the address is valid, so that logic can be moved to InputAddress?
This way we can ensure all the inputs have is-success/is-error class attached

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@KsenijaZivkovic good call - added!

@jacksonConrad
Copy link
Collaborator

Everything looks good, although I noticed that on your branch i'm unable to click Create Safe, despite having the required fields populated.

Screen Shot 2022-10-03 at 4 04 44 PM

Comment on lines +16 to 17
const onOwnerAddressChange = (value, isValid, idx) => {
const newOwners = safeOwners.slice(0);
newOwners[idx].address = value;
newOwners[idx].isValid = isValid;
setSafeOwners([...newOwners]);
};
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer following the style guide

Suggested change
const onOwnerAddressChange = (value, isValid, idx) => {
const newOwners = safeOwners.slice(0);
newOwners[idx].address = value;
newOwners[idx].isValid = isValid;
setSafeOwners([...newOwners]);
};
const onOwnerAddressChange = (value, isValid, idx) => {
const newOwners = [...safeOwners]
newOwners[idx].address = value;
newOwners[idx].isValid = isValid;
setSafeOwners(newOwners);
};

)}
</div>
</div>
<InputAddress
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This input Address component is being replaced by addressDropdown. I think we can safely delete this file now https://github.com/DapperCollectives/VESSEL/pull/120/files#diff-e8e43eadee51d689965c6c2bd4a914f301aea66e12351d018baa6cd3567d1422


const InputAddress = ({ web3, value, isValid, onChange }) => {
const InputAddress = ({
web3,
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still need web3 as a prop when we expect isValid and onChange to handle the validation?

@mannynotfound
Copy link
Contributor Author

Everything looks good, although I noticed that on your branch i'm unable to click Create Safe, despite having the required fields populated.

Screen Shot 2022-10-03 at 4 04 44 PM

Small bug, should be updated now!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants