citycoins / ui

Basic UI components for interacting with the CityCoin contract. Requires Stacks Wallet for Web.
https://minecitycoins.com
GNU General Public License v3.0
28 stars 13 forks source link

🐞[BUG] Standardize form responses #98

Closed whoabuddy closed 2 years ago

whoabuddy commented 2 years ago

Describe the bug

Right now there are a mix of approaches to handling form validation and messaging.

image

image

image

Expected behavior

Create a consistent experience for all forms, which will be applied to all future tools pages as well.

This could be done with a component that:

Design-wise it'd be:

Implementation-wise, it could be controlled by a state variable in the "action" functions:

const [formMsg, setFormMsg] = useState('');
const [formMsgState, setFormMsgState = useState('');

formMsg && <NewComponent state={formMsgState} value={formMsg} />

Open to ideas on this as well! Wondering if this new component could use a better txid / tx handling component if one is supplied on form success.