Upload profile image (#29)
* add editable button profile picture * add editable button cover picture * upload profile photos (save them locally) * rollback pbxproj changes * rollback podfile checksum (for git only) * move edit photos onto edit profile modal * adjust edit icon and image cropping size * added temporary (react state) image * added IMAGES_ENABLED flag * minor lint fix * save local photos on edit profile upload (wip) * save profile photos on profile view state (wip) * remove unecessary computed * save photo in state before pushing it to viewmodel * refactor profile pictures's state * remove unnecessary isMe prop * removing old comments * tweak icon size & position * A few styling tweaks and a fix to mobx state management Co-authored-by: Paul Frazee <pfrazee@gmail.com>
This commit is contained in:
parent
4cc90b8ac9
commit
84a60592a8
5 changed files with 269 additions and 16 deletions
|
@ -43,6 +43,10 @@ export class ProfileViewModel {
|
|||
postsCount: number = 0
|
||||
myState = new ProfileViewMyStateModel()
|
||||
|
||||
// TODO TEMP data to be implemented in the protocol
|
||||
userAvatar: string | null = null
|
||||
userBanner: string | null = null
|
||||
|
||||
// added data
|
||||
descriptionEntities?: Entity[]
|
||||
|
||||
|
@ -115,7 +119,15 @@ export class ProfileViewModel {
|
|||
}
|
||||
}
|
||||
|
||||
async updateProfile(fn: (existing?: Profile.Record) => Profile.Record) {
|
||||
async updateProfile(
|
||||
fn: (existing?: Profile.Record) => Profile.Record,
|
||||
userAvatar: string | null, // TODO TEMP
|
||||
userBanner: string | null, // TODO TEMP
|
||||
) {
|
||||
// TODO TEMP add userBanner & userAvatar in the protocol when suported
|
||||
this.userAvatar = userAvatar
|
||||
this.userBanner = userBanner
|
||||
|
||||
await apilib.updateProfile(this.rootStore, this.did, fn)
|
||||
await this.refresh()
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue