Switch to one default avi

zio/stable
Paul Frazee 2022-09-28 14:00:40 -05:00
parent 5909509bea
commit e6627183e1
17 changed files with 25 additions and 67 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 70 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 42 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 61 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 KiB

View File

@ -6,7 +6,7 @@ import {FontAwesomeIcon, Props} from '@fortawesome/react-native-fontawesome'
import {NotificationsViewItemModel} from '../../../state/models/notifications-view'
import {s, colors} from '../../lib/styles'
import {ago} from '../../lib/strings'
import {AVIS} from '../../lib/assets'
import {DEF_AVATER} from '../../lib/assets'
import {PostText} from '../post/PostText'
import {Post} from '../post/Post'
import {Link} from '../util/Link'
@ -62,10 +62,7 @@ export const FeedItem = observer(function FeedItem({
<Link style={styles.outer} href={itemHref} title={itemTitle}>
<View style={styles.layout}>
<Link style={styles.layoutAvi} href={authorHref} title={authorTitle}>
<Image
style={styles.avi}
source={AVIS[item.author.name] || AVIS['alice.test']}
/>
<Image style={styles.avi} source={DEF_AVATER} />
</Link>
<View style={styles.layoutContent}>
<View style={styles.meta}>

View File

@ -16,7 +16,7 @@ import {
import {Link} from '../util/Link'
import {useStores} from '../../../state'
import {s, colors} from '../../lib/styles'
import {AVIS} from '../../lib/assets'
import {DEF_AVATER} from '../../lib/assets'
export const PostLikedBy = observer(function PostLikedBy({uri}: {uri: string}) {
const store = useStores()
@ -78,10 +78,7 @@ const LikedByItem = ({item}: {item: LikedByViewItemModel}) => {
<Link style={styles.outer} href={`/profile/${item.name}`} title={item.name}>
<View style={styles.layout}>
<View style={styles.layoutAvi}>
<Image
style={styles.avi}
source={AVIS[item.name] || AVIS['alice.test']}
/>
<Image style={styles.avi} source={DEF_AVATER} />
</View>
<View style={styles.layoutContent}>
<Text style={[s.f15, s.bold]}>{item.displayName}</Text>

View File

@ -6,7 +6,6 @@ import {
Image,
StyleSheet,
Text,
TouchableOpacity,
View,
} from 'react-native'
import {
@ -16,7 +15,7 @@ import {
import {Link} from '../util/Link'
import {useStores} from '../../../state'
import {s, colors} from '../../lib/styles'
import {AVIS} from '../../lib/assets'
import {DEF_AVATER} from '../../lib/assets'
export const PostRepostedBy = observer(function PostRepostedBy({
uri,
@ -84,10 +83,7 @@ const RepostedByItem = ({item}: {item: RepostedByViewItemModel}) => {
<Link style={styles.outer} href={`/profile/${item.name}`} title={item.name}>
<View style={styles.layout}>
<View style={styles.layoutAvi}>
<Image
style={styles.avi}
source={AVIS[item.name] || AVIS['alice.test']}
/>
<Image style={styles.avi} source={DEF_AVATER} />
</View>
<View style={styles.layoutContent}>
<Text style={[s.f15, s.bold]}>{item.displayName}</Text>

View File

@ -10,7 +10,7 @@ import {Link} from '../util/Link'
import {PostDropdownBtn} from '../util/DropdownBtn'
import {s, colors} from '../../lib/styles'
import {ago, pluralize} from '../../lib/strings'
import {AVIS} from '../../lib/assets'
import {DEF_AVATER} from '../../lib/assets'
import {useStores} from '../../../state'
export const PostThreadItem = observer(function PostThreadItem({
@ -105,10 +105,7 @@ export const PostThreadItem = observer(function PostThreadItem({
<View style={styles.outer}>
<View style={styles.layout}>
<Link style={styles.layoutAvi} href={authorHref} title={authorTitle}>
<Image
style={styles.avi}
source={AVIS[item.author.name] || AVIS['alice.test']}
/>
<Image style={styles.avi} source={DEF_AVATER} />
</Link>
<View style={styles.layoutContent}>
<View style={[styles.meta, s.mt5]}>
@ -190,10 +187,7 @@ export const PostThreadItem = observer(function PostThreadItem({
<Link style={styles.outer} href={itemHref} title={itemTitle}>
<View style={styles.layout}>
<Link style={styles.layoutAvi} href={authorHref} title={authorTitle}>
<Image
style={styles.avi}
source={AVIS[item.author.name] || AVIS['alice.test']}
/>
<Image style={styles.avi} source={DEF_AVATER} />
</Link>
<View style={styles.layoutContent}>
<View style={styles.meta}>

View File

@ -17,7 +17,7 @@ import {Link} from '../util/Link'
import {useStores} from '../../../state'
import {s, colors} from '../../lib/styles'
import {ago} from '../../lib/strings'
import {AVIS} from '../../lib/assets'
import {DEF_AVATER} from '../../lib/assets'
export const Post = observer(function Post({uri}: {uri: string}) {
const store = useStores()
@ -82,10 +82,7 @@ export const Post = observer(function Post({uri}: {uri: string}) {
<Link style={styles.outer} href={itemHref} title={itemTitle}>
<View style={styles.layout}>
<Link style={styles.layoutAvi} href={authorHref} title={authorTitle}>
<Image
style={styles.avi}
source={AVIS[item.author.name] || AVIS['alice.test']}
/>
<Image style={styles.avi} source={DEF_AVATER} />
</Link>
<View style={styles.layoutContent}>
<View style={styles.meta}>

View File

@ -10,7 +10,7 @@ import {Link} from '../util/Link'
import {PostDropdownBtn} from '../util/DropdownBtn'
import {s, colors} from '../../lib/styles'
import {ago} from '../../lib/strings'
import {AVIS} from '../../lib/assets'
import {DEF_AVATER} from '../../lib/assets'
import {useStores} from '../../../state'
export const FeedItem = observer(function FeedItem({
@ -59,10 +59,7 @@ export const FeedItem = observer(function FeedItem({
style={styles.layoutAvi}
href={authorHref}
title={item.author.name}>
<Image
style={styles.avi}
source={AVIS[item.author.name] || AVIS['alice.test']}
/>
<Image style={styles.avi} source={DEF_AVATER} />
</Link>
<View style={styles.layoutContent}>
<View style={styles.meta}>

View File

@ -15,7 +15,7 @@ import {
import {Link} from '../util/Link'
import {useStores} from '../../../state'
import {s, colors} from '../../lib/styles'
import {AVIS} from '../../lib/assets'
import {DEF_AVATER} from '../../lib/assets'
export const ProfileFollowers = observer(function ProfileFollowers({
name,
@ -81,10 +81,7 @@ const User = ({item}: {item: FollowerItem}) => {
<Link style={styles.outer} href={`/profile/${item.name}`} title={item.name}>
<View style={styles.layout}>
<View style={styles.layoutAvi}>
<Image
style={styles.avi}
source={AVIS[item.name] || AVIS['alice.test']}
/>
<Image style={styles.avi} source={DEF_AVATER} />
</View>
<View style={styles.layoutContent}>
<Text style={[s.f15, s.bold]}>{item.displayName}</Text>

View File

@ -6,7 +6,6 @@ import {
Image,
StyleSheet,
Text,
TouchableOpacity,
View,
} from 'react-native'
import {
@ -16,7 +15,7 @@ import {
import {useStores} from '../../../state'
import {Link} from '../util/Link'
import {s, colors} from '../../lib/styles'
import {AVIS} from '../../lib/assets'
import {DEF_AVATER} from '../../lib/assets'
export const ProfileFollows = observer(function ProfileFollows({
name,
@ -82,10 +81,7 @@ const User = ({item}: {item: FollowItem}) => {
<Link style={styles.outer} href={`/profile/${item.name}`} title={item.name}>
<View style={styles.layout}>
<View style={styles.layoutAvi}>
<Image
style={styles.avi}
source={AVIS[item.name] || AVIS['alice.test']}
/>
<Image style={styles.avi} source={DEF_AVATER} />
</View>
<View style={styles.layoutContent}>
<Text style={[s.f15, s.bold]}>{item.displayName}</Text>

View File

@ -15,7 +15,7 @@ import {useStores} from '../../../state'
import {EditProfileModel} from '../../../state/models/shell'
import {pluralize} from '../../lib/strings'
import {s, gradients, colors} from '../../lib/styles'
import {AVIS, BANNER} from '../../lib/assets'
import {DEF_AVATER, BANNER} from '../../lib/assets'
import Toast from '../util/Toast'
import {Link} from '../util/Link'
@ -81,10 +81,7 @@ export const ProfileHeader = observer(function ProfileHeader({
return (
<View style={styles.outer}>
<Image style={styles.banner} source={BANNER} />
<Image
style={styles.avi}
source={AVIS[view.name] || AVIS['alice.test']}
/>
<Image style={styles.avi} source={DEF_AVATER} />
<View style={styles.content}>
<View style={[styles.displayNameLine]}>
<Text style={styles.displayName}>{view.displayName}</Text>

View File

@ -1,9 +1,4 @@
import {ImageSourcePropType} from 'react-native'
export const AVIS: Record<string, ImageSourcePropType> = {
'alice.test': require('../../../public/img/alice.jpg'),
'bob.test': require('../../../public/img/bob.jpg'),
'carol.test': require('../../../public/img/carla.jpg'),
}
export const DEF_AVATER: ImageSourcePropType = require('../../../public/img/default-avatar.jpg')
export const BANNER: ImageSourcePropType = require('../../../public/img/banner.jpg')

View File

@ -1,9 +1,4 @@
import {ImageSourcePropType} from 'react-native'
export const AVIS: Record<string, ImageSourcePropType> = {
'alice.test': {uri: '/img/alice.jpg'},
'bob.test': {uri: '/img/bob.jpg'},
'carol.test': {uri: '/img/carla.jpg'},
}
export const DEF_AVATER: ImageSourcePropType = {uri: '/img/default-avatar.jpg'}
export const BANNER: ImageSourcePropType = {uri: '/img/banner.jpg'}

View File

@ -9,7 +9,7 @@ import {
} from 'react-native'
import RootSiblings from 'react-native-root-siblings'
import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome'
import {AVIS} from '../../lib/assets'
import {DEF_AVATER} from '../../lib/assets'
import {s, colors} from '../../lib/styles'
export function createAccountsMenu({
@ -34,7 +34,7 @@ export function createAccountsMenu({
<TouchableOpacity
style={[styles.menuItem]}
onPress={() => onPressItem(0)}>
<Image style={styles.avi} source={AVIS['alice.test']} />
<Image style={styles.avi} source={DEF_AVATER} />
<Text style={[styles.label, s.bold]}>Alice</Text>
</TouchableOpacity>
<TouchableOpacity

View File

@ -33,7 +33,7 @@ import {createBackMenu, createForwardMenu} from './history-menu'
import {createAccountsMenu} from './accounts-menu'
import {createLocationMenu} from './location-menu'
import {s, colors} from '../../lib/styles'
import {AVIS} from '../../lib/assets'
import {DEF_AVATER} from '../../lib/assets'
const locationIconNeedsNudgeUp = (icon: IconProp) => icon === 'house'
const SWIPE_GESTURE_DIST_TRIGGER = 0.5
@ -186,7 +186,7 @@ export const MobileShell: React.FC = observer(() => {
<View style={styles.outerContainer}>
<View style={styles.topBar}>
<TouchableOpacity onPress={onPressAvi}>
<Image style={styles.avi} source={AVIS['alice.test']} />
<Image style={styles.avi} source={DEF_AVATER} />
</TouchableOpacity>
<Location
icon={screenRenderDesc.icon}