Patch-profile
A module for editing your (or other people's) profiles in patch-* family apps. Edits names or images.
You'll need to understand depject (a module for a different way of managing dependency injection), and for hte example below, depnest - a lazy way to write nested objects quickly.
Example
const nest = const h = exportsgives = exportsneeds = exports { return { // location is an object { feed, page: 'userEdit' } const options = feed: locationfeed const callback = { if err throw 'Error editing profile' err if didEdit console // go back to the users profile apihistorysync } return }}
API
about.page.edit
(options=object, callback=function)
Where target
is of the form { feed='@....', labels=object }
labels
(optional) can be used to over-ride labels for translations: { name, image, cancel, save }
callback
(optional) will be called after a user confirms or cancels changes. It has signature (err, didEdit=boolean)
, where didEdit == true
if an edit was published.
styles.mcss
Patch-profile exports basic mcss styles. See Patchbay for examples of how this can be integrated into an app.