Greg
@greg
Playing around with an idea for a React library that makes building frontends for smart contracts a lot easier, inspired by Radix Primitives (https://www.radix-ui.com/) Not sure if it's even feasible (sooo many potential use cases to think through) but at least an interesting challenge https://i.imgur.com/5mXdRph.png
12 replies
0 recast
0 reaction
Boris
@boris-backedby
Very cool idea! I think Contract.Input and Contract.Button need to be wrapped in Contract.Function which would validate the number and types of inputs as you’re working. Packaging the wagmi usePrepareContractWrite>useContractWrite>useWaitForTransaction stack into Contract.Function would be so much easier for new de
2 replies
0 recast
0 reaction
Greg
@greg
I've got a version working like this too - specify the function on the button. Less code but maybe also less intuitive? Curious to hear your thoughts if you have - actively working through it https://i.imgur.com/jsh2LNp.png
1 reply
0 recast
0 reaction
Boris
@boris-backedby
I like that it’s less code! My initial thought was something like: <C.Root> <C.WriteFn> <C.Input/> <C.Input/> <C.Button/> </C.WriteFn> </C.Root> <C.Root> <C.ReadFn> <C.Input/> <C.Input/> <DataDisplay/> </C.ReadFn> </C.Root> <C.Root> <C.Event> <DataDisplay/> </C.Event> </C.Root> Your example feels less boilerplate-
1 reply
0 recast
0 reaction