diff --git a/public/img/banner.jpg b/public/img/banner.jpg deleted file mode 100644 index 097c24f7..00000000 Binary files a/public/img/banner.jpg and /dev/null differ diff --git a/public/img/beta-banner.jpg b/public/img/beta-banner.jpg deleted file mode 100644 index 1d00bc1a..00000000 Binary files a/public/img/beta-banner.jpg and /dev/null differ diff --git a/src/view/com/profile/ProfileHeader.tsx b/src/view/com/profile/ProfileHeader.tsx index d492aa1f..7383e1e1 100644 --- a/src/view/com/profile/ProfileHeader.tsx +++ b/src/view/com/profile/ProfileHeader.tsx @@ -15,10 +15,9 @@ import {useStores} from '../../../state' import {EditProfileModel} from '../../../state/models/shell' import {pluralize} from '../../lib/strings' import {s, gradients, colors} from '../../lib/styles' -import {BANNER} from '../../lib/assets' import Toast from '../util/Toast' import {UserAvatar} from '../util/UserAvatar' -import {Link} from '../util/Link' +import {UserBanner} from '../util/UserBanner' export const ProfileHeader = observer(function ProfileHeader({ view, @@ -84,7 +83,7 @@ export const ProfileHeader = observer(function ProfileHeader({ const isMe = store.me.did === view.did return ( - + {store.nav.tab.canGoBack ? ( - - + + @@ -42,6 +42,11 @@ export function UserAvatar({ ) } +export function getGradient(handle: string): string[] { + const gi = cyrb53(handle) % GRADIENTS.length + return GRADIENTS[gi] +} + function getInitials(str: string): string { const tokens = str .split(' ') diff --git a/src/view/com/util/UserBanner.tsx b/src/view/com/util/UserBanner.tsx new file mode 100644 index 00000000..aa7ceab8 --- /dev/null +++ b/src/view/com/util/UserBanner.tsx @@ -0,0 +1,23 @@ +import React from 'react' +import Svg, {Rect, Defs, LinearGradient, Stop} from 'react-native-svg' +import {getGradient} from './UserAvatar' + +export function UserBanner({handle}: {handle: string}) { + const gradient = getGradient(handle) + return ( + + + + + + + + + + + + + + + ) +} diff --git a/src/view/lib/assets.native.ts b/src/view/lib/assets.native.ts index 9dd4494f..1655b6a0 100644 --- a/src/view/lib/assets.native.ts +++ b/src/view/lib/assets.native.ts @@ -1,4 +1,3 @@ import {ImageSourcePropType} from 'react-native' export const DEF_AVATAR: ImageSourcePropType = require('../../../public/img/default-avatar.jpg') -export const BANNER: ImageSourcePropType = require('../../../public/img/beta-banner.jpg') diff --git a/src/view/lib/assets.ts b/src/view/lib/assets.ts index ee3c286d..8e85b948 100644 --- a/src/view/lib/assets.ts +++ b/src/view/lib/assets.ts @@ -1,4 +1,3 @@ import {ImageSourcePropType} from 'react-native' export const DEF_AVATAR: ImageSourcePropType = {uri: '/img/default-avatar.jpg'} -export const BANNER: ImageSourcePropType = {uri: '/img/beta-banner.jpg'}