Rework profile header controls

zio/stable
Paul Frazee 2022-10-10 21:13:10 -05:00
parent f5c4a97eaf
commit 287f2992fa
2 changed files with 50 additions and 35 deletions

View File

@ -86,16 +86,14 @@ export const ProfileHeader = observer(function ProfileHeader({
<View style={[styles.displayNameLine]}> <View style={[styles.displayNameLine]}>
<Text style={styles.displayName}>{view.displayName}</Text> <Text style={styles.displayName}>{view.displayName}</Text>
</View> </View>
{ <View style={styles.badgesLine}>
undefined /*TODO<View style={styles.badgesLine}>
<FontAwesomeIcon icon="shield" style={s.mr5} size={12} /> <FontAwesomeIcon icon="shield" style={s.mr5} size={12} />
<Link href="/" title="Badge TODO"> <Link href="/" title="Badge TODO">
<Text style={[s.f12, s.bold]}> <Text style={[s.f12, s.bold]}>
Employee <Text style={[s.blue3]}>@blueskyweb.xyz</Text> Employee <Text style={[s.blue3]}>@blueskyweb.xyz</Text>
</Text> </Text>
</Link> </Link>
</View>*/ </View>
}
<View style={[styles.buttonsLine]}> <View style={[styles.buttonsLine]}>
{isMe ? ( {isMe ? (
<TouchableOpacity <TouchableOpacity
@ -103,31 +101,40 @@ export const ProfileHeader = observer(function ProfileHeader({
style={[styles.mainBtn, styles.btn]}> style={[styles.mainBtn, styles.btn]}>
<Text style={[s.fw400, s.f14]}>Edit Profile</Text> <Text style={[s.fw400, s.f14]}>Edit Profile</Text>
</TouchableOpacity> </TouchableOpacity>
) : view.myState.follow ? ( ) : (
<>
{view.myState.follow ? (
<TouchableOpacity <TouchableOpacity
onPress={onPressToggleFollow} onPress={onPressToggleFollow}
style={[styles.mainBtn, styles.btn]}> style={[styles.mainBtn, styles.btn]}>
<FontAwesomeIcon icon="check" style={[s.mr5]} size={14} />
<Text style={[s.fw400, s.f14]}>Following</Text> <Text style={[s.fw400, s.f14]}>Following</Text>
</TouchableOpacity> </TouchableOpacity>
) : ( ) : (
<TouchableOpacity onPress={onPressToggleFollow}> <TouchableOpacity
<LinearGradient onPress={onPressToggleFollow}
colors={[gradients.primary.start, gradients.primary.end]} style={[styles.mainBtn, styles.btn]}>
start={{x: 0, y: 0}} <FontAwesomeIcon icon="rss" style={[s.mr5]} size={13} />
end={{x: 1, y: 1}} <Text style={[s.fw400, s.f14]}>Follow</Text>
style={[styles.followBtn]}>
<FontAwesomeIcon icon="plus" style={[s.white, s.mr5]} />
<Text style={[s.white, s.fw600, s.f16]}>Follow</Text>
</LinearGradient>
</TouchableOpacity> </TouchableOpacity>
)} )}
{ <TouchableOpacity
undefined /*TODO<TouchableOpacity
onPress={onPressMenu} onPress={onPressMenu}
style={[styles.btn, styles.secondaryBtn, s.ml10]}> style={[styles.btn, styles.secondaryBtn, s.mr5]}>
<FontAwesomeIcon icon="user-plus" style={[s.gray5]} />
</TouchableOpacity>
<TouchableOpacity
onPress={onPressMenu}
style={[styles.btn, styles.secondaryBtn, s.mr5]}>
<FontAwesomeIcon icon="note-sticky" style={[s.gray5]} />
</TouchableOpacity>
</>
)}
<TouchableOpacity
onPress={onPressMenu}
style={[styles.btn, styles.secondaryBtn]}>
<FontAwesomeIcon icon="ellipsis" style={[s.gray5]} /> <FontAwesomeIcon icon="ellipsis" style={[s.gray5]} />
</TouchableOpacity>*/ </TouchableOpacity>
}
</View> </View>
<View style={[s.flexRow]}> <View style={[s.flexRow]}>
<TouchableOpacity <TouchableOpacity
@ -203,24 +210,24 @@ const styles = StyleSheet.create({
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
paddingVertical: 6, paddingVertical: 6,
paddingLeft: 55, borderRadius: 6,
paddingRight: 60, marginRight: 6,
borderRadius: 30,
borderWidth: 1,
borderColor: 'transparent',
}, },
btn: { btn: {
flex: 1,
alignItems: 'center', alignItems: 'center',
justifyContent: 'center', justifyContent: 'center',
paddingVertical: 7, paddingVertical: 7,
borderRadius: 30, borderRadius: 4,
borderWidth: 1, backgroundColor: colors.gray1,
borderColor: colors.gray2, marginRight: 6,
}, },
mainBtn: { mainBtn: {
paddingHorizontal: 40, flexDirection: 'row',
}, },
secondaryBtn: { secondaryBtn: {
paddingHorizontal: 12, flex: 0,
paddingHorizontal: 14,
marginRight: 0,
}, },
}) })

View File

@ -29,15 +29,19 @@ import {faLink} from '@fortawesome/free-solid-svg-icons/faLink'
import {faLock} from '@fortawesome/free-solid-svg-icons/faLock' import {faLock} from '@fortawesome/free-solid-svg-icons/faLock'
import {faMagnifyingGlass} from '@fortawesome/free-solid-svg-icons/faMagnifyingGlass' import {faMagnifyingGlass} from '@fortawesome/free-solid-svg-icons/faMagnifyingGlass'
import {faMessage} from '@fortawesome/free-regular-svg-icons/faMessage' import {faMessage} from '@fortawesome/free-regular-svg-icons/faMessage'
import {faNoteSticky} from '@fortawesome/free-solid-svg-icons/faNoteSticky'
import {faPenNib} from '@fortawesome/free-solid-svg-icons/faPenNib' import {faPenNib} from '@fortawesome/free-solid-svg-icons/faPenNib'
import {faPenToSquare} from '@fortawesome/free-solid-svg-icons/faPenToSquare'
import {faPlus} from '@fortawesome/free-solid-svg-icons/faPlus' import {faPlus} from '@fortawesome/free-solid-svg-icons/faPlus'
import {faShare} from '@fortawesome/free-solid-svg-icons/faShare' import {faShare} from '@fortawesome/free-solid-svg-icons/faShare'
import {faShareFromSquare} from '@fortawesome/free-solid-svg-icons/faShareFromSquare' import {faShareFromSquare} from '@fortawesome/free-solid-svg-icons/faShareFromSquare'
import {faShield} from '@fortawesome/free-solid-svg-icons/faShield' import {faShield} from '@fortawesome/free-solid-svg-icons/faShield'
import {faReply} from '@fortawesome/free-solid-svg-icons/faReply' import {faReply} from '@fortawesome/free-solid-svg-icons/faReply'
import {faRetweet} from '@fortawesome/free-solid-svg-icons/faRetweet' import {faRetweet} from '@fortawesome/free-solid-svg-icons/faRetweet'
import {faRss} from '@fortawesome/free-solid-svg-icons/faRss'
import {faUser} from '@fortawesome/free-regular-svg-icons/faUser' import {faUser} from '@fortawesome/free-regular-svg-icons/faUser'
import {faUsers} from '@fortawesome/free-solid-svg-icons/faUsers' import {faUsers} from '@fortawesome/free-solid-svg-icons/faUsers'
import {faUserCheck} from '@fortawesome/free-solid-svg-icons/faUserCheck'
import {faUserPlus} from '@fortawesome/free-solid-svg-icons/faUserPlus' import {faUserPlus} from '@fortawesome/free-solid-svg-icons/faUserPlus'
import {faTicket} from '@fortawesome/free-solid-svg-icons/faTicket' import {faTicket} from '@fortawesome/free-solid-svg-icons/faTicket'
import {faX} from '@fortawesome/free-solid-svg-icons/faX' import {faX} from '@fortawesome/free-solid-svg-icons/faX'
@ -73,15 +77,19 @@ export function setup() {
faLock, faLock,
faMagnifyingGlass, faMagnifyingGlass,
faMessage, faMessage,
faNoteSticky,
faPenNib, faPenNib,
faPenToSquare,
faPlus, faPlus,
faReply, faReply,
faRetweet, faRetweet,
faRss,
faShare, faShare,
faShareFromSquare, faShareFromSquare,
faShield, faShield,
faUser, faUser,
faUsers, faUsers,
faUserCheck,
faUserPlus, faUserPlus,
faTicket, faTicket,
faX, faX,