Closed VirginiaLP closed 4 years ago
Actually, since this will handle photo uploads from your computer, your amber vault, or the stock images, maybe it should be named something more like FileUploadModal
.
I'd be interested in seeing fully fleshed-out sample code consuming the proposed component API. I have a lot of questions about that spec that I'm not sure how to ask without understanding the scope of the component. e.g.,
maybe it should be named something more like FileUploadModal.
Consider avoiding assumptions that prevent future applications from leveraging this component. We may want it outside of a modal, so this component could be just FileUpload, and a consumer can stick it in a modal if they want. We may want to upload files other than photos, so consider avoiding assumptions about file types, and maybe make it accept a whitelist of file extensions, like <input type="file">
's accept
attribute.
How does the component handle unauthenticated users? Does it have hooks to facilitate an auth flow, or does it just show an error?
Amber already has it implemented so that if a user is unauthenticated it will tell them to log in and offer a button to direct them through the sign in flow.
Does it open an iframe?
The consumer will be able to configure what tab/s they want. They can include a native file picker and tabs to Amber vaults. The tabs to vaults will have iframes to Amber.
How is localization handled? (I think the product drawer has some localization support) What functionality does the component provide to the host application? The proposed prop types demonstrate no mechanism for exposing data from the component. Is the purpose to let the user simply browse assets, or does it need to let them pick assets and return the result to the host, or something else?
I've updated the suggested architecture section of the original post now that I've had time to sit down at a whiteboard and think it all out.
AmberLightbox
Tab: