Simplify the avatar component (#1744)
* Copypaste UserAvatar to EditableUserAvatar * Swap usages with onSelectNewAvatar to EditableUserAvatar * Split prop types into UserAvatarProps and EditableUserAvatarProps * Remove dead branches from EditableUserAvatar * Remove dead branches from UserAvatar
This commit is contained in:
parent
c6e28f88e5
commit
32fbb9dba7
3 changed files with 72 additions and 44 deletions
|
@ -18,7 +18,7 @@ import {ListModel} from 'state/models/content/list'
|
|||
import {s, colors, gradients} from 'lib/styles'
|
||||
import {enforceLen} from 'lib/strings/helpers'
|
||||
import {compressIfNeeded} from 'lib/media/manip'
|
||||
import {UserAvatar} from '../util/UserAvatar'
|
||||
import {EditableUserAvatar} from '../util/UserAvatar'
|
||||
import {usePalette} from 'lib/hooks/usePalette'
|
||||
import {useTheme} from 'lib/ThemeContext'
|
||||
import {useAnalytics} from 'lib/analytics/analytics'
|
||||
|
@ -148,7 +148,7 @@ export function Component({
|
|||
)}
|
||||
<Text style={[styles.label, pal.text]}>List Avatar</Text>
|
||||
<View style={[styles.avi, {borderColor: pal.colors.background}]}>
|
||||
<UserAvatar
|
||||
<EditableUserAvatar
|
||||
type="list"
|
||||
size={80}
|
||||
avatar={avatar}
|
||||
|
|
|
@ -20,7 +20,7 @@ import {enforceLen} from 'lib/strings/helpers'
|
|||
import {MAX_DISPLAY_NAME, MAX_DESCRIPTION} from 'lib/constants'
|
||||
import {compressIfNeeded} from 'lib/media/manip'
|
||||
import {UserBanner} from '../util/UserBanner'
|
||||
import {UserAvatar} from '../util/UserAvatar'
|
||||
import {EditableUserAvatar} from '../util/UserAvatar'
|
||||
import {usePalette} from 'lib/hooks/usePalette'
|
||||
import {useTheme} from 'lib/ThemeContext'
|
||||
import {useAnalytics} from 'lib/analytics/analytics'
|
||||
|
@ -153,7 +153,7 @@ export function Component({
|
|||
onSelectNewBanner={onSelectNewBanner}
|
||||
/>
|
||||
<View style={[styles.avi, {borderColor: pal.colors.background}]}>
|
||||
<UserAvatar
|
||||
<EditableUserAvatar
|
||||
size={80}
|
||||
avatar={userAvatar}
|
||||
onSelectNewAvatar={onSelectNewAvatar}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue