diff --git a/src/view/com/util/ViewHeader.tsx b/src/view/com/util/ViewHeader.tsx index c6eaba5d..74886b97 100644 --- a/src/view/com/util/ViewHeader.tsx +++ b/src/view/com/util/ViewHeader.tsx @@ -9,9 +9,10 @@ import { import {FontAwesomeIcon} from '@fortawesome/react-native-fontawesome' import {UserAvatar} from './UserAvatar' import {Text} from './text/Text' -import {s, colors} from '../../lib/styles' import {MagnifyingGlassIcon} from '../../lib/icons' import {useStores} from '../../../state' +import {useTheme} from '../../lib/ThemeContext' +import {usePalette} from '../../lib/hooks/usePalette' const HITSLOP = {left: 10, top: 10, right: 10, bottom: 10} const BACK_HITSLOP = {left: 10, top: 10, right: 30, bottom: 10} @@ -27,6 +28,8 @@ export const ViewHeader = observer(function ViewHeader({ canGoBack?: boolean onPost?: () => void }) { + const theme = useTheme() + const pal = usePalette('default') const store = useStores() const onPressBack = () => { store.nav.tab.goBack() @@ -50,7 +53,7 @@ export const ViewHeader = observer(function ViewHeader({ canGoBack = store.nav.tab.canGoBack } return ( - + ) : ( - {title} + + {title} + {subtitle ? ( - + {subtitle} ) : undefined} @@ -81,38 +89,40 @@ export const ViewHeader = observer(function ViewHeader({ - + style={[styles.btn, {backgroundColor: pal.colors.backgroundLight}]}> + - + style={[ + styles.btn, + {backgroundColor: pal.colors.backgroundLight, marginLeft: 4}, + ]}> + {!store.session.online ? ( {store.session.attemptingConnect ? ( ) : ( <> - + )} @@ -126,12 +136,9 @@ const styles = StyleSheet.create({ header: { flexDirection: 'row', alignItems: 'center', - backgroundColor: colors.white, paddingHorizontal: 12, paddingTop: 6, paddingBottom: 6, - borderBottomColor: colors.gray1, - borderBottomWidth: 1, }, titleContainer: { @@ -139,15 +146,8 @@ const styles = StyleSheet.create({ alignItems: 'baseline', marginRight: 'auto', }, - title: { - fontSize: 21, - fontWeight: '600', - color: colors.black, - }, subtitle: { - fontSize: 18, marginLeft: 6, - color: colors.gray4, maxWidth: 200, }, @@ -157,24 +157,8 @@ const styles = StyleSheet.create({ flexDirection: 'row', alignItems: 'center', justifyContent: 'center', - backgroundColor: colors.gray1, width: 36, height: 36, borderRadius: 20, }, - searchBtnIcon: { - color: colors.black, - position: 'relative', - top: -1, - }, - - offline: { - backgroundColor: colors.white, - }, - offlineBtn: { - backgroundColor: colors.white, - borderRadius: 5, - paddingVertical: 5, - paddingHorizontal: 10, - }, })