Add avi and context menu to shell topbar

zio/stable
Paul Frazee 2022-08-31 20:43:36 -05:00
parent b3b2cfe909
commit 6bec139679
2 changed files with 42 additions and 8 deletions

View File

@ -31,7 +31,7 @@ const styles = StyleSheet.create({
position: 'absolute', position: 'absolute',
zIndex: zIndex.FAB, zIndex: zIndex.FAB,
right: 20, right: 20,
bottom: 20, bottom: 10,
width: 50, width: 50,
height: 50, height: 50,
borderRadius: 25, borderRadius: 25,

View File

@ -2,6 +2,7 @@ import React, {useRef} from 'react'
import {observer} from 'mobx-react-lite' import {observer} from 'mobx-react-lite'
import { import {
GestureResponderEvent, GestureResponderEvent,
Image,
SafeAreaView, SafeAreaView,
StyleSheet, StyleSheet,
Text, Text,
@ -17,15 +18,26 @@ import {match, MatchResult} from '../../routes'
import {TabsSelectorModal} from './tabs-selector' import {TabsSelectorModal} from './tabs-selector'
import {createBackMenu, createForwardMenu} from './history-menu' import {createBackMenu, createForwardMenu} from './history-menu'
import {colors} from '../../lib/styles' import {colors} from '../../lib/styles'
import {AVIS} from '../../lib/assets'
const locationIconNeedsNudgeUp = (icon: IconProp) => icon === 'house'
const Location = ({icon, title}: {icon: IconProp; title?: string}) => { const Location = ({icon, title}: {icon: IconProp; title?: string}) => {
const nudgeUp = locationIconNeedsNudgeUp(icon)
return ( return (
<TouchableOpacity style={styles.location}> <TouchableOpacity style={styles.location}>
{title ? ( {title ? (
<FontAwesomeIcon size={16} style={styles.locationIcon} icon={icon} /> <FontAwesomeIcon
size={12}
style={[
styles.locationIcon,
nudgeUp ? styles.locationIconNudgeUp : undefined,
]}
icon={icon}
/>
) : ( ) : (
<FontAwesomeIcon <FontAwesomeIcon
size={16} size={12}
style={styles.locationIconLight} style={styles.locationIconLight}
icon="magnifying-glass" icon="magnifying-glass"
/> />
@ -90,10 +102,14 @@ export const MobileShell: React.FC = observer(() => {
return ( return (
<View style={styles.outerContainer}> <View style={styles.outerContainer}>
<View style={styles.topBar}> <View style={styles.topBar}>
<Image style={styles.avi} source={AVIS['carla.com']} />
<Location <Location
icon={screenRenderDesc.icon} icon={screenRenderDesc.icon}
title={stores.nav.tab.current.title} title={stores.nav.tab.current.title}
/> />
<TouchableOpacity style={styles.topBarBtn}>
<FontAwesomeIcon icon="ellipsis" />
</TouchableOpacity>
</View> </View>
<SafeAreaView style={styles.innerContainer}> <SafeAreaView style={styles.innerContainer}>
<ScreenContainer> <ScreenContainer>
@ -191,22 +207,34 @@ const styles = StyleSheet.create({
paddingTop: 40, paddingTop: 40,
paddingBottom: 5, paddingBottom: 5,
}, },
avi: {
width: 28,
height: 28,
marginRight: 8,
borderRadius: 14,
},
location: { location: {
flex: 1, flex: 1,
flexDirection: 'row', flexDirection: 'row',
borderRadius: 4, borderRadius: 6,
paddingLeft: 10, paddingLeft: 10,
paddingRight: 6, paddingRight: 6,
paddingTop: 6, paddingTop: 6,
paddingBottom: 6, paddingBottom: 6,
backgroundColor: '#F8F3F3', backgroundColor: colors.gray1,
// justifyContent: 'center',
}, },
locationIcon: { locationIcon: {
color: colors.pink3, color: colors.gray5,
marginRight: 8, marginTop: 3,
marginRight: 6,
},
locationIconNudgeUp: {
marginTop: 2,
}, },
locationIconLight: { locationIconLight: {
color: colors.gray3, color: colors.gray5,
marginTop: 2,
marginRight: 8, marginRight: 8,
}, },
locationText: { locationText: {
@ -215,6 +243,12 @@ const styles = StyleSheet.create({
locationTextLight: { locationTextLight: {
color: colors.gray4, color: colors.gray4,
}, },
topBarBtn: {
marginLeft: 8,
justifyContent: 'center',
borderRadius: 6,
paddingHorizontal: 6,
},
bottomBar: { bottomBar: {
flexDirection: 'row', flexDirection: 'row',
backgroundColor: colors.white, backgroundColor: colors.white,